################################################################################
# vls (VideoLAN Server) dependencies Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile.dep,v 1.3 2002/12/08 14:50:43 massiot Exp $
################################################################################
################################################################################
# Note on generic rules and dependencies
################################################################################
#
# Note on dependencies: each .cpp file is associated with a .d file, which
# depends of it. The .o file associated with a .cpp file depends of the .d, of
# the .cpp 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 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 .cpp, and includes
# dependencies for the target, but only those required.
#
# All settings and options are passed through main Makefile
################################################################################
# Default target
################################################################################
default:
@echo "This Makefile should not be called directly,"
################################################################################
# Dependencies creation
################################################################################
# A dependencies file needs to be rebuilt if the .cpp changed or if one of the
# dependencies files have been changed. In other words, it depends from the
# .cpp and from itself.
-include $(MAKECMDGOALS)
$(DEP): dep/%.dpp: src/%.cpp
@test -d dep/$(dir $*) || mkdir -p dep/$(dir $*)
@echo "Generating dependancies for $<..."
@$(SHELL) -ec '$(CXX) $(DCFLAGS) $(INCLUDE) $< \
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/src\/$(subst /,\/,$*).o : \
dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
$(C_DEP): dep/%.d: src/%.c
@test -d dep/$(dir $*) || mkdir -p dep/$(dir $*)
@echo "Generating dependancies for $<..."
@$(SHELL) -ec '$(CC) $(DCFLAGS) $(INCLUDE) $< \
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/src\/$(subst /,\/,$*).o \
dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
syntax highlighted by Code2HTML, v. 0.9.1