This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: struggling with make inside GCC MELT


Basile Starynkevitch <basile@starynkevitch.net> writes:

> On Tue, Jan 10, 2012 at 07:12:50AM -0800, Ian Lance Taylor wrote:
>> Basile Starynkevitch <basile@starynkevitch.net> writes:
>> 
>> > I am fighting against makefile issues on the GCC MELT branch.
>> >
>> > Much more details are given in 
>> >    http://stackoverflow.com/q/8727896/841108
>> > and in 
>> >    http://lists.gnu.org/archive/html/help-make/2012-01/msg00017.html
>> >
>> > So (unless you ask) I won't repeat them here.
>> >    
>> > (and the bugs affect mostly me, not the usual MELT user)
>> >
>> > The symptoms are:
>> >
>> >    1. make -j don't work
>> >
>> >    2. "make ; make" is running a lot of useless commands for the
>> > second make and it should not 
>> >
>> >
>> > I probably am not understanding when stampfiles in Makefiles should be
>> > used. The main point is that MELT cares much more about file contents
>> > than file timestamps.
>> 
>> Your stackoverflow question has way too much detail for me to
>> understand.  I think you need to debug this like any other issue: reduce
>> to the minimal test case.
>> 
>> Stamp files in make work like this:
>> 
>> FILE: STAMP-FILE; @true
>> STAMP-FILE: DEPENDENCIES
>> 	commands to create FILE.tmp
>> 	move-if-change FILE.tmp FILE
>>         touch $@
>> 
>> What this says is: if any of DEPENDENCIES change, then run the commands
>> to create FILE.tmp.  The move-if-change shell script then compares
>> FILE.tmp and FILE; if they are different, it moves FILE.tmp to FILE,
>> updating the timestamp.  If they are not different, FILE is left
>> unchanged, with the same timestamp.
>
>
> A big thanks for the reply. Then I can ask the next question: when should I use time stamps files? 
> Only for dependencies upon content, or something else?

Only for dependencies on content.  That is, only when you want Make
targets that depend on FILE to be rebuilt if the contents of FILE
changes, and to not be rebuilt if any of DEPENDENCIES change without
changing FILE.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]