-SOURCES = $(wildcard */*.dsp)
-DIRS = sinwave fft primitives # 2d_fft close fft open sinwave dilation erosion licenseplate primitives
+EXAMPLES = 2d_fft close dilation erosion fft open primitives sinwave nstvector #licenceplate
-all: eachexample
+all: examples
-define mytarget
- eachexample:: ; $(MAKE) -C $1
-endef
-
-$(foreach dir,$(DIRS),$(eval $(call mytarget,$(dir))))
+examples::
+ @echo "Making all the examples, it may take several minutes..."
+ @$(foreach example, $(EXAMPLES), $(MAKE) -C $(example);)
+clean::
+ @$(foreach example, $(EXAMPLES), $(MAKE) -C $(example) clean;)
+ rm -f */*~