At the make manual said:
During the first phase it reads all the makefiles, included makefiles, etc. and internalizes all the variables and their values, implicit and explicit rules, and constructs a dependency graph of all the targets and their prerequisites.
I don't understand how the dependency graph constructed? Consider the following makefile:
%.o: %.z
echo This is overriden implicit rule
default: foo.o
clean:
rm -f fmake test_second
%.o: %.c
echo This is customized implicit rule
After make
command
echo This is customized implicit rule
This is customized implicit rule
is displayed, but I'm expexted that
echo This is overriden implicit rule
This is overriden implicit rule
will be, because in make rule only overrides if both the target and the prerequisite patterns match. In this case I think that %.o: %.z
implicit rules matched to pattern already.
foo.c
exists, butfoo.z
does not. Am I right? – Beta-d
option and make will print out exactly what steps its following. If indeed there is afoo.z
file here then the behavior you're seeing should not happen given the makefile here. So, something in your actual setup is not as you've described it here. – MadScientist