2011-06-29 22:01:14 +00:00
|
|
|
MAIN_MAKEFILE=1
|
2008-08-24 23:17:26 +00:00
|
|
|
include config.mak
|
|
|
|
|
2011-06-06 21:38:38 +00:00
|
|
|
vpath %.c $(SRC_PATH)
|
2011-08-30 22:41:25 +00:00
|
|
|
vpath %.cpp $(SRC_PATH)
|
2011-06-06 21:38:38 +00:00
|
|
|
vpath %.h $(SRC_PATH)
|
2014-04-01 03:12:20 +00:00
|
|
|
vpath %.m $(SRC_PATH)
|
2011-06-06 21:38:38 +00:00
|
|
|
vpath %.S $(SRC_PATH)
|
|
|
|
vpath %.asm $(SRC_PATH)
|
2013-12-05 20:50:14 +00:00
|
|
|
vpath %.rc $(SRC_PATH)
|
2011-06-06 21:38:38 +00:00
|
|
|
vpath %.v $(SRC_PATH)
|
|
|
|
vpath %.texi $(SRC_PATH)
|
2011-12-24 00:28:30 +00:00
|
|
|
vpath %/fate_config.sh.template $(SRC_PATH)
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2013-11-25 23:05:38 +00:00
|
|
|
AVPROGS-$(CONFIG_FFMPEG) += ffmpeg
|
|
|
|
AVPROGS-$(CONFIG_FFPLAY) += ffplay
|
|
|
|
AVPROGS-$(CONFIG_FFPROBE) += ffprobe
|
|
|
|
AVPROGS-$(CONFIG_FFSERVER) += ffserver
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2013-11-25 23:05:38 +00:00
|
|
|
AVPROGS := $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
|
|
|
INSTPROGS = $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
2013-11-02 15:44:18 +00:00
|
|
|
PROGS += $(AVPROGS)
|
2012-10-03 12:48:27 +00:00
|
|
|
|
2013-11-25 23:05:38 +00:00
|
|
|
AVBASENAMES = ffmpeg ffplay ffprobe ffserver
|
|
|
|
ALLAVPROGS = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
|
|
|
|
ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
|
2012-10-03 12:48:27 +00:00
|
|
|
|
2013-11-25 23:05:38 +00:00
|
|
|
$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog) += cmdutils.o))
|
2013-12-09 03:01:00 +00:00
|
|
|
$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_opencl.o))
|
2011-06-05 21:29:37 +00:00
|
|
|
|
2013-11-25 23:05:38 +00:00
|
|
|
OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o
|
2013-11-23 13:43:08 +00:00
|
|
|
OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
|
2014-04-28 23:32:04 +00:00
|
|
|
OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
|
2014-05-12 00:34:01 +00:00
|
|
|
OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_vda.o
|
2013-11-03 18:21:00 +00:00
|
|
|
|
2013-03-24 15:04:48 +00:00
|
|
|
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
|
2012-03-14 19:08:50 +00:00
|
|
|
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
|
2014-02-03 08:12:27 +00:00
|
|
|
TOOLS = qt-faststart trasher uncoded_frame
|
2011-07-10 19:26:25 +00:00
|
|
|
TOOLS-$(CONFIG_ZLIB) += cws2fws
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2014-05-15 12:53:30 +00:00
|
|
|
# $(FFLIBS-yes) needs to be in linking order
|
|
|
|
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
|
|
|
|
FFLIBS-$(CONFIG_AVFILTER) += avfilter
|
|
|
|
FFLIBS-$(CONFIG_AVFORMAT) += avformat
|
|
|
|
FFLIBS-$(CONFIG_AVCODEC) += avcodec
|
2012-03-23 21:42:17 +00:00
|
|
|
FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
|
2014-05-15 19:01:07 +00:00
|
|
|
FFLIBS-$(CONFIG_POSTPROC) += postproc
|
|
|
|
FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
|
2014-05-15 12:53:30 +00:00
|
|
|
FFLIBS-$(CONFIG_SWSCALE) += swscale
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2010-01-26 23:13:01 +00:00
|
|
|
FFLIBS := avutil
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2011-12-27 21:29:40 +00:00
|
|
|
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
|
2012-09-13 19:12:56 +00:00
|
|
|
EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README
|
2009-01-25 22:44:57 +00:00
|
|
|
|
2013-05-12 06:11:42 +00:00
|
|
|
SKIPHEADERS = cmdutils_common_opts.h compat/w32pthreads.h
|
2010-03-08 18:43:38 +00:00
|
|
|
|
2011-06-28 16:08:00 +00:00
|
|
|
include $(SRC_PATH)/common.mak
|
2008-08-24 23:17:26 +00:00
|
|
|
|
|
|
|
FF_EXTRALIBS := $(FFEXTRALIBS)
|
|
|
|
FF_DEP_LIBS := $(DEP_LIBS)
|
|
|
|
|
2013-11-02 15:44:18 +00:00
|
|
|
all: $(AVPROGS)
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2012-10-15 03:05:03 +00:00
|
|
|
$(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
|
2014-07-16 15:00:11 +00:00
|
|
|
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS)
|
2011-07-10 19:26:25 +00:00
|
|
|
|
2012-08-28 15:24:09 +00:00
|
|
|
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
|
2014-02-03 08:12:27 +00:00
|
|
|
tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
|
|
|
|
tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
|
2011-07-10 19:26:25 +00:00
|
|
|
|
2010-07-20 18:10:27 +00:00
|
|
|
config.h: .config
|
2011-06-06 21:38:38 +00:00
|
|
|
.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
|
2010-07-22 17:47:56 +00:00
|
|
|
@-tput bold 2>/dev/null
|
|
|
|
@-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
|
|
|
|
@-tput sgr0 2>/dev/null
|
2010-07-20 18:10:27 +00:00
|
|
|
|
2012-02-06 18:31:18 +00:00
|
|
|
SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
|
2012-10-25 14:13:06 +00:00
|
|
|
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
|
2014-04-05 11:46:51 +00:00
|
|
|
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
|
2014-01-07 10:00:46 +00:00
|
|
|
ALTIVEC-OBJS MMX-OBJS YASM-OBJS \
|
2012-06-04 16:02:56 +00:00
|
|
|
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS \
|
2013-12-05 20:50:14 +00:00
|
|
|
OBJS SLIBOBJS HOSTOBJS TESTOBJS
|
2008-08-24 23:17:26 +00:00
|
|
|
|
|
|
|
define RESET
|
|
|
|
$(1) :=
|
|
|
|
$(1)-yes :=
|
|
|
|
endef
|
|
|
|
|
|
|
|
define DOSUBDIR
|
|
|
|
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
|
|
|
|
SUBDIR := $(1)/
|
2011-06-28 16:08:00 +00:00
|
|
|
include $(SRC_PATH)/$(1)/Makefile
|
2012-01-25 12:35:19 +00:00
|
|
|
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
|
2014-05-13 21:03:28 +00:00
|
|
|
-include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
|
2011-12-13 14:55:11 +00:00
|
|
|
include $(SRC_PATH)/library.mak
|
2008-08-24 23:17:26 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
|
|
|
|
|
2013-11-02 16:05:28 +00:00
|
|
|
include $(SRC_PATH)/doc/Makefile
|
|
|
|
|
2012-08-04 18:04:08 +00:00
|
|
|
define DOPROG
|
2013-11-02 15:44:18 +00:00
|
|
|
OBJS-$(1) += $(1).o $(EXEOBJS) $(OBJS-$(1)-yes)
|
2012-10-16 12:15:16 +00:00
|
|
|
$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
|
2012-08-04 18:04:08 +00:00
|
|
|
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
|
2012-08-26 03:19:30 +00:00
|
|
|
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
|
|
|
|
$(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
|
2012-08-04 18:04:08 +00:00
|
|
|
-include $$(OBJS-$(1):.o=.d)
|
|
|
|
endef
|
|
|
|
|
2013-11-27 00:52:55 +00:00
|
|
|
$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2013-12-03 00:23:58 +00:00
|
|
|
ffprobe.o cmdutils.o : libavutil/ffversion.h
|
|
|
|
|
2013-11-27 00:52:55 +00:00
|
|
|
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
|
2013-11-26 00:50:25 +00:00
|
|
|
$(CP) $< $@
|
|
|
|
$(STRIP) $@
|
|
|
|
|
2012-10-16 12:15:16 +00:00
|
|
|
%$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS)
|
2014-07-16 15:00:11 +00:00
|
|
|
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2011-06-28 17:45:13 +00:00
|
|
|
OBJDIRS += tools
|
|
|
|
|
2011-02-20 17:16:42 +00:00
|
|
|
-include $(wildcard tools/*.d)
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2011-06-06 21:38:38 +00:00
|
|
|
VERSION_SH = $(SRC_PATH)/version.sh
|
|
|
|
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
|
2010-03-10 02:56:56 +00:00
|
|
|
|
2011-03-16 20:53:58 +00:00
|
|
|
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
|
2010-03-10 02:56:56 +00:00
|
|
|
.version: M=@
|
|
|
|
|
2013-11-29 00:29:41 +00:00
|
|
|
libavutil/ffversion.h .version:
|
|
|
|
$(M)$(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
|
2010-03-10 02:56:56 +00:00
|
|
|
$(Q)touch .version
|
|
|
|
|
|
|
|
# force version.sh to run whenever version might have changed
|
|
|
|
-include .version
|
2009-02-21 18:19:26 +00:00
|
|
|
|
2013-11-02 15:44:18 +00:00
|
|
|
ifdef AVPROGS
|
2011-06-07 09:11:21 +00:00
|
|
|
install: install-progs install-data
|
|
|
|
endif
|
|
|
|
|
|
|
|
install: install-libs install-headers
|
2011-06-05 20:52:32 +00:00
|
|
|
|
|
|
|
install-libs: install-libs-yes
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2011-06-11 18:54:23 +00:00
|
|
|
install-progs-yes:
|
2011-06-07 09:11:21 +00:00
|
|
|
install-progs-$(CONFIG_SHARED): install-libs
|
|
|
|
|
2013-11-02 15:44:18 +00:00
|
|
|
install-progs: install-progs-yes $(AVPROGS)
|
2010-03-06 17:14:19 +00:00
|
|
|
$(Q)mkdir -p "$(BINDIR)"
|
2011-09-06 13:48:14 +00:00
|
|
|
$(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2012-05-09 21:57:40 +00:00
|
|
|
install-data: $(DATA_FILES) $(EXAMPLES_FILES)
|
|
|
|
$(Q)mkdir -p "$(DATADIR)/examples"
|
2010-03-06 17:14:13 +00:00
|
|
|
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
|
2012-05-09 21:57:40 +00:00
|
|
|
$(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
|
2009-01-25 22:44:57 +00:00
|
|
|
|
2011-06-06 17:03:22 +00:00
|
|
|
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
|
2010-01-26 22:23:12 +00:00
|
|
|
|
|
|
|
uninstall-progs:
|
2013-11-02 15:44:18 +00:00
|
|
|
$(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
|
2010-01-26 22:23:12 +00:00
|
|
|
|
|
|
|
uninstall-data:
|
2010-03-06 14:25:10 +00:00
|
|
|
$(RM) -r "$(DATADIR)"
|
2010-01-26 22:23:12 +00:00
|
|
|
|
2011-06-06 18:44:29 +00:00
|
|
|
clean::
|
2013-11-25 23:05:38 +00:00
|
|
|
$(RM) $(ALLAVPROGS) $(ALLAVPROGS_G)
|
2010-03-06 14:25:10 +00:00
|
|
|
$(RM) $(CLEANSUFFIXES)
|
2011-02-12 08:50:46 +00:00
|
|
|
$(RM) $(CLEANSUFFIXES:%=tools/%)
|
2011-11-29 19:35:48 +00:00
|
|
|
$(RM) -r coverage-html
|
2013-03-23 07:17:24 +00:00
|
|
|
$(RM) -rf coverage.info lcov
|
2008-08-24 23:17:26 +00:00
|
|
|
|
|
|
|
distclean::
|
2010-03-06 14:25:10 +00:00
|
|
|
$(RM) $(DISTCLEANSUFFIXES)
|
2013-11-30 20:52:39 +00:00
|
|
|
$(RM) config.* .config libavutil/avconfig.h .version version.h libavutil/ffversion.h libavcodec/codec_names.h
|
2008-08-24 23:17:26 +00:00
|
|
|
|
2010-07-22 17:47:56 +00:00
|
|
|
config:
|
2011-03-17 16:01:10 +00:00
|
|
|
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
|
2009-06-15 22:12:23 +00:00
|
|
|
|
2012-06-28 22:05:40 +00:00
|
|
|
check: all alltools examples testprogs fate
|
2011-06-26 11:52:40 +00:00
|
|
|
|
2011-06-28 16:08:00 +00:00
|
|
|
include $(SRC_PATH)/tests/Makefile
|
2010-08-26 13:58:45 +00:00
|
|
|
|
2011-06-28 17:45:13 +00:00
|
|
|
$(sort $(OBJDIRS)):
|
|
|
|
$(Q)mkdir -p $@
|
|
|
|
|
2011-06-06 14:21:12 +00:00
|
|
|
# Dummy rule to stop make trying to rebuild removed or renamed headers
|
|
|
|
%.h:
|
|
|
|
@:
|
|
|
|
|
|
|
|
# Disable suffix rules. Most of the builtin rules are suffix rules,
|
|
|
|
# so this saves some time on slow systems.
|
|
|
|
.SUFFIXES:
|
|
|
|
|
2012-05-12 15:33:16 +00:00
|
|
|
.PHONY: all all-yes alltools check *clean config install*
|
2011-06-06 18:44:29 +00:00
|
|
|
.PHONY: testprogs uninstall*
|