Am Don, 2002-02-14 um 12.51 schrieb BERTRAND Joël: > Alexandre Duret-Lutz wrote: > >>>>"bj" == BERTRAND Joël <[EMAIL PROTECTED]> writes: > >>>> > > > > [...] > > > > bj> It works fine. But, when I run "make", a file named rpl.c must > > bj> be recompiled. How can I do that ? > > > > What do you mean? > > > > If rpl.c must be compiled as rpl.o, just list rpl.c in the > > relevant *_SOURCES variable of your Makefile.am. > > rpl.o is built from rpl.c and rpl.h. But I would recompile this file > when "make" is done (even if rpl.o is up to date, because the gcc > command line contains "-Ddate=..." which changes.). When does date change? If your configuration is properly implemented, it should only change at configuration time and not at build-/make-time.
In this case, putting your "date" into a config-header and let rpl.c include this. Then, make-dependencies would automatically assure consistency. > > If rpl.c must be generated from some other files, list it in a > > *_SOURCES variable too (or maybe a nodist_*_SOURCES variable) > > and add a custom rule to build it. If "date" changes at other occasions but configuration-time, you could put "date" into a file. let 'rpl.c' include this files and add appropriate make-dependencies to your Makefile depend on that. However, this is one magnitude more difficult and error-prone than using a config-header (E.g. depending on the design of your sources, you might end with cyclic dependencies) Ralf