include $(SRCTOP)/Makefile.vars

.PHONY: all clean depend headers install subdirs

all:
	if [ "$(PROJECT.LIBS)" != "" ]; then sh -c 'for lib in $(PROJECT.LIBS); do $(MAKE) -C $$lib all || exit; done;'; fi

clean:
	if [ "$(PROJECT.LIBS)" != "" ]; then sh -c 'for lib in $(PROJECT.LIBS); do $(MAKE) -C $$lib clean || exit; done;'; fi
     
depend: headers
	if [ "$(PROJECT.LIBS)" != "" ]; then sh -c 'for lib in $(PROJECT.LIBS); do $(MAKE) -C $$lib depend || exit; done;'; fi

headers:
	if [ "$(PROJECT.LIBS)" != "" ]; then sh -c 'for lib in $(PROJECT.LIBS); do $(MAKE) -C $$lib headers || exit; done;'; fi

install:
	if [ "$(PROJECT.LIBS)" != "" ]; then sh -c 'for lib in $(PROJECT.LIBS); do $(MAKE) -C $$lib install || exit; done;'; fi

install-lib:
	if [ "$(PROJECT.LIBS)" != "" ]; then sh -c 'for lib in $(PROJECT.LIBS); do $(MAKE) -C $$lib install-lib || exit; done;'; fi

install-headers:
	if [ "$(PROJECT.LIBS)" != "" ]; then sh -c 'for lib in $(PROJECT.LIBS); do $(MAKE) -C $$lib install-headers || exit; done;'; fi

subdirs:
	if [ "$(PROJECT.LIBS)" != "" ]; then sh -c 'for lib in $(PROJECT.LIBS); do mkdir $$lib; ln -s $(SRCTOP)/lib/$$lib/Makefile.src $$lib/Makefile; touch $$lib/Makefile.deps; done;'; fi
