1 [[!meta title="More make idoms"]]
2 [[!meta date="2008-08-31 20:27:09"]]
3 I'm rather proud of this one (can you tell I'm overhauling sawsim's
11 all : $(FILES:%=$(DT)/%)
19 #$(FILES:%=$(DT)/%) : $$($$@:$(DT)/%=$(DS)/%) $(DT)
20 # This colon --^ produces: "target pattern contains no `%'."
21 # Instead use this idom --v
22 $(FILES:%=$(DT)/%) : $$(subst $(DT),$(DS),$$@) $(DT)
23 @echo "looking for $< for $@"
28 @echo "missing rule for $@"
31 looking for src/a for targ/a
32 looking for src/b for targ/b
36 Of course you could accomplish the same effect with
39 @echo "looking for $< for %@"
41 but what fun is that? ;)
43 [[!tag tags/programming]]