]> git.sesse.net Git - vlc/blob - Makefile.dep
dbe2c3184e1128ead55cbc516d0e3e3d0244efed
[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 # See notes at the end of the main makefile for explanations.
8 ################################################################################
9
10 # All settings and options are passed through main Makefile
11
12 ################################################################################
13 # Default target
14 ################################################################################
15
16 default:
17         @echo "This Makefile should not be called directly - see notes at end of"
18         @echo "main Makefile."
19
20 ################################################################################
21 # Dependancies creation
22 ################################################################################
23
24 # A dependancies file needs to be rebuilt if the .c  changed or if one of the 
25 # dependancies files have been changed. In other words, it depends from the
26 # .c and from itself.
27
28 -include $(MAKECMDGOALS)
29 $(dependancies): .dep/%.d: %.c
30         @test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*)
31         #@echo "generating dependancies for $*.c"
32         @$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) $< \
33                 | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
34                 .dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
35                 [ -s $@ ] || rm -f $@'