# HG changeset patch # User diego # Date 1208558957 0 # Node ID 7f569622418215d869ff420efd282ff4c819550e # Parent 4213401c16a9cc67607b8715ef5f6ddf10e9eb13 per-file dependencies (for the non-recursive parts) diff -r 4213401c16a9 -r 7f5696224182 Makefile --- a/Makefile Fri Apr 18 21:47:51 2008 +0000 +++ b/Makefile Fri Apr 18 22:49:17 2008 +0000 @@ -234,9 +234,10 @@ all: $(ALL_PRG) -.depend: help_mp.h version.h codecs.conf.h -dep depend: - for part in $(PARTS); do $(MAKE) -C $$part depend; done +DEPS = $(SRCS_COMMON:.c=.d) $(SRCS_MPLAYER:.c=.d) $(SRCS_MENCODER:.c=.d) +$(DEPS): help_mp.h version.h codecs.conf.h +dep depend: $(DEPS) + for part in $(PARTS); do $(MAKE) -C $$part .depend; done include mpcommon.mak @@ -395,6 +396,7 @@ for part in $(PARTS); do $(MAKE) -C $$part distclean; done $(MAKE) -C TOOLS distclean -rm -f configure.log config.mak config.h + rm -f $(foreach dir,$(DIRS),$(foreach suffix,/*.d, $(addsuffix $(suffix),$(dir)))) strip: strip -s $(ALL_PRG) diff -r 4213401c16a9 -r 7f5696224182 mpcommon.mak --- a/mpcommon.mak Fri Apr 18 21:47:51 2008 +0000 +++ b/mpcommon.mak Fri Apr 18 22:49:17 2008 +0000 @@ -25,17 +25,24 @@ rm -f *.o *.a *.ho *~ distclean:: clean - rm -f .depend test test2 + rm -f *.d .depend test test2 .depend: $(SRCS_COMMON) $(SRCS_MPLAYER) $(SRCS_MENCODER) $(MPDEPEND_CMD) > $@ +%.d: %.c + $(MPDEPEND_CMD) > $@ + %.ho: %.h $(CC) $(CFLAGS) -Wno-unused -c -o $@ -x c $< ALLHEADERS = $(wildcard *.h) checkheaders: $(ALLHEADERS:.h=.ho) --include .depend +# Hack to keep .depend from being generated at the top level unnecessarily. +ifndef DEPS +DEPS = .depend +endif +-include $(DEPS) .PHONY: libs *clean dep depend