This is the mail archive of the
mailing list for the GCC project.
Re: struggling with make inside GCC MELT
- From: Ian Lance Taylor <iant at google dot com>
- To: Basile Starynkevitch <basile at starynkevitch dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 10 Jan 2012 07:12:50 -0800
- Subject: Re: struggling with make inside GCC MELT
- References: <20120110100933.GA1250@ours.starynkevitch.net>
Basile Starynkevitch <email@example.com> writes:
> I am fighting against makefile issues on the GCC MELT branch.
> Much more details are given in
> and in
> 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
commands to create FILE.tmp
move-if-change FILE.tmp FILE
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.
The effect is that anything which depends on FILE is only rebuilt if the
contents of FILE changes.
Note that everything I show above is required. A naive approach would
omit the "; @true" but it is necessary.