1999-08-08 14:42:54 +02:00
|
|
|
################################################################################
|
|
|
|
# vlc (VideoLAN Client) dependancies makefile
|
|
|
|
# (c)1998 VideoLAN
|
|
|
|
################################################################################
|
|
|
|
# This Makefile is dedicated to build of .d files. It should not be called
|
|
|
|
# directly by user, but only through main Makefile.
|
|
|
|
################################################################################
|
|
|
|
|
2001-04-15 06:19:58 +02:00
|
|
|
###############################################################################
|
|
|
|
# Note on generic rules and dependancies
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# Note on dependancies: 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
|
|
|
|
# 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.
|
|
|
|
|
1999-08-08 14:42:54 +02:00
|
|
|
# All settings and options are passed through main Makefile
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Default target
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
default:
|
2000-07-04 04:37:21 +02:00
|
|
|
@echo "This Makefile should not be called directly,"
|
|
|
|
@echo "see notes at end of main Makefile."
|
1999-08-08 14:42:54 +02:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Dependancies 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
|
|
|
|
# .c and from itself.
|
|
|
|
|
|
|
|
-include $(MAKECMDGOALS)
|
2001-02-18 04:32:02 +01:00
|
|
|
|
2001-04-16 09:40:11 +02:00
|
|
|
$(C_DEP): .dep/%.d: %.c
|
2000-03-04 12:52:48 +01:00
|
|
|
@test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*)
|
2000-06-06 01:58:59 +02:00
|
|
|
#@echo "generating dependancies for $*.c"
|
2001-02-14 15:31:07 +01:00
|
|
|
@$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) 2>/dev/null $< \
|
2000-07-04 04:37:21 +02:00
|
|
|
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
|
|
|
|
.dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
|
|
|
|
[ -s $@ ] || rm -f $@'
|
|
|
|
|
2001-04-16 09:40:11 +02:00
|
|
|
$(CPP_DEP): .dep/%.dpp: %.cpp
|
2001-02-18 04:32:02 +01:00
|
|
|
@test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*)
|
|
|
|
#@echo "generating dependancies for $*.c"
|
|
|
|
@$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) 2>/dev/null $< \
|
|
|
|
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
|
|
|
|
.dep\/$(subst /,\/,$*).dpp : /g'\'' > $@; \
|
|
|
|
[ -s $@ ] || rm -f $@'
|
|
|
|
|