2011-06-30 01:01:14 +03:00
|
|
|
MAIN_MAKEFILE=1
|
2008-08-25 02:17:26 +03:00
|
|
|
include config.mak
|
|
|
|
|
2011-06-07 00:38:38 +03:00
|
|
|
vpath %.c $(SRC_PATH)
|
2011-08-31 01:41:25 +03:00
|
|
|
vpath %.cpp $(SRC_PATH)
|
2011-06-07 00:38:38 +03:00
|
|
|
vpath %.h $(SRC_PATH)
|
|
|
|
vpath %.S $(SRC_PATH)
|
|
|
|
vpath %.asm $(SRC_PATH)
|
|
|
|
vpath %.v $(SRC_PATH)
|
|
|
|
vpath %.texi $(SRC_PATH)
|
2011-12-24 03:28:30 +03:00
|
|
|
vpath %/fate_config.sh.template $(SRC_PATH)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
|
|
|
PROGS-$(CONFIG_FFMPEG) += ffmpeg
|
|
|
|
PROGS-$(CONFIG_FFPLAY) += ffplay
|
2010-02-21 13:43:01 +02:00
|
|
|
PROGS-$(CONFIG_FFPROBE) += ffprobe
|
2008-08-25 02:17:26 +03:00
|
|
|
PROGS-$(CONFIG_FFSERVER) += ffserver
|
|
|
|
|
2012-08-26 06:19:30 +03:00
|
|
|
PROGS := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
2011-09-06 16:48:14 +03:00
|
|
|
INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
2012-08-04 21:04:08 +03:00
|
|
|
OBJS = cmdutils.o
|
2012-08-09 01:26:38 +03:00
|
|
|
OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
|
2011-01-25 15:25:18 +02:00
|
|
|
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
|
2012-03-14 22:08:50 +03:00
|
|
|
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
|
2011-07-10 22:26:25 +03:00
|
|
|
TOOLS = qt-faststart trasher
|
|
|
|
TOOLS-$(CONFIG_ZLIB) += cws2fws
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2012-01-24 23:55:47 +03:00
|
|
|
BASENAMES = ffmpeg ffplay ffprobe ffserver
|
2011-08-29 18:52:03 +03:00
|
|
|
ALLPROGS = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
|
|
|
|
ALLPROGS_G = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
|
2011-01-20 04:04:19 +02:00
|
|
|
ALLMANPAGES = $(BASENAMES:%=%.1)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2010-01-27 01:13:01 +02:00
|
|
|
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
|
2008-08-25 02:17:26 +03:00
|
|
|
FFLIBS-$(CONFIG_AVFILTER) += avfilter
|
2010-01-27 01:13:01 +02:00
|
|
|
FFLIBS-$(CONFIG_AVFORMAT) += avformat
|
2012-03-24 00:42:17 +03:00
|
|
|
FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
|
2010-01-27 02:26:41 +02:00
|
|
|
FFLIBS-$(CONFIG_AVCODEC) += avcodec
|
2008-08-25 02:17:26 +03:00
|
|
|
FFLIBS-$(CONFIG_POSTPROC) += postproc
|
2011-09-19 07:13:30 +03:00
|
|
|
FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
|
2010-01-27 01:13:01 +02:00
|
|
|
FFLIBS-$(CONFIG_SWSCALE) += swscale
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2010-01-27 01:13:01 +02:00
|
|
|
FFLIBS := avutil
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2011-12-28 00:29:40 +03:00
|
|
|
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
|
2012-05-10 00:57:40 +03:00
|
|
|
EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile
|
2009-01-26 00:44:57 +02:00
|
|
|
|
2010-03-08 20:43:38 +02:00
|
|
|
SKIPHEADERS = cmdutils_common_opts.h
|
|
|
|
|
2011-06-28 19:08:00 +03:00
|
|
|
include $(SRC_PATH)/common.mak
|
2008-08-25 02:17:26 +03:00
|
|
|
|
|
|
|
FF_EXTRALIBS := $(FFEXTRALIBS)
|
|
|
|
FF_DEP_LIBS := $(DEP_LIBS)
|
|
|
|
|
2011-12-12 22:59:04 +03:00
|
|
|
all: $(PROGS)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2012-08-26 06:19:30 +03:00
|
|
|
$(PROGS): %$(EXESUF): %_g$(EXESUF)
|
|
|
|
$(CP) $< $@
|
|
|
|
$(STRIP) $@
|
2011-04-01 01:24:12 +03:00
|
|
|
|
2011-07-10 22:26:25 +03:00
|
|
|
$(TOOLS): %$(EXESUF): %.o
|
2012-08-27 06:09:29 +03:00
|
|
|
$(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)
|
2011-07-10 22:26:25 +03:00
|
|
|
|
|
|
|
tools/cws2fws$(EXESUF): ELIBS = -lz
|
|
|
|
|
2010-07-20 21:10:27 +03:00
|
|
|
config.h: .config
|
2011-06-07 00:38:38 +03:00
|
|
|
.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
|
2010-07-22 20:47:56 +03: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 21:10:27 +03:00
|
|
|
|
2012-02-06 21:31:18 +03:00
|
|
|
SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
|
2012-02-03 01:55:57 +03:00
|
|
|
ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
|
2012-08-08 03:41:57 +03:00
|
|
|
ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS \
|
|
|
|
MMI-OBJS ALTIVEC-OBJS VIS-OBJS \
|
|
|
|
MMX-OBJS YASM-OBJS \
|
2012-06-04 19:02:56 +03:00
|
|
|
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS \
|
2012-08-08 16:41:36 +03:00
|
|
|
OBJS HOSTOBJS TESTOBJS
|
2008-08-25 02:17:26 +03:00
|
|
|
|
|
|
|
define RESET
|
|
|
|
$(1) :=
|
|
|
|
$(1)-yes :=
|
|
|
|
endef
|
|
|
|
|
|
|
|
define DOSUBDIR
|
|
|
|
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
|
|
|
|
SUBDIR := $(1)/
|
2011-06-28 19:08:00 +03:00
|
|
|
include $(SRC_PATH)/$(1)/Makefile
|
2012-01-25 15:35:19 +03:00
|
|
|
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
|
2011-12-13 17:55:11 +03:00
|
|
|
include $(SRC_PATH)/library.mak
|
2008-08-25 02:17:26 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
|
|
|
|
|
2012-08-04 21:04:08 +03:00
|
|
|
define DOPROG
|
|
|
|
OBJS-$(1) += $(1).o
|
2012-08-26 06:19:30 +03:00
|
|
|
$(1)$(PROGSSUF)_g$(EXESUF): $(OBJS-$(1))
|
2012-08-04 21:04:08 +03:00
|
|
|
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
|
2012-08-26 06:19:30 +03:00
|
|
|
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
|
|
|
|
$(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
|
2012-08-04 21:04:08 +03:00
|
|
|
-include $$(OBJS-$(1):.o=.d)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2011-08-29 18:52:03 +03:00
|
|
|
%$(PROGSSUF)_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
|
2012-08-27 06:09:29 +03:00
|
|
|
$(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2011-06-28 20:45:13 +03:00
|
|
|
OBJDIRS += tools
|
|
|
|
|
2011-02-20 19:16:42 +02:00
|
|
|
-include $(wildcard tools/*.d)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2011-06-07 00:38:38 +03:00
|
|
|
VERSION_SH = $(SRC_PATH)/version.sh
|
|
|
|
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
|
2010-03-10 04:56:56 +02:00
|
|
|
|
2011-03-16 22:53:58 +02:00
|
|
|
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
|
2010-03-10 04:56:56 +02:00
|
|
|
.version: M=@
|
|
|
|
|
|
|
|
version.h .version:
|
2010-03-10 05:10:26 +02:00
|
|
|
$(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
|
2010-03-10 04:56:56 +02:00
|
|
|
$(Q)touch .version
|
|
|
|
|
|
|
|
# force version.sh to run whenever version might have changed
|
|
|
|
-include .version
|
2009-02-21 20:19:26 +02:00
|
|
|
|
2011-06-07 12:11:21 +03:00
|
|
|
ifdef PROGS
|
|
|
|
install: install-progs install-data
|
|
|
|
endif
|
|
|
|
|
|
|
|
install: install-libs install-headers
|
2011-06-05 23:52:32 +03:00
|
|
|
|
|
|
|
install-libs: install-libs-yes
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2011-06-11 21:54:23 +03:00
|
|
|
install-progs-yes:
|
2011-06-07 12:11:21 +03:00
|
|
|
install-progs-$(CONFIG_SHARED): install-libs
|
|
|
|
|
|
|
|
install-progs: install-progs-yes $(PROGS)
|
2010-03-06 19:14:19 +02:00
|
|
|
$(Q)mkdir -p "$(BINDIR)"
|
2011-09-06 16:48:14 +03:00
|
|
|
$(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2012-05-10 00:57:40 +03:00
|
|
|
install-data: $(DATA_FILES) $(EXAMPLES_FILES)
|
|
|
|
$(Q)mkdir -p "$(DATADIR)/examples"
|
2010-03-06 19:14:13 +02:00
|
|
|
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
|
2012-05-10 00:57:40 +03:00
|
|
|
$(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
|
2009-01-26 00:44:57 +02:00
|
|
|
|
2011-06-06 20:03:22 +03:00
|
|
|
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
|
2010-01-27 00:23:12 +02:00
|
|
|
|
|
|
|
uninstall-progs:
|
2010-03-06 16:25:10 +02:00
|
|
|
$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
|
2010-01-27 00:23:12 +02:00
|
|
|
|
|
|
|
uninstall-data:
|
2010-03-06 16:25:10 +02:00
|
|
|
$(RM) -r "$(DATADIR)"
|
2010-01-27 00:23:12 +02:00
|
|
|
|
2011-06-06 21:44:29 +03:00
|
|
|
clean::
|
2011-04-01 01:24:12 +03:00
|
|
|
$(RM) $(ALLPROGS) $(ALLPROGS_G)
|
2010-03-06 16:25:10 +02:00
|
|
|
$(RM) $(CLEANSUFFIXES)
|
|
|
|
$(RM) $(TOOLS)
|
2011-02-12 10:50:46 +02:00
|
|
|
$(RM) $(CLEANSUFFIXES:%=tools/%)
|
2011-11-29 22:35:48 +03:00
|
|
|
$(RM) coverage.info
|
|
|
|
$(RM) -r coverage-html
|
2008-08-25 02:17:26 +03:00
|
|
|
|
|
|
|
distclean::
|
2010-03-06 16:25:10 +02:00
|
|
|
$(RM) $(DISTCLEANSUFFIXES)
|
2011-05-26 16:48:31 +03:00
|
|
|
$(RM) config.* .version version.h libavutil/avconfig.h
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2010-07-22 20:47:56 +03:00
|
|
|
config:
|
2011-03-17 18:01:10 +02:00
|
|
|
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
|
2009-06-16 01:12:23 +03:00
|
|
|
|
2011-11-29 22:35:48 +03:00
|
|
|
# Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
|
|
|
|
coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
|
|
|
|
$(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@
|
|
|
|
|
|
|
|
coverage-html: coverage.info
|
|
|
|
$(Q)mkdir -p $@
|
|
|
|
$(Q)genhtml -o $@ $<
|
|
|
|
$(Q)touch $@
|
|
|
|
|
2012-06-29 01:05:40 +03:00
|
|
|
check: all alltools examples testprogs fate
|
2011-06-26 14:52:40 +03:00
|
|
|
|
2011-06-28 19:08:00 +03:00
|
|
|
include $(SRC_PATH)/doc/Makefile
|
|
|
|
include $(SRC_PATH)/tests/Makefile
|
2010-08-26 16:58:45 +03:00
|
|
|
|
2011-06-28 20:45:13 +03:00
|
|
|
$(sort $(OBJDIRS)):
|
|
|
|
$(Q)mkdir -p $@
|
|
|
|
|
2011-06-06 17:21:12 +03: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 18:33:16 +03:00
|
|
|
.PHONY: all all-yes alltools check *clean config install*
|
2011-06-06 21:44:29 +03:00
|
|
|
.PHONY: testprogs uninstall*
|