From 275dbc3c1b8cb19a9b4ab8d45c66afcb12624314 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Mon, 18 Mar 2013 15:05:41 -0600 Subject: [PATCH] update Makefile to process subdirs and have a clean target --- packages/Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/Makefile b/packages/Makefile index 55f374a..74ae8d0 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -1,5 +1,9 @@ .SUFFIXES: .5c .py .fp +DIRS= \ + pinheader \ + tyco + FOOTPRINTS= \ MS5607.fp \ uson-8.fp \ @@ -14,4 +18,20 @@ FOOTPRINTS= \ .py.fp: python $*.py > $@ -all: $(FOOTPRINTS) \ No newline at end of file +BUILDDIRS=$(DIRS:%=build-%) +CLEANDIRS=$(DIRS:%=clean-%) + +all: $(BUILDDIRS) $(FOOTPRINTS) +$(DIRS): $(BUILDDIRS) +$(BUILDDIRS): + $(MAKE) -C $(@:build-%=%) + +$(CLEANDIRS): + $(MAKE) -C $(@:clean-%=%) clean + +clean: $(CLEANDIRS) + rm -f $(FOOTPRINTS) + +.PHONY: subdirs $(DIRS) +.PHONY: subdirs $(BUILDDIRS) +.PHONY: subdirs $(CLEANDIRS) -- 2.47.2