help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

An odd problem occur when I am studying gnu make


From: liyehua1986
Subject: An odd problem occur when I am studying gnu make
Date: 10 Mar 2007 19:39:37 -0800
User-agent: G2/1.0

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]