Thomas Hertweck wrote:
I think make and this Makefile do not work in the way you expect them to work.
Thanks for the explanation, but according to the make manual, make _will_ reparse the Makefile(s) if one of them is changed on the first pass: (see the text in ////).
From "3.7 How Makefiles Are Remade"
Sometimes makefiles can be remade from other files, such as RCS or SCCS files. If a makefile can be remade from other files, you probably want make to get an up-to-date version of the makefile to read in. To this end, after reading in all makefiles, make will consider each as a goal target and attempt to update it. If a makefile has a rule which says how to update it (found either in that very makefile or in another one) or if an implicit rule applies to it (see section Using Implicit Rules), it will be updated if necessary. After all makefiles have been checked, //if any have actually been changed, make starts with a clean slate and reads all the makefiles over again.// (It will also attempt to update each of them over again, but normally this will not change them again, since they are already up to date.) Your example/explanation was good, but why does make not reparse as it should? If you cannot rely on make doing that, how can you have makefiles that generate their own dependencies for a compile for instance? Here's an example of make re-executing due to an included file changing: per@io:~/workspace/bulwark/klop99> make -r -d GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i686-pc-linux-gnu Reading makefiles... Reading makefile `Makefile'... Reading makefile `depend' (search path) (no ~ expansion)... Makefile:15: depend: No such file or directory Updating makefiles.... Considering target file `depend'. File `depend' does not exist. Finished prerequisites of target file `depend'. Must remake target `depend'. gcc -M -c *.c >depend Putting child 0x0807ab88 (depend) PID 6235 on the chain. Live child 0x0807ab88 (depend) PID 6235 Reaping winning child 0x0807ab88 PID 6235 Removing child 0x0807ab88 PID 6235 from chain. Successfully remade target file `depend'. Considering target file `Makefile'. Looking for an implicit rule for `Makefile'. No implicit rule found for `Makefile'. Finished prerequisites of target file `Makefile'. No need to remake target `Makefile'. Re-executing[1]: make -r -d GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. /Per Jessen, Zürich --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org