Le jeudi 03 août 2017 à 14:59 +0200, Benjamin Cama a écrit : > To further enhance my understanding of the “right” usage of Makefiles, > would you advise me to explicitly specify the subdirectory in the > target > definition? Because I feel that counting on pattern rules to match in > subdirectory is kind of hackish, now. Like: > > $(SUBDIR)/target-%: > … > > And in my particular case, I actually know the $(SUBDIR), but would it > be right then to call make with: > > make SUBDIR=foo foo/target-1234 > > ? It looks redundant to me.
Well, I tried: SUBDIR = $(dir $@) $(SUBDIR)/target-%: … But it doesn't work. But without a slash (which is already present at the end of $(SUBDIR)), it actually works!: SUBDIR = $(dir $@) $(SUBDIR)target-%: … Is this a bug? -- Benjamin Cama - Tél : 258 _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make