Skip to contentSkip to conversation

fix for "make doesn't know how to make target in examples/"

PATCH New Wen-chien Jesse Sung 3 participants 7 messages Jul 10, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix for "make doesn't know how to make target in examples/"

Hi,

Make complains that it doesn't know how to make hello_world.srec.

make[1]: *** No rule to make target hello_world.srec', needed by all'.
Stop.

Introduce $(TARGET) let make to build % before %.srec and %.bin.

CHANGELOG

* Introduce $(TARGET) in Makefile of examples/.

Signature · 9 lines
Best Regards,
Wen-chien Jesse Sung
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-fix-for-make-doesn-t-know-how-to-make-target-in-examples.txt.gz
Type: application/x-gzip
Size: 1010 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20060710/6ae2460a/attachment.bin 
#1 lore raw

PATCH 1/1 fix for "make doesn't know how to make target in examples/"

Quoted 2 lines · In message <[email protected]> you wrote:

Make complains that it doesn't know how to make hello_world.srec.

Is it correct to assume that you are using a (broken) BETA version of the GNU make tool?

I reject your patch. AFAIK, any sane version of make handles the current Makefile correctly.

Please get working tools.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Man did not weave the web of life; he  is  merely  a  strand  in  it.
Whatever he does to the web, he does to himself.     - Seattle [1854]
#2 lore raw

PATCH 1/1 fix for "make doesn't know how to make target in examples/"

Quoted 9 lines · Wolfgang Denk
Quoted 1 line

Make complains that it doesn't know how to make hello_world.srec.

Is it correct to assume that you are using a (broken) BETA version of the GNU make tool?

I reject your patch. AFAIK, any sane version of make handles the current Makefile correctly.

Please get working tools.

Hi,

I'm using make 3.81-2 that is in Debian etch and sid currently.

$ make --version
GNU Make 3.81
$ dpkg -l make
ii  make           3.81-2         The GNU version of the "make" utility.

A test with the attached Makefile:

$ touch 1.src
$ make
make: *** No rule to make target `1.out', needed by `all'.  Stop.

I would file a bug against make on Debian BTS if that is believed to be one.

Signature · 6 lines
Best Regards,
Wen-chien Jesse Sung
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile
Url: http://lists.denx.de/pipermail/u-boot/attachments/20060710/f8f37bd5/attachment.txt 
#3 lore raw

PATCH 1/1 fix for "make doesn't know how to make target in examples/"

Dear all!

Quoted 7 lines · Wen-chien Jesse Sung

------------------------------------------------------------------------

%.out: %

	cp $< $@
	echo $@

%: %.src

Quoted 8 lines
	cp $< $@
	echo $@

all: 1.out

	echo $@

------------------------------------------------------------------------

I have tested the Makefile on a Suse 9.3 Professional system with GNU make 3.80 (RPM package version make-3.80-187) and it fails there, too.

But if I add the line

1.out: 1

everything is working.

With best regards
Andreas Schweigstill

Signature · 5 lines
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstra?e 116, D-24118 Kiel, Germany
Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/
#4 lore raw

PATCH 1/1 fix for "make doesn't know how to make target in examples/"

In reply to Wen-chien Jesse Sung

Hello,

Quoted 2 lines · in message <[email protected]> you wrote:

I'm using make 3.81-2 that is in Debian etch and sid currently.

This is supposed to be ok.

Quoted 4 lines

A test with the attached Makefile:

$ touch 1.src
$ make
make: *** No rule to make target `1.out', needed by `all'.  Stop.

This Makefile is not equivlent to what we use in the U-Boot code.

Quoted 1 line

all: 1.out

The "examples/Makefile" is different; it corresponds to:

	all:	1.out 1

...and this works fine for me with make 3.81

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The first 90% of a project takes 90% of the time, the last 10%  takes
the other 90% of the time.
#5 lore raw

PATCH 1/1 fix for "make doesn't know how to make target in examples/"

Quoted 7 lines · Wolfgang Denk
Quoted 4 lines

A test with the attached Makefile:

$ touch 1.src
$ make
make: *** No rule to make target `1.out', needed by `all'.  Stop.

This Makefile is not equivlent to what we use in the U-Boot code.

Quoted 7 lines
Quoted 1 line

all: 1.out

The "examples/Makefile" is different; it corresponds to:

	all:	1.out 1

...and this works fine for me with make 3.81

Hi,

I modify the testing Makefile (attached).

$ make
make: *** No rule to make target `1.out', needed by `all'.  Stop.

And then I replace "all: 1.out 1" with "all: 1 1.out", it works.

The sequence of the prerequisites affect the result for me, and that's what the patch does: place $(TARGET) before $(SREC) and $(BIN). Besides, it removes the duplicated entries,
SREC = foo.srec
BIN = foo.bin foo
now becomes
SREC = foo.srec
only.

I'm just curious about the difference of make's behavior. :)

Signature · 6 lines
Best Regards,
Wen-chien Jesse Sung
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile
Url: http://lists.denx.de/pipermail/u-boot/attachments/20060710/053781a2/attachment.txt 
#6 lore raw

PATCH 1/1 fix for "make doesn't know how to make target in examples/"

Quoted 5 lines · In message <[email protected]> you wrote:
$ make
make: *** No rule to make target `1.out', needed by `all'.  Stop.

And then I replace "all: 1.out 1" with "all: 1 1.out", it works.

Aha! This is exactly what I wanted to know. This is the specific failure mode tha has been reported couple times before. See for example
http://sourceforge.net/mailarchive/message.php?msg_id=15318222

Quoted 1 line

The sequence of the prerequisites affect the result for me, and that's

Yes, this is the observation all users of GNU make version 3.81 made, and which I consider a bug in make. Nothing in the 3.80 documentation gives any hint that the order of the file names in the prerequisite list (to be precise, we're talking about normal' prerequisites here, not about order-only" prerequisites) might be important for the result of the depemdency checking. Actually I am convinced that there must be no such dependency on the order, as this can lead to circular dependencies that would be impossible to solve.

So as a summary: your version of make is broken.

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In a survey taken several years ago, all  incoming  freshmen  at  MIT
were  asked  if  they  expected  to graduate in the top half of their
class. Ninety-seven percent responded that they did.