X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=Makefile.dep;h=de071516deec0ca057c454b62d16f641c15b1689;hb=2bdd09121a86f782c79c0e01f8425c6657e028cc;hp=a85b526f650eeec3993504b7fd39e9abc74d05d6;hpb=6b3c854071c43c099f55c5c61731e59999239854;p=vlc diff --git a/Makefile.dep b/Makefile.dep index a85b526f65..de071516de 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -1,5 +1,5 @@ ################################################################################ -# vlc (VideoLAN Client) dependancies makefile +# vlc (VideoLAN Client) dependencies makefile # (c)1998 VideoLAN ################################################################################ # This Makefile is dedicated to build of .d files. It should not be called @@ -7,23 +7,23 @@ ################################################################################ ############################################################################### -# Note on generic rules and dependancies +# Note on generic rules and dependencies ############################################################################### -# Note on dependancies: each .c file is associated with a .d file, which +# Note on dependencies: each .c file is associated with a .d file, which # depends of it. The .o file associated with a .c file depends of the .d, of the # .c itself, and of Makefile. The .d files are stored in a separate .dep/ # directory. # The dep directory should be ignored by CVS. -# Note on inclusions: depending of the target, the dependancies files must +# Note on inclusions: depending of the target, the dependencies files must # or must not be included. The problem is that if we ask make to include a file, # and this file does not exist, it is made before it can be included. In a # general way, a .d file should be included if and only if the corresponding .o # needs to be re-made. # The object Makefile knows how to make a .o from a .c, and includes -# dependancies for the target, but only those required. +# dependencies for the target, but only those required. # All settings and options are passed through main Makefile @@ -36,28 +36,38 @@ default: @echo "see notes at end of main Makefile." ################################################################################ -# Dependancies creation +# Dependencies creation ################################################################################ -# A dependancies file needs to be rebuilt if the .c changed or if one of the -# dependancies files have been changed. In other words, it depends from the +# A dependencies file needs to be rebuilt if the .c changed or if one of the +# dependencies files have been changed. In other words, it depends from the # .c and from itself. -include $(MAKECMDGOALS) -$(cdependancies): .dep/%.d: %.c - @test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*) - #@echo "generating dependancies for $*.c" - @$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) 2>/dev/null $< \ +CFLAGS += -DMAKE_DEP + +$(C_DEP): .dep/%.d: %.c + @test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*) + @echo "make[$(MAKELEVEL)]: Generating dependencies for \`$*.c'" + @$(SHELL) -ec '$(CC) -M $(CFLAGS) 2>/dev/null $< \ | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \ .dep\/$(subst /,\/,$*).d : /g'\'' > $@; \ [ -s $@ ] || rm -f $@' -$(cppdependancies): .dep/%.dpp: %.cpp - @test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*) - #@echo "generating dependancies for $*.c" - @$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) 2>/dev/null $< \ +$(CPP_DEP): .dep/%.dpp: %.cpp + @test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*) + @echo "make[$(MAKELEVEL)]: Generating dependencies for \`$*.cpp'" + @$(SHELL) -ec '$(CC) -M $(CFLAGS) 2>/dev/null $< \ | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \ .dep\/$(subst /,\/,$*).dpp : /g'\'' > $@; \ [ -s $@ ] || rm -f $@' +$(M_DEP): .dep/%.dm: %.m + @test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*) + @echo "make[$(MAKELEVEL)]: Generating dependencies for \`$*.m'" + @$(SHELL) -ec '$(CC) -M $(CFLAGS) 2>/dev/null $< \ + | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \ + .dep\/$(subst /,\/,$*).dm : /g'\'' > $@; \ + [ -s $@ ] || rm -f $@' +