From 6e0abca1546a9254127e08f67c419b2f3d22cd41 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 24 Oct 2010 20:48:54 -0300 Subject: [PATCH] bom/Makefile generalization - bom/Makefile: simplify atusd.ord and atusd.par rule by using $^ - bom/Makefile: use pattern rule for atusd.ord and atusd.par - bom/Makefile: since we can't have more than one percent sign on a dependency, add vpath - bom/Makefile: use pattern rule for show-atusd. We also have to remove show-atusd from .PHONY because implicit rules are not applied to phony targets. --- bom/Makefile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/bom/Makefile b/bom/Makefile index d846393..7d650b9 100644 --- a/bom/Makefile +++ b/bom/Makefile @@ -11,7 +11,7 @@ DSC=dk/digi-key.dsc $(shell $(BOOM_CONFIG) dsc) CHR=$(shell $(BOOM_CONFIG) chr) -.PHONY: all again show-atusd spotless +.PHONY: all again spotless all: atusd.ord @@ -19,14 +19,13 @@ again: $(MAKE) spotless $(MAKE) all -atusd.ord: atusd.par $(INV) $(EQU) - $(BOOM) part2order $(KITS) $(INV) $(EQU) atusd.par >$@ || \ - { rm -f $@; exit 1; } +%.ord: %.par $(INV) $(EQU) + $(BOOM) part2order $(KITS) $^ >$@ || { rm -f $@; exit 1; } -atusd.par: $(EQU) $(INV) $(CHR) ../atusd/atusd.lst atrf.sub - $(BOOM) bom2part $(EQU) $(INV) $(CHR) \ - ../atusd/atusd.lst atrf.sub \ - >$@ || { rm -f $@; exit 1; } +vpath atusd.lst ../atusd + +%.par: $(EQU) $(INV) $(CHR) %.lst atrf.sub + $(BOOM) bom2part $^ >$@ || { rm -f $@; exit 1; } dk/digi-key.inv: $(MAKE) -C dk digi-key.inv @@ -34,8 +33,8 @@ dk/digi-key.inv: dk/digi-key.dsc: $(MAKE) -C dk digi-key.dsc -show-atusd: atusd.ord $(DSC) - grep -vw ATRF atusd.ord | $(BOOM) prettyord -t - $(DSC) | \ +show-%: %.ord $(DSC) + grep -vw ATRF $< | $(BOOM) prettyord -t - $(DSC) | \ sed 's/^... //' spotless: