Hans-Christoph Steiner wrote:
Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27181
Modified Files: Tag: branch-v0-40-extended makefile.mingw Log Message: corrected depend target to check makefile.dependencies to see if it needs updating
Index: makefile.mingw
RCS file: /cvsroot/pure-data/pd/src/Attic/makefile.mingw,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** makefile.mingw 6 Nov 2007 19:31:53 -0000 1.3.4.1 --- makefile.mingw 4 Dec 2007 01:34:32 -0000 1.3.4.2
*** 270,274 **** tags: $(SRC) $(GSRC); ctags *.[ch]
! depend: $(CC) $(INCLUDE) $(CFLAGS) -M $(SRC) > makefile.dependencies
--- 270,276 ---- tags: $(SRC) $(GSRC); ctags *.[ch]
! depend: makefile.dependencies ! ! makefile.dependencies: $(CC) $(INCLUDE) $(CFLAGS) -M $(SRC) > makefile.dependencies
I'm not positive, but I don't think that this is going to do exactly what you're looking for.
All that the makefile.dependencies target is going to do now is automatically generate it if it doesn't exist. However, you want it generated any time that the dependencies may have changed, which is when any of the source changes.
On a related note, since this file is automatically generated, and is system specific, why is checked in to CVS?
Another question, why does the clean target create an empty makefile.dependencies file after deleting any existing one? That doesn't seem right to me ...
Anyway, back to the original point of the message, I would suggest the following change:
Index: makefile.mingw =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/makefile.mingw,v retrieving revision 1.3.4.3 diff -u -r1.3.4.3 makefile.mingw --- makefile.mingw 4 Dec 2007 02:16:11 -0000 1.3.4.3 +++ makefile.mingw 4 Dec 2007 05:22:37 -0000 @@ -272,7 +272,7 @@
depend: makefile.dependencies
-makefile.dependencies: +makefile.dependencies: $(wildcard *.c) $(wildcard *.h) $(CC) $(INCLUDE) $(CFLAGS) -M $(SRC) > makefile.dependencies
uninstall:
-- Russell Bryant
Russell Bryant wrote:
I'm not positive, but I don't think that this is going to do exactly what you're looking for.
All that the makefile.dependencies target is going to do now is automatically generate it if it doesn't exist. However, you want it generated any time that the dependencies may have changed, which is when any of the source changes.
On a related note, since this file is automatically generated, and is system specific, why is checked in to CVS?
Another question, why does the clean target create an empty makefile.dependencies file after deleting any existing one? That doesn't seem right to me ...
i guess the answer to all of your questions is: makefile.dependencies has to my knowledge not been used for years! it just get's created (or not), but it is never included into build-process, so it would be better to just remove it.
Anyway, back to the original point of the message, I would suggest the following change:
btw, the gnu make manual suggest to use one dependency makefile per sourcefile, instead of one general makefile.depend.
something like:
<snip>
-include $(SOURCES:.c=.d) endif
%.d: %.c @set -e; rm -f $@; \ $(CC) $(MAKEDEP_FLAGS) $(CFLAGS) $< > $@.$$$$; \ sed 's,($*).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$
</snip>
(this example is copied from the Gem sources, so it might not work out of the box for pd, but you should get the idea)
more information can be found here: http://www.gnu.org/software/make/manual/make.html#Automatic-Prerequisites
mfgas.d IOhannes
On Dec 4, 2007, at 3:22 AM, IOhannes m zmoelnig wrote:
Russell Bryant wrote:
I'm not positive, but I don't think that this is going to do exactly what you're looking for.
All that the makefile.dependencies target is going to do now is automatically generate it if it doesn't exist. However, you want it generated any time that the dependencies may have changed, which is when any of the source changes.
On a related note, since this file is automatically generated, and is system specific, why is checked in to CVS?
Another question, why does the clean target create an empty makefile.dependencies file after deleting any existing one? That doesn't seem right to me ...
i guess the answer to all of your questions is: makefile.dependencies has to my knowledge not been used for years! it just get's created (or not), but it is never included into build-process, so it would be better to just remove it.
It's included at the bottom of makefile.in and makefile.mingw like this:
include makefile.dependencies
I don't about order of includes in makefiles, but it is being included.
.hc
Anyway, back to the original point of the message, I would suggest the following change:
btw, the gnu make manual suggest to use one dependency makefile per sourcefile, instead of one general makefile.depend.
something like:
<snip>
-include $(SOURCES:.c=.d) endif
%.d: %.c @set -e; rm -f $@; \ $(CC) $(MAKEDEP_FLAGS) $(CFLAGS) $< > $@.$$$$; \ sed 's,($*).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$
</snip>
(this example is copied from the Gem sources, so it might not work out of the box for pd, but you should get the idea)
more information can be found here: http://www.gnu.org/software/make/manual/make.html#Automatic- Prerequisites
mfgas.d IOhannes
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
------------------------------------------------------------------------ ----