Hi, I happen to find an odd problem when I am experiment with gnu
make. And I have written a really simple makefile to test how make
work when chaining rules together to generate the target.
My makefile is somewhat look like this:
#makefile
pro: ok.h pro.c
%:%.c
%.c:
@echo generate $@
%.h:
@echo generate $@
%.l:
@echo use %.l rule and generate $@
#%:%.o
# @echo $+
%:%.l pro.c
@echo use .l rule and generate $@
There is only a makefile in the folder. That means every file
indicated in this makefile are not really exist. I just what to test
how make work.
But when I run make in my bash shell's command line, make output an
odd result(I found it odd at least). The make program output:
generate pro.c
use %.l rule and generate makefile.l
use .l rule and generate makefile
generate ok.h
use %.l rule and generate pro.l
use .l rule and generate pro
I haven't specified anything that relate to the file makefile, by why
does make have to generate makefile.l and makefile? Is that an bug or
else?
Thank you very much.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.