aboutsummaryrefslogtreecommitdiff
path: root/common.mak
diff options
context:
space:
mode:
authorMåns Rullgård2008-04-09 20:48:17 +0000
committerMåns Rullgård2008-04-09 20:48:17 +0000
commitcaec74dd659df1d5a4e34b8b44d8fc81d8ba2285 (patch)
treed31b5d8dcc4b4c39761d4856aab0945ee1cbd0e0 /common.mak
parent95c76e11805abf8e14ffbec64b9c23d32ea563ef (diff)
generate separate dependency files per object file
Originally committed as revision 12775 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'common.mak')
-rw-r--r--common.mak19
1 files changed, 13 insertions, 6 deletions
diff --git a/common.mak b/common.mak
index 62dddcd5cf..117fc170b5 100644
--- a/common.mak
+++ b/common.mak
@@ -24,6 +24,15 @@ CFLAGS = -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
%.ho: %.h
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
+%.d: %.c
+ $(DEPEND_CMD) > $@
+
+%.d: %.S
+ $(DEPEND_CMD) > $@
+
+%.d: %.cpp
+ $(DEPEND_CMD) > $@
+
install: install-libs install-headers
uninstall: uninstall-libs uninstall-headers
@@ -51,7 +60,8 @@ TESTS := $(addprefix $(SUBDIR),$(TESTS))
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h))
checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
-depend dep: $(SUBDIR).depend
+DEPS := $(OBJS:.o=.d)
+depend dep: $(DEPS)
CLEANFILES += *.o *~ *.a *.lib *.so *.so.* *.dylib *.dll \
*.def *.dll.a *.exp *.ho *.map
@@ -63,18 +73,15 @@ $(SUBDIR)%: $(SUBDIR)%.o $(LIBNAME)
$(SUBDIR)%-test$(EXESUF): $(SUBDIR)%.c $(LIBNAME)
$(CC) $(CFLAGS) $(FFLDFLAGS) -DTEST -o $$@ $$^ $(FFEXTRALIBS)
-$(SUBDIR).depend: $(SRCS)
- $(DEPEND_CMD) > $$@
-
clean::
rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES))
distclean:: clean
- rm -f $(SUBDIR).depend
+ rm -f $(DEPS)
endef
$(eval $(RULES))
tests: $(TESTS)
--include $(SUBDIR).depend
+-include $(DEPS)