-all: test
+SUBDIRS := src/ tests/
-test: test.c
- gcc -O2 -g -Wall -o test test.c
-
-.PHONY: clean
+all: $(SUBDIRS)
+$(SUBDIRS):
+ $(MAKE) -C $@
clean:
- rm -f test
+ for dir in $(SUBDIRS); do $(MAKE) clean -C $$dir; done
+
+.PHONY: all $(SUBDIRS) clean