]> git.sesse.net Git - vlc/blob - Makefile.dep
* Added .cvsignore files in the plugins directories.
[vlc] / Makefile.dep
1 ################################################################################
2 # vlc (VideoLAN Client) dependancies makefile
3 # (c)1998 VideoLAN
4 ################################################################################
5 # This Makefile is dedicated to build of .d files. It should not be called
6 # directly by user, but only through main Makefile.
7 ################################################################################
8
9 ###############################################################################
10 # Note on generic rules and dependancies
11 ###############################################################################
12
13 # Note on dependancies: each .c file is associated with a .d file, which
14 # depends of it. The .o file associated with a .c file depends of the .d, of the
15 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
16 # directory.
17 # The dep directory should be ignored by CVS.
18
19 # Note on inclusions: depending of the target, the dependancies files must
20 # or must not be included. The problem is that if we ask make to include a file,
21 # and this file does not exist, it is made before it can be included. In a
22 # general way, a .d file should be included if and only if the corresponding .o
23 # needs to be re-made.
24
25 # The object Makefile knows how to make a .o from a .c, and includes
26 # dependancies for the target, but only those required.
27
28 # All settings and options are passed through main Makefile
29
30 ################################################################################
31 # Default target
32 ################################################################################
33
34 default:
35         @echo "This Makefile should not be called directly,"
36         @echo "see notes at end of main Makefile."
37
38 ################################################################################
39 # Dependancies creation
40 ################################################################################
41
42 # A dependancies file needs to be rebuilt if the .c  changed or if one of the 
43 # dependancies files have been changed. In other words, it depends from the
44 # .c and from itself.
45
46 -include $(MAKECMDGOALS)
47
48 $(C_DEP): .dep/%.d: %.c
49         @test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*)
50         #@echo "generating dependancies for $*.c"
51         @$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) 2>/dev/null $< \
52         | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
53         .dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
54         [ -s $@ ] || rm -f $@'
55
56 $(CPP_DEP): .dep/%.dpp: %.cpp
57         @test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*)
58         #@echo "generating dependancies for $*.c"
59         @$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) 2>/dev/null $< \
60         | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
61         .dep\/$(subst /,\/,$*).dpp : /g'\'' > $@; \
62         [ -s $@ ] || rm -f $@'
63