build: Move cli tool sources to a separate subdirectory

This unclutters the top-level directory and groups related files together.
pull/273/head
Diego Biurrun 8 years ago
parent ab566cc96b
commit c95169f0ec
  1. 54
      Makefile
  2. 52
      avtools/Makefile
  3. 0
      avtools/avconv.c
  4. 0
      avtools/avconv.h
  5. 0
      avtools/avconv_dxva2.c
  6. 0
      avtools/avconv_filter.c
  7. 0
      avtools/avconv_opt.c
  8. 0
      avtools/avconv_qsv.c
  9. 0
      avtools/avconv_vaapi.c
  10. 0
      avtools/avconv_vda.c
  11. 0
      avtools/avconv_vdpau.c
  12. 0
      avtools/avplay.c
  13. 0
      avtools/avprobe.c
  14. 0
      avtools/cmdutils.c
  15. 0
      avtools/cmdutils.h

@ -69,25 +69,6 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
%.c %.h %.pc %.ver %.version: TAG = GEN %.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 TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
@ -115,8 +96,6 @@ FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS) FF_DEP_LIBS := $(DEP_LIBS)
FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS) FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
all: $(AVPROGS)
$(TOOLS): %$(EXESUF): %.o $(TOOLS): %$(EXESUF): %.o
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS) $(ELIBS) $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS) $(ELIBS)
@ -153,21 +132,11 @@ endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D)))) $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
include $(SRC_PATH)/avtools/Makefile
include $(SRC_PATH)/doc/Makefile include $(SRC_PATH)/doc/Makefile
include $(SRC_PATH)/doc/examples/Makefile include $(SRC_PATH)/doc/examples/Makefile
define DOPROG $(PROGS): %$(EXESUF): $(FF_DEP_LIBS)
OBJS-$(1) += $(1).o $(OBJS-$(1)-yes)
$(1)$(EXESUF): $$(OBJS-$(1))
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
$(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
$(1)$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1))
-include $$(OBJS-$(1):.o=.d)
endef
$(foreach P,$(AVPROGS-yes),$(eval $(call DOPROG,$(P))))
$(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS) $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
VERSION_SH = $(SRC_PATH)/avbuild/version.sh VERSION_SH = $(SRC_PATH)/avbuild/version.sh
@ -176,7 +145,7 @@ GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) avbuild/config.mak .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) avbuild/config.mak
.version: M=@ .version: M=@
cmdutils.o libavutil/utils.o: avversion.h libavutil/utils.o: avversion.h
avversion.h .version: avversion.h .version:
$(M)$(VERSION_SH) $(SRC_PATH) avversion.h $(EXTRA_VERSION) $(M)$(VERSION_SH) $(SRC_PATH) avversion.h $(EXTRA_VERSION)
$(Q)touch .version $(Q)touch .version
@ -184,35 +153,20 @@ avversion.h .version:
# force version.sh to run whenever version might have changed # force version.sh to run whenever version might have changed
-include .version -include .version
ifdef AVPROGS
install: install-progs install-data
endif
install: install-libs install-headers install: install-libs install-headers
install-libs: install-libs-yes 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) install-data: $(DATA_FILES)
$(Q)mkdir -p "$(DATADIR)" $(Q)mkdir -p "$(DATADIR)"
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)" $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data uninstall: uninstall-libs uninstall-headers uninstall-data
uninstall-progs:
$(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
uninstall-data: uninstall-data:
$(RM) -r "$(DATADIR)" $(RM) -r "$(DATADIR)"
clean:: clean::
$(RM) $(ALLAVPROGS)
$(RM) $(CLEANSUFFIXES) $(RM) $(CLEANSUFFIXES)
$(RM) -rf coverage.info lcov $(RM) -rf coverage.info lcov

@ -0,0 +1,52 @@
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))
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
define DOAVTOOL
OBJS-$(1) += avtools/cmdutils.o avtools/$(1).o $(OBJS-$(1)-yes)
$(1)$(EXESUF): $$(OBJS-$(1))
$$(OBJS-$(1)): | avtools
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
$(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
$(1)$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1))
-include $$(OBJS-$(1):.o=.d)
endef
$(foreach P,$(AVPROGS-yes),$(eval $(call DOAVTOOL,$(P))))
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/%)
Loading…
Cancel
Save