SUBDIRS=common
SUBDIRS+=$(notdir $(shell find . -maxdepth 1 -mindepth 1 -type d ! -name CVS ! -name .svn ! -name common))

.PHONY: all
all: all_subdirs

.PHONY: all_subdirs
all_subdirs: $(patsubst %, _all_%, $(SUBDIRS))

.PHONY: $(patsubst %, _all_%, $(SUBDIRS))
$(patsubst %, _all_%, $(SUBDIRS)) : 
	$(MAKE) -C $(patsubst _all_%, %, $@)

.PHONY: clean
clean: clean_subdirs

.PHONY: clean_subdirs
clean_subdirs: $(patsubst %, _clean_%, $(SUBDIRS))

.PHONY: $(patsubst %, _clean_%, $(SUBDIRS))
$(patsubst %, _clean_%, $(SUBDIRS)) : 
	$(MAKE) -C $(patsubst _clean_%, %, $@) clean



srcdist:
	fname=nedapsrc-$(shell date +%y%m%d-%H%M); \
	find . ! -path "*/.svn*" -a ! -path "*/hook_test*" -a ! -path "*/fraud_patch*" -a ! -path "*/show_chesspiece/old*" -type f ! -print0 | xargs -0 tar zcf $$fname.tar.gz


