ifneq "$(MAKECMDGOALS)" "clean"
include ../config/Makefile.include
endif

QUICKSUBDIRS =  \
        error \
        utilities \
        pixeltypes \
        colorspaces \
        imgproc \
        functorexpression \
        convolution \
        morphology \
        fourier \
        math \
        tensorimaging \
        simpleanalysis


SUBDIRS = $(QUICKSUBDIRS) \
        image \
        multiarray \
        multiconvolution \
        voxelneighborhood \
        volumelabeling \
        watersheds3d \
        multidistance \
        multimorphology \
        seededRegionGrowing3d \
        impex 

all:
	@rm -f testSuccess $(vigra_testdir)/testSuccess ; \
         for i in $(SUBDIRS); do \
	        cd $$i; \
	        $(MAKE) || exit 1; \
	        cd ..; \
	 done ; \
	 touch testSuccess $(vigra_testdir)/testSuccess

quick:
	@for i in $(QUICKSUBDIRS); do \
	        cd $$i; \
	        $(MAKE) || exit 1; \
	        cd ..; \
	 done

vc:
	@rm -f testSuccess ; \
	 for i in $(SUBDIRS); do \
	        cd $$i; \
	        $(MAKE) $$i.exe || exit 1; \
	        cd ..; \
	 done ; \
	 touch testSuccess

clean:
	rm -f *.opt testSuccess	
	@for i in $(SUBDIRS); do \
	        cd $$i; \
	        $(MAKE) clean; \
	        cd ..; \
	 done
