On Mon, 2010-05-03 at 09:13 +0200, Håkan Kvist wrote: > Hi. > > This problem is found with GNU Make 3.81, on Ubuntu GNU/Linux 8.10 > x86. > > 4.11 Multiple Rules for One Target > One file can be the target of several rules. All the prerequisites > mentioned in all the rules are merged into one list of prerequisites > for the target. If the target is older than any prerequisite from any > rule, the commands are executed.
This only applies to normal rules, not to pattern rules. Look at the section in the GNU make manual on pattern rules to see what it means to have a pattern rule with no prerequisites: it's something very different. > all: $(patsubst %.in,%.out,$(wildcard *.in)) > > %.out: executable > %.out: %.in > @echo prerequisite: $^ > test -f executable || exit 1 > > executable: > sleep 20 > touch $@ You could do this: TARGETS := $(patsubst %.in,%.out,$(wildcard *.in)) all: $(TARGETS) $(TARGETS): executable %.out: %.in ...etc... -- ------------------------------------------------------------------------------- Paul D. Smith <psm...@gnu.org> Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make