[FFmpeg-cvslog] build: Separate building programs linking against libav* from building av*

Diego Biurrun git at videolan.org
Tue Nov 26 01:19:12 CET 2013


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Sat Nov  2 16:44:18 2013 +0100| [14abeaa43d021afdce9119d906891abe89c03b88] | committer: Diego Biurrun

build: Separate building programs linking against libav* from building av*

This will allow cleaner integration of building example programs.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=14abeaa43d021afdce9119d906891abe89c03b88
---

 Makefile     |   38 ++++++++++++++++++++------------------
 doc/Makefile |    7 ++++---
 2 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/Makefile b/Makefile
index 184aa37..3c7987a 100644
--- a/Makefile
+++ b/Makefile
@@ -56,14 +56,20 @@ COMPILE_S = $(call COMPILE,AS)
 
 %.c %.h: TAG = GEN
 
-PROGS-$(CONFIG_AVCONV)   += avconv
-PROGS-$(CONFIG_AVPLAY)   += avplay
-PROGS-$(CONFIG_AVPROBE)  += avprobe
-PROGS-$(CONFIG_AVSERVER) += avserver
+AVPROGS-$(CONFIG_AVCONV)   += avconv
+AVPROGS-$(CONFIG_AVPLAY)   += avplay
+AVPROGS-$(CONFIG_AVPROBE)  += avprobe
+AVPROGS-$(CONFIG_AVSERVER) += avserver
 
-PROGS      := $(PROGS-yes:%=%$(EXESUF))
+AVPROGS    := $(AVPROGS-yes:%=%$(EXESUF))
+PROGS      += $(AVPROGS)
 
-OBJS-avconv = avconv_opt.o avconv_filter.o
+AVBASENAMES = avconv avplay avprobe avserver
+ALLAVPROGS  = $(AVBASENAMES:%=%$(EXESUF))
+
+$(foreach prog,$(ALLAVPROGS),$(eval OBJS-$(prog) += cmdutils.o))
+
+OBJS-avconv                   += avconv_opt.o avconv_filter.o
 OBJS-avconv-$(HAVE_VDPAU_X11) += avconv_vdpau.o
 
 TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
@@ -71,10 +77,6 @@ HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
 TOOLS       = qt-faststart trasher
 TOOLS-$(CONFIG_ZLIB) += cws2fws
 
-BASENAMES   = avconv avplay avprobe avserver
-ALLPROGS    = $(BASENAMES:%=%$(EXESUF))
-ALLMANPAGES = $(BASENAMES:%=%.1)
-
 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
 FFLIBS-$(CONFIG_AVFILTER) += avfilter
 FFLIBS-$(CONFIG_AVFORMAT) += avformat
@@ -93,7 +95,7 @@ include $(SRC_PATH)/common.mak
 FF_EXTRALIBS := $(FFEXTRALIBS)
 FF_DEP_LIBS  := $(DEP_LIBS)
 
-all: $(PROGS)
+all: $(AVPROGS)
 
 $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
 	$(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS)
@@ -129,7 +131,7 @@ endef
 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
 
 define DOPROG
-OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS) $(OBJS-$(1)-yes)
+OBJS-$(1) += $(1).o $(EXEOBJS) $(OBJS-$(1)-yes)
 $(1)$(EXESUF): $$(OBJS-$(1))
 $$(OBJS-$(1)): CFLAGS  += $(CFLAGS-$(1))
 $(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
@@ -137,7 +139,7 @@ $(1)$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
 -include $$(OBJS-$(1):.o=.d)
 endef
 
-$(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))
+$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P))))
 
 $(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
 	$(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
@@ -159,7 +161,7 @@ version.h .version:
 # force version.sh to run whenever version might have changed
 -include .version
 
-ifdef PROGS
+ifdef AVPROGS
 install: install-progs install-data
 endif
 
@@ -170,9 +172,9 @@ install-libs: install-libs-yes
 install-progs-yes:
 install-progs-$(CONFIG_SHARED): install-libs
 
-install-progs: install-progs-yes $(PROGS)
+install-progs: install-progs-yes $(AVPROGS)
 	$(Q)mkdir -p "$(BINDIR)"
-	$(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
+	$(INSTALL) -c -m 755 $(AVPROGS) "$(BINDIR)"
 
 install-data: $(DATA_FILES)
 	$(Q)mkdir -p "$(DATADIR)"
@@ -181,13 +183,13 @@ install-data: $(DATA_FILES)
 uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
 
 uninstall-progs:
-	$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
+	$(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
 
 uninstall-data:
 	$(RM) -r "$(DATADIR)"
 
 clean::
-	$(RM) $(ALLPROGS)
+	$(RM) $(ALLAVPROGS)
 	$(RM) $(CLEANSUFFIXES)
 	$(RM) $(CLEANSUFFIXES:%=tools/%)
 	$(RM) -rf coverage.info lcov
diff --git a/doc/Makefile b/doc/Makefile
index f0f9da2..3ab0940 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,6 +1,7 @@
-MANPAGES    = $(PROGS-yes:%=doc/%.1)
-PODPAGES    = $(PROGS-yes:%=doc/%.pod)
-HTMLPAGES   = $(PROGS-yes:%=doc/%.html)                                 \
+ALLMANPAGES = $(AVBASENAMES:%=%.1)
+MANPAGES    = $(AVPROGS-yes:%=doc/%.1)
+PODPAGES    = $(AVPROGS-yes:%=doc/%.pod)
+HTMLPAGES   = $(AVPROGS-yes:%=doc/%.html)                               \
               doc/developer.html                                        \
               doc/faq.html                                              \
               doc/fate.html                                             \



More information about the ffmpeg-cvslog mailing list