2008-08-25 02:17:26 +03:00
|
|
|
include config.mak
|
|
|
|
|
|
|
|
SRC_DIR = $(SRC_PATH_BARE)
|
|
|
|
|
2011-06-06 00:00:54 +03:00
|
|
|
vpath %.c $(SRC_DIR)
|
|
|
|
vpath %.h $(SRC_DIR)
|
|
|
|
vpath %.S $(SRC_DIR)
|
|
|
|
vpath %.asm $(SRC_DIR)
|
|
|
|
vpath %.v $(SRC_DIR)
|
2008-08-25 02:17:26 +03:00
|
|
|
vpath %.texi $(SRC_PATH_BARE)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2011-01-20 04:04:19 +02:00
|
|
|
PROGS := $(PROGS-yes:%=%$(EXESUF))
|
|
|
|
OBJS = $(PROGS-yes:%=%.o) cmdutils.o
|
2011-02-12 10:50:35 +02:00
|
|
|
TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws graph2dot lavfi-showfiltfmts pktdumper probetest qt-faststart trasher))
|
2011-01-25 15:25:18 +02:00
|
|
|
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
|
|
|
|
HOSTPROGS := $(TESTTOOLS:%=tests/%)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2010-02-21 13:43:01 +02:00
|
|
|
BASENAMES = ffmpeg ffplay ffprobe ffserver
|
2011-01-20 04:04:19 +02:00
|
|
|
ALLPROGS = $(BASENAMES:%=%$(EXESUF))
|
|
|
|
ALLMANPAGES = $(BASENAMES:%=%.1)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2011-06-06 00:18:06 +03:00
|
|
|
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
|
|
|
|
|
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
|
2010-01-27 02:26:41 +02:00
|
|
|
FFLIBS-$(CONFIG_AVCODEC) += avcodec
|
2008-08-25 02:17:26 +03:00
|
|
|
FFLIBS-$(CONFIG_POSTPROC) += postproc
|
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
|
|
|
|
2009-01-26 00:44:57 +02:00
|
|
|
DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
|
|
|
|
|
2010-03-08 20:43:38 +02:00
|
|
|
SKIPHEADERS = cmdutils_common_opts.h
|
|
|
|
|
2008-08-25 02:17:26 +03:00
|
|
|
include common.mak
|
|
|
|
|
|
|
|
FF_LDFLAGS := $(FFLDFLAGS)
|
|
|
|
FF_EXTRALIBS := $(FFEXTRALIBS)
|
|
|
|
FF_DEP_LIBS := $(DEP_LIBS)
|
|
|
|
|
2011-06-07 12:11:21 +03:00
|
|
|
all: $(FF_DEP_LIBS) $(PROGS)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2010-07-20 21:10:27 +03:00
|
|
|
config.h: .config
|
|
|
|
.config: $(wildcard $(FFLIBS:%=$(SRC_DIR)/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
|
|
|
|
2009-08-23 14:02:37 +03:00
|
|
|
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
|
2009-10-29 02:55:35 +02:00
|
|
|
ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
|
2011-02-02 00:38:15 +02:00
|
|
|
HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS
|
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)/
|
|
|
|
include $(1)/Makefile
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
|
|
|
|
|
2011-06-06 21:57:10 +03:00
|
|
|
ffplay.o: CFLAGS += $(SDL_CFLAGS)
|
2011-03-29 22:50:26 +03:00
|
|
|
ffplay$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
|
|
|
|
ffserver$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2011-06-07 01:00:26 +03:00
|
|
|
$(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
|
2009-07-12 16:29:40 +03:00
|
|
|
$(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2011-06-06 21:57:10 +03:00
|
|
|
alltools: $(TOOLS)
|
|
|
|
|
2009-07-22 19:14:59 +03:00
|
|
|
tools/%$(EXESUF): tools/%.o
|
|
|
|
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
|
|
|
|
2009-09-10 12:30:57 +03:00
|
|
|
tools/%.o: tools/%.c
|
2010-12-07 13:42:19 +02:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
|
2011-02-20 19:16:42 +02:00
|
|
|
|
|
|
|
-include $(wildcard tools/*.d)
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2010-03-10 04:56:56 +02:00
|
|
|
VERSION_SH = $(SRC_PATH_BARE)/version.sh
|
2010-03-10 04:56:59 +02:00
|
|
|
GIT_LOG = $(SRC_PATH_BARE)/.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)"
|
2010-03-06 19:14:13 +02:00
|
|
|
$(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
|
2008-08-25 02:17:26 +03:00
|
|
|
|
2009-01-26 00:44:57 +02:00
|
|
|
install-data: $(DATA_FILES)
|
2010-03-06 19:14:19 +02:00
|
|
|
$(Q)mkdir -p "$(DATADIR)"
|
2010-03-06 19:14:13 +02:00
|
|
|
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
|
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-03-29 22:50:26 +03:00
|
|
|
$(RM) $(ALLPROGS)
|
2010-03-06 16:25:10 +02:00
|
|
|
$(RM) $(CLEANSUFFIXES)
|
|
|
|
$(RM) $(TOOLS)
|
2011-02-12 10:50:46 +02:00
|
|
|
$(RM) $(CLEANSUFFIXES:%=tools/%)
|
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-14 23:23:10 +02:00
|
|
|
$(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
|
2009-06-16 01:12:23 +03:00
|
|
|
|
2008-10-30 12:14:57 +02:00
|
|
|
check: test checkheaders
|
|
|
|
|
2011-06-06 20:03:22 +03:00
|
|
|
include doc/Makefile
|
2011-06-06 21:44:29 +03:00
|
|
|
include tests/Makefile
|
2010-08-26 16:58:45 +03:00
|
|
|
|
2011-06-06 20:03:22 +03:00
|
|
|
.PHONY: all alltools *clean check config examples install*
|
2011-06-06 21:44:29 +03:00
|
|
|
.PHONY: testprogs uninstall*
|