List Info

Thread: An odd problem occur when I am studying gnu make




An odd problem occur when I am studying gnu make
country flaguser name
China
2007-03-10 21:39:37
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.

_______________________________________________
help-gnu-utils mailing list
help-gnu-utilsgnu.org

http://lists.gnu.org/mailman/listinfo/help-gnu-utils

Re: An odd problem occur when I am studying gnu make
country flaguser name
Germany
2007-03-11 05:34:40
Hello liyehua1986(?),

* liyehua1986gmail.com wrote on Sun, Mar 11, 2007 at
04:39:37AM CET:
> 
> 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

FWIW, I get
| generate ok.h
| use %.l rule and generate pro.l
| generate pro.c
| use .l rule and generate pro

with
| GNU Make 3.81beta4
| Copyright (C) 2003  Free Software Foundation, Inc.

> 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?

Not sure.  What does `make --version' give you?

Cheers,
Ralf


_______________________________________________
help-gnu-utils mailing list
help-gnu-utilsgnu.org

http://lists.gnu.org/mailman/listinfo/help-gnu-utils

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )