bug-automake
[Top][All Lists]
Advanced

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

A problem with "intermediate files"


From: Stepan Kasal
Subject: A problem with "intermediate files"
Date: Thu, 31 Mar 2005 14:53:58 +0200
User-agent: Mutt/1.4.1i

Hello,
  I noticed a subtle problem.  It takes me some time to explain it,
please forgive me that I'm not able to do better.

In the gnumeric project, the source file gnm-marshalers.c is generated
from gnm-marshalers.list.  I did this in the Makefile.am:

SUFFIXES = .list
gnumeric_SOURCES = ... gnm-genmarshals.list ...
.list.c:
        ....

So make is supposed to generate gnm-genmarshals.lo by chaining the rules
.list.c:
.c.lo:

I noticed two problems:

1) With GNU make, the "intermediate file", gnm-marshalers.c is deleted
after gnm-genmarshals.lo is created.  But when you run make for the
second time, probably as "make install", gnm-marshalers.c is mentioned
in .deps/gnm-marshalers.Plo, so it is generated again, and all targets
depending on it are refreshed.
(See http://bugzilla.gnome.org/show_bug.cgi?id=172211 , for a more
detailed explanation.)

2) Some historic make implementations are not able to chain implicit
rules, so the build fails.
(See http://bugzilla.gnome.org/show_bug.cgi?id=172212 .)

An elegant solution for problem 1) is to add a dummy rule:

non-intermediate: gnm-genmarshals.c

(As soon as a file is mentioned as a prerequisite of a rule, it cannot
be treated as an "intermediate file".)

According to my experiences with the "historic implementations of make",
this rule also fixes problem 2).  (I have only one such historic make
at hand, on an "OSF1 V4.0 alpha" system.)


But I think Automake could handle this automatically.

When Automake generates the variable am_gnumeric_OBJECTS, it understands
that the suffix .list can be converted to an object file via the .c file.
Thus Automake "knows" that the two implicit rules will be chained.

So I think Automake could write something like this:

am-non-intermediate: gnm-genmarshals.c

or perhaps:

am_non_intermediate_targets = gnm-genmarshals.c
am-non-intermediate: $(am_non_intermediate_targets)

Alexandre, wdyt?  Does this proposal make sense?

Thanks,
        Stepan Kasal




reply via email to

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