Added top-level makefile for ease of building and cleaning.

This commit is contained in:
Ian Dinwoodie
2019-05-17 23:50:22 -04:00
parent 9af1dde2eb
commit 176fe54642
3 changed files with 27 additions and 0 deletions

9
Makefile Normal file
View File

@@ -0,0 +1,9 @@
all: examples
examples:
$(MAKE) -C $@
clean:
$(MAKE) -C examples $@
.PHONY: all examples clean

16
examples/Makefile Normal file
View File

@@ -0,0 +1,16 @@
dirs= creational
cleandirs= $(dirs:%=clean-%)
all: $(dirs)
$(dirs):
$(MAKE) -C $@
clean: $(cleandirs)
$(cleandirs):
$(MAKE) -C $(@:clean-%=%) clean
.PHONY: subdirs $(dirs)
.PHONY: subdirs $(cleandirs)
.PHONY: all clean

View File

@@ -9,3 +9,5 @@ $(targets): %: %.cpp
clean:
$(RM) $(targets)
.PHONY: all clean