help-make
[Top][All Lists]
Advanced

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

why does touching Makefile allow make to know how to build dependency?


From: Graham Menhennitt
Subject: why does touching Makefile allow make to know how to build dependency?
Date: Fri, 4 Mar 2011 13:48:23 +1100

Greetings all,

 

I have a very strange problem with Gnu make. I'm not a make newbie by
any stretch of the imagination, but it has me completely stumped. I
apologise for the vagueness below but, for various reasons, I can't
really be more specific. I hope that the following is sufficient for
somebody to give me a clue.

 

I'm using make version 3.81 under Centos 5.5. We have a very convoluted
build system that I am no expert on (and definitely don't want to be!).
All of the following is reduced to the bare minimum to describe the
problem.

 

In a Makefile in a subdirectory of our top level directory, I have some
rules:

 

outfile: infile

cmd < infile > outfile

 

anotherFile: outfile

 

When I run make in the top level directory, it descends into this
directory and runs cmd to build outfile correctly. If I then manually
remove outfile and run the top-level make again, it says:

 

                make: *** No rule to make target `outfile', needed by
`anotherFile'.  Stop.

 

To fix it, I simply touch the subdirectory's Makefile and it will then
correctly build outfile again.

 

If anybody has any clues on this, it would be much appreciated.

 

Regards,

                Graham



reply via email to

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