#*** Copyright 2002-2004 The Acute Team
#
#  Allen-Williams, Mair
#  Bishop, Steven
#  Fairbairn, Matthew
#  Habouzit, Pierre [*]
#  Leifer, James [*]
#  Sewell, Peter
#  Sjberg, Vilhelm
#  Steinruecken, Christian
#  Vafeiadis, Viktor
#  Wansbrough, Keith
#  Zappa Nardelli, Francesco [*]
#  Institut National de Recherche en Informatique et en Automatique (INRIA)
#
#  Contributions of authors marked [*] are copyright INRIA.
#
#All rights reserved.
#
#This file is distributed under the terms of the GNU Lesser General
#Public License, with the special exception on linking described in
#file NEW-LICENSE.
#
#***

# Calls and returns are logged only if NS_LOGGING is defined:
#NS_LOGGING=1
#export NS_LOGGING

ifdef NS_LOGGING
MINIMAL=nssock ocamllib ocamlext common
#libd slurp \
#	injector
SUBDIRS=$(MINIMAL) identtest utils tthee tests
else
MINIMAL=nssock ocamllib
SUBDIRS=$(MINIMAL)
endif

all::
	for i in $(SUBDIRS); do \
	if [ -d $$i ]; then \
	cd $$i && $(MAKE) all; \
	if [ $$? -eq 0 ] ;  then true && cd ..; else exit 1; \
	fi; \
	fi; \
	done

min::
	for i in $(MINIMAL); do \
	if [ -d $$i ]; then \
	cd $$i && $(MAKE) all; \
	if [ $$? -eq 0 ] ;  then true && cd ..; else exit 1; \
	fi; \
	fi; \
	done

mindepend::
	for i in $(MINIMAL); do \
	if [ -d $$i ]; then \
	cd $$i && $(MAKE) depend; \
	if [ $$? -eq 0 ] ;  then true && cd ..; else exit 1; \
	fi; \
	fi; \
	done

minrealclean::
	for i in $(MINIMAL); do \
	if [ -d $$i ]; then \
	cd $$i && $(MAKE) realclean; \
	if [ $$? -eq 0 ] ;  then true && cd ..; else exit 1; \
	fi; \
	fi; \
	done

clean::
	for i in $(SUBDIRS); do \
	if [ -d $$i ]; then \
	cd $$i && $(MAKE) clean; \
	if [ $$? -eq 0 ] ;  then true && cd ..; else exit 1; \
	fi; \
	fi; \
	done

realclean::
	for i in $(SUBDIRS); do \
	if [ -d $$i ]; then \
	cd $$i && $(MAKE) realclean; \
	if [ $$? -eq 0 ] ;  then true && cd ..; else exit 1; \
	fi; \
	fi; \
	done

depend::
	for i in $(SUBDIRS); do \
	if [ -d $$i ]; then \
	cd $$i && $(MAKE) depend; \
	if [ $$? -eq 0 ] ;  then true && cd ..; else exit 1; \
	fi; \
	fi; \
	done

ifdef MAKECMDGOALS
ifneq ($(MAKECMDGOALS),clean)
-include .depend
endif
else
-include .depend
endif
