[FFmpeg-cvslog] r12775 - in trunk: Makefile common.mak configure

mru subversion
Wed Apr 9 22:48:18 CEST 2008


Author: mru
Date: Wed Apr  9 22:48:17 2008
New Revision: 12775

Log:
generate separate dependency files per object file


Modified:
   trunk/Makefile
   trunk/common.mak
   trunk/configure

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Wed Apr  9 22:48:17 2008
@@ -14,7 +14,7 @@ PROGS-$(CONFIG_FFSERVER) += ffserver
 
 PROGS       = $(addsuffix   $(EXESUF), $(PROGS-yes))
 PROGS_G     = $(addsuffix _g$(EXESUF), $(PROGS-yes))
-PROGS_SRCS  = $(addsuffix .c,          $(PROGS-yes)) cmdutils.c
+OBJS        = $(addsuffix .o,          $(PROGS-yes)) cmdutils.o
 MANPAGES    = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
 
 BASENAMES   = ffmpeg ffplay ffserver
@@ -52,8 +52,6 @@ $(PROGS): %$(EXESUF): %_g$(EXESUF)
 	cp -p $< $@
 	$(STRIP) $@
 
-.depend: version.h $(PROGS_SRCS)
-
 SUBDIR_VARS := OBJS ASM_OBJS CPP_OBJS FFLIBS CLEANFILES
 
 define RESET
@@ -89,9 +87,7 @@ output_example$(EXESUF): output_example.
 tools/%$(EXESUF): tools/%.c
 	$(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
 
-ffplay.o .depend: CFLAGS += $(SDL_CFLAGS)
-
-ffmpeg.o ffplay.o ffserver.o: version.h
+ffplay.o: CFLAGS += $(SDL_CFLAGS)
 
 VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS))
 
@@ -113,7 +109,7 @@ LIBS_drawtext$(SLIBSUF)        = `freety
 
 VHOOKCFLAGS += $(VHOOKCFLAGS-yes)
 
-vhook/%.o: CFLAGS:=$(VHOOKCFLAGS)
+vhook/%.o vhook/%.d: CFLAGS:=$(VHOOKCFLAGS)
 
 # vhooks compile fine without libav*, but need them nonetheless.
 videohook: $(DEP_LIBS) $(HOOKS)
@@ -121,10 +117,8 @@ videohook: $(DEP_LIBS) $(HOOKS)
 vhook/%$(SLIBSUF): vhook/%.o
 	$(CC) $(LDFLAGS) -o $@ $(VHOOKSHFLAGS) $< $(VHOOKLIBS) $(LIBS_$(@F))
 
-.vhookdep: $(ALLHOOKS_SRCS) version.h
-	$(VHOOK_DEPEND_CMD) > $@
-
-depend dep: .vhookdep
+VHOOK_DEPS = $(HOOKS:$(SLIBSUF)=.d)
+depend dep: $(VHOOK_DEPS)
 
 documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
                                  ffplay-doc.html general.html hooks.html \
@@ -176,7 +170,7 @@ clean::
 	rm -f vhook/*.o vhook/*~ vhook/*.so vhook/*.dylib vhook/*.dll
 
 distclean::
-	rm -f .vhookdep version.h config.* *.pc
+	rm -f version.h config.* *.pc vhook/*.d
 
 # regression tests
 
@@ -352,4 +346,4 @@ tests/seek_test$(EXESUF): tests/seek_tes
 .PHONY: codectest libavtest seektest test-server fulltest test
 .PHONY: $(CODEC_TESTS) $(LAVF_TESTS) regtest-ref swscale-error
 
--include .vhookdep
+-include $(VHOOK_DEPS)

Modified: trunk/common.mak
==============================================================================
--- trunk/common.mak	(original)
+++ trunk/common.mak	Wed Apr  9 22:48:17 2008
@@ -24,6 +24,15 @@ CFLAGS = -DHAVE_AV_CONFIG_H -D_FILE_OFFS
 %.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)

Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Wed Apr  9 22:48:17 2008
@@ -940,8 +940,7 @@ SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMA
 LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 
 # gcc stupidly only outputs the basename of targets with -MM
-DEPEND_CMD='$(CC) -MM $(CFLAGS) $(filter-out %.h,$$^) | sed "s,[0-9a-z._-]*: \($(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,;s,^.*:,\$$$$(SUBDIR)&,"'
-VHOOK_DEPEND_CMD='$(CC) -MM $(VHOOKCFLAGS) $(filter-out %.h,$^) | sed "s,^\([a-z]\),vhook/\\1,"'
+DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed "1s,^,$(@D)/,"'
 
 # find source path
 source_path="`dirname \"$0\"`"
@@ -1983,7 +1982,6 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak
 echo "SLIBSUF=$SLIBSUF" >> config.mak
 echo "EXESUF=$EXESUF" >> config.mak
 echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
-echo "VHOOK_DEPEND_CMD=$VHOOK_DEPEND_CMD" >> config.mak
 
 if enabled bigendian; then
     echo "WORDS_BIGENDIAN=yes" >> config.mak




More information about the ffmpeg-cvslog mailing list