1999-08-08 14:42:54 +02:00
|
|
|
################################################################################
|
2001-06-03 14:47:22 +02:00
|
|
|
# vlc (VideoLAN Client) dependencies makefile
|
1999-08-08 14:42:54 +02:00
|
|
|
# (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
|
|
|
###############################################################################
|
2001-06-03 14:47:22 +02:00
|
|
|
# Note on generic rules and dependencies
|
2001-04-15 06:19:58 +02:00
|
|
|
###############################################################################
|
|
|
|
|
2001-06-03 14:47:22 +02:00
|
|
|
# Note on dependencies: each .c file is associated with a .d file, which
|
2001-04-15 06:19:58 +02:00
|
|
|
# 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.
|
|
|
|
|
2001-06-03 14:47:22 +02:00
|
|
|
# Note on inclusions: depending of the target, the dependencies files must
|
2001-04-15 06:19:58 +02:00
|
|
|
# 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
|
2001-06-03 14:47:22 +02:00
|
|
|
# dependencies for the target, but only those required.
|
2001-04-15 06:19:58 +02:00
|
|
|
|
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
|
|
|
|
|
|
|
################################################################################
|
2001-06-03 14:47:22 +02:00
|
|
|
# Dependencies creation
|
1999-08-08 14:42:54 +02:00
|
|
|
################################################################################
|
|
|
|
|
2001-06-03 14:47:22 +02:00
|
|
|
# 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
|
1999-08-08 14:42:54 +02:00
|
|
|
# .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
|
2001-08-07 04:48:25 +02:00
|
|
|
@test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*)
|
2001-06-03 14:47:22 +02:00
|
|
|
@echo "regenerating dependencies 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-08-07 12:54:51 +02:00
|
|
|
@test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*)
|
2001-06-03 14:47:22 +02:00
|
|
|
@echo "regenerating dependencies for $*.c"
|
2001-02-18 04:32:02 +01:00
|
|
|
@$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) 2>/dev/null $< \
|
|
|
|
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
|
|
|
|
.dep\/$(subst /,\/,$*).dpp : /g'\'' > $@; \
|
|
|
|
[ -s $@ ] || rm -f $@'
|
|
|
|
|