This unclutters the top-level directory and groups related files together. ---
Got rid of some code duplication that was still present in the previous version. Makefile | 49 ++++-------------------------- avtools/Makefile | 44 +++++++++++++++++++++++++++ avconv.c => avtools/avconv.c | 0 avconv.h => avtools/avconv.h | 0 avconv_dxva2.c => avtools/avconv_dxva2.c | 0 avconv_filter.c => avtools/avconv_filter.c | 0 avconv_opt.c => avtools/avconv_opt.c | 0 avconv_qsv.c => avtools/avconv_qsv.c | 0 avconv_vaapi.c => avtools/avconv_vaapi.c | 0 avconv_vda.c => avtools/avconv_vda.c | 0 avconv_vdpau.c => avtools/avconv_vdpau.c | 0 avplay.c => avtools/avplay.c | 0 avprobe.c => avtools/avprobe.c | 0 cmdutils.c => avtools/cmdutils.c | 0 cmdutils.h => avtools/cmdutils.h | 0 configure | 1 + doc/Makefile | 2 ++ 17 files changed, 53 insertions(+), 43 deletions(-) create mode 100644 avtools/Makefile rename avconv.c => avtools/avconv.c (100%) rename avconv.h => avtools/avconv.h (100%) rename avconv_dxva2.c => avtools/avconv_dxva2.c (100%) rename avconv_filter.c => avtools/avconv_filter.c (100%) rename avconv_opt.c => avtools/avconv_opt.c (100%) rename avconv_qsv.c => avtools/avconv_qsv.c (100%) rename avconv_vaapi.c => avtools/avconv_vaapi.c (100%) rename avconv_vda.c => avtools/avconv_vda.c (100%) rename avconv_vdpau.c => avtools/avconv_vdpau.c (100%) rename avplay.c => avtools/avplay.c (100%) rename avprobe.c => avtools/avprobe.c (100%) rename cmdutils.c => avtools/cmdutils.c (100%) rename cmdutils.h => avtools/cmdutils.h (100%) diff --git a/Makefile b/Makefile index 98eb3ab..13e2b28 100644 --- a/Makefile +++ b/Makefile @@ -69,25 +69,6 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC) %.c %.h %.pc %.ver %.version: TAG = GEN -AVPROGS-$(CONFIG_AVCONV) += avconv -AVPROGS-$(CONFIG_AVPLAY) += avplay -AVPROGS-$(CONFIG_AVPROBE) += avprobe - -AVPROGS := $(AVPROGS-yes:%=%$(EXESUF)) -PROGS += $(AVPROGS) - -AVBASENAMES = avconv avplay avprobe -ALLAVPROGS = $(AVBASENAMES:%=%$(EXESUF)) - -$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog) += cmdutils.o)) - -OBJS-avconv += avconv_opt.o avconv_filter.o -OBJS-avconv-$(CONFIG_LIBMFX) += avconv_qsv.o -OBJS-avconv-$(CONFIG_VAAPI) += avconv_vaapi.o -OBJS-avconv-$(CONFIG_VDA) += avconv_vda.o -OBJS-avconv-$(HAVE_DXVA2_LIB) += avconv_dxva2.o -OBJS-avconv-$(HAVE_VDPAU_X11) += avconv_vdpau.o - TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options @@ -115,8 +96,6 @@ FF_EXTRALIBS := $(FFEXTRALIBS) FF_DEP_LIBS := $(DEP_LIBS) FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS) -all: $(AVPROGS) - $(TOOLS): %$(EXESUF): %.o $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS) $(ELIBS) @@ -153,10 +132,8 @@ endef $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D)))) -include $(SRC_PATH)/doc/Makefile - define DOPROG -OBJS-$(1) += $(1).o $(OBJS-$(1)-yes) +OBJS-$(1) += $(2)$(1).o $(OBJS-$(1)-yes) $(1)$(EXESUF): $$(OBJS-$(1)) $$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1)) $(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1)) @@ -164,9 +141,10 @@ $(1)$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1)) -include $$(OBJS-$(1):.o=.d) endef -$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(EXESUF)=)))) +include $(SRC_PATH)/avtools/Makefile +include $(SRC_PATH)/doc/Makefile -$(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS) +$(PROGS): %$(EXESUF): $(FF_DEP_LIBS) $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS) VERSION_SH = $(SRC_PATH)/avbuild/version.sh @@ -175,7 +153,7 @@ GIT_LOG = $(SRC_PATH)/.git/logs/HEAD .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) avbuild/config.mak .version: M=@ -cmdutils.o libavutil/utils.o: avversion.h +libavutil/utils.o: avversion.h avversion.h .version: $(M)$(VERSION_SH) $(SRC_PATH) avversion.h $(EXTRA_VERSION) $(Q)touch .version @@ -183,35 +161,20 @@ avversion.h .version: # force version.sh to run whenever version might have changed -include .version -ifdef AVPROGS -install: install-progs install-data -endif - install: install-libs install-headers install-libs: install-libs-yes -install-progs-yes: -install-progs-$(CONFIG_SHARED): install-libs - -install-progs: install-progs-yes $(AVPROGS) - $(Q)mkdir -p "$(BINDIR)" - $(INSTALL) -c -m 755 $(AVPROGS) "$(BINDIR)" - install-data: $(DATA_FILES) $(Q)mkdir -p "$(DATADIR)" $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)" -uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data - -uninstall-progs: - $(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS)) +uninstall: uninstall-libs uninstall-headers uninstall-data uninstall-data: $(RM) -r "$(DATADIR)" clean:: - $(RM) $(ALLAVPROGS) $(RM) $(CLEANSUFFIXES) $(RM) -rf coverage.info lcov diff --git a/avtools/Makefile b/avtools/Makefile new file mode 100644 index 0000000..ecac58b --- /dev/null +++ b/avtools/Makefile @@ -0,0 +1,44 @@ +AVPROGS-$(CONFIG_AVCONV) += avconv +AVPROGS-$(CONFIG_AVPLAY) += avplay +AVPROGS-$(CONFIG_AVPROBE) += avprobe + +AVPROGS := $(AVPROGS-yes:%=%$(EXESUF)) +PROGS += $(AVPROGS) + +AVBASENAMES = avconv avplay avprobe +ALLAVPROGS = $(AVBASENAMES:%=%$(EXESUF)) + +$(foreach prog,$(ALLAVPROGS),$(eval OBJS-$(prog) += avtools/cmdutils.o)) + +OBJS-avconv += avtools/avconv_opt.o avtools/avconv_filter.o +OBJS-avconv-$(CONFIG_LIBMFX) += avtools/avconv_qsv.o +OBJS-avconv-$(CONFIG_VAAPI) += avtools/avconv_vaapi.o +OBJS-avconv-$(CONFIG_VDA) += avtools/avconv_vda.o +OBJS-avconv-$(HAVE_DXVA2_LIB) += avtools/avconv_dxva2.o +OBJS-avconv-$(HAVE_VDPAU_X11) += avtools/avconv_vdpau.o + +$(foreach P,$(ALLAVPROGS),$(eval $(call DOPROG,$(P),avtools/))) + +all: $(AVPROGS) + +avtools/cmdutils.o: avversion.h | avtools +OBJDIRS += avtools + +ifdef AVPROGS +install: install-progs install-data +endif + +install-progs-yes: +install-progs-$(CONFIG_SHARED): install-libs + +install-progs: install-progs-yes $(AVPROGS) + $(Q)mkdir -p "$(BINDIR)" + $(INSTALL) -c -m 755 $(AVPROGS) "$(BINDIR)" + +uninstall: uninstall-progs + +uninstall-progs: + $(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS)) + +clean:: + $(RM) $(ALLAVPROGS) $(CLEANSUFFIXES:%=avtools/%) diff --git a/avconv.c b/avtools/avconv.c similarity index 100% rename from avconv.c rename to avtools/avconv.c diff --git a/avconv.h b/avtools/avconv.h similarity index 100% rename from avconv.h rename to avtools/avconv.h diff --git a/avconv_dxva2.c b/avtools/avconv_dxva2.c similarity index 100% rename from avconv_dxva2.c rename to avtools/avconv_dxva2.c diff --git a/avconv_filter.c b/avtools/avconv_filter.c similarity index 100% rename from avconv_filter.c rename to avtools/avconv_filter.c diff --git a/avconv_opt.c b/avtools/avconv_opt.c similarity index 100% rename from avconv_opt.c rename to avtools/avconv_opt.c diff --git a/avconv_qsv.c b/avtools/avconv_qsv.c similarity index 100% rename from avconv_qsv.c rename to avtools/avconv_qsv.c diff --git a/avconv_vaapi.c b/avtools/avconv_vaapi.c similarity index 100% rename from avconv_vaapi.c rename to avtools/avconv_vaapi.c diff --git a/avconv_vda.c b/avtools/avconv_vda.c similarity index 100% rename from avconv_vda.c rename to avtools/avconv_vda.c diff --git a/avconv_vdpau.c b/avtools/avconv_vdpau.c similarity index 100% rename from avconv_vdpau.c rename to avtools/avconv_vdpau.c diff --git a/avplay.c b/avtools/avplay.c similarity index 100% rename from avplay.c rename to avtools/avplay.c diff --git a/avprobe.c b/avtools/avprobe.c similarity index 100% rename from avprobe.c rename to avtools/avprobe.c diff --git a/cmdutils.c b/avtools/cmdutils.c similarity index 100% rename from cmdutils.c rename to avtools/cmdutils.c diff --git a/cmdutils.h b/avtools/cmdutils.h similarity index 100% rename from cmdutils.h rename to avtools/cmdutils.h diff --git a/configure b/configure index 9ebc3bf..f3b24a6 100755 --- a/configure +++ b/configure @@ -4796,6 +4796,7 @@ if enabled libcdio; then fi if enabled libxcb; then + require_pkg_config libxcb xcb xcb/xcb.h xcb_connect require_pkg_config libxcb xcb-shape xcb/shape.h xcb_shape_rectangles disabled libxcb_shm || require_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach diff --git a/doc/Makefile b/doc/Makefile index bd5c2e4..c7687d1 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -37,6 +37,8 @@ DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF)) ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES:%=doc/examples/%$(EXESUF)) PROGS += $(DOC_EXAMPLES) +$(foreach P,$(DOC_EXAMPLES),$(eval $(call DOPROG,$(P:$(EXESUF)=)),)) + all: $(DOCS) apidoc: doc/doxy/html -- 2.1.4 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel