Will GNU Make automatically add additional preconditions?
The following snippet of an example is presented in "Managing Projects with GNU Make (3rd Edition)" on page 21.
count_words: counter.o lexer.o -lfl
The author says he make
will automatically add count_words.o
to the list of preconditions on an implicit rule. Quoted:
..., make identifies four prerequisites: count_words.o (this condition is not in the makefile, but is enforced by an implicit rule), counter.o, lexer.o, and -lfl.
However, my test doesn't match this. Here's my test:
prog: abc.o
@echo $^
abc.o:
@echo abc.o built.
prog.o:
@echo prog.o bulit.
Exit after startup make
:
abc.o is built.
abc.o
make
not looking prog.o
for a purpose prog
. What is the problem? Is there something wrong with my test?
By the way, my test is on Cygwin
p GNU Make 4.1
.
source to share