2001-07-23 20:06:54 +00:00
|
|
|
include config.mak
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2008-03-15 19:24:05 +00:00
|
|
|
SRC_DIR = $(SRC_PATH_BARE)
|
|
|
|
|
2008-03-05 21:27:58 +00:00
|
|
|
vpath %.texi $(SRC_PATH_BARE)
|
2002-05-18 23:11:25 +00:00
|
|
|
|
2007-02-27 19:00:26 +00:00
|
|
|
PROGS-$(CONFIG_FFMPEG) += ffmpeg
|
|
|
|
PROGS-$(CONFIG_FFPLAY) += ffplay
|
|
|
|
PROGS-$(CONFIG_FFSERVER) += ffserver
|
2003-06-07 18:34:02 +00:00
|
|
|
|
2007-06-10 14:28:42 +00:00
|
|
|
PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
|
|
|
|
PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
|
2008-04-09 20:48:17 +00:00
|
|
|
OBJS = $(addsuffix .o, $(PROGS-yes)) cmdutils.o
|
2007-06-10 14:28:42 +00:00
|
|
|
MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2007-06-10 14:28:42 +00:00
|
|
|
BASENAMES = ffmpeg ffplay ffserver
|
|
|
|
ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
|
|
|
|
ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
|
|
|
|
ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
|
2006-05-18 12:33:13 +00:00
|
|
|
|
2008-04-03 23:51:29 +00:00
|
|
|
FFLIBS-$(CONFIG_AVFILTER) += avfilter
|
|
|
|
FFLIBS-$(CONFIG_POSTPROC) += postproc
|
|
|
|
FFLIBS-$(CONFIG_SWSCALE) += swscale
|
2008-04-03 22:39:54 +00:00
|
|
|
|
2008-04-03 23:51:29 +00:00
|
|
|
FFLIBS := avdevice avformat avcodec avutil
|
2004-10-22 02:04:30 +00:00
|
|
|
|
2008-04-07 21:16:31 +00:00
|
|
|
include common.mak
|
|
|
|
|
|
|
|
FF_LDFLAGS := $(FFLDFLAGS)
|
|
|
|
FF_EXTRALIBS := $(FFEXTRALIBS)
|
2008-04-10 19:44:26 +00:00
|
|
|
FF_DEP_LIBS := $(DEP_LIBS)
|
2008-04-07 21:16:31 +00:00
|
|
|
|
2007-07-09 20:42:00 +00:00
|
|
|
ALL_TARGETS-$(CONFIG_VHOOK) += videohook
|
|
|
|
ALL_TARGETS-$(BUILD_DOC) += documentation
|
|
|
|
|
|
|
|
INSTALL_TARGETS-$(CONFIG_VHOOK) += install-vhook
|
2007-10-22 18:00:31 +00:00
|
|
|
ifneq ($(PROGS),)
|
|
|
|
INSTALL_TARGETS-yes += install-progs
|
2007-10-22 18:01:33 +00:00
|
|
|
INSTALL_TARGETS-$(BUILD_DOC) += install-man
|
2007-10-22 18:00:31 +00:00
|
|
|
endif
|
2008-03-28 03:07:55 +00:00
|
|
|
INSTALL_PROGS_TARGETS-$(BUILD_SHARED) = install-libs
|
2007-07-09 20:22:16 +00:00
|
|
|
|
2008-04-10 19:44:26 +00:00
|
|
|
all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
|
2008-03-26 09:22:43 +00:00
|
|
|
|
2008-03-29 11:33:58 +00:00
|
|
|
$(PROGS): %$(EXESUF): %_g$(EXESUF)
|
2008-03-26 09:22:43 +00:00
|
|
|
cp -p $< $@
|
|
|
|
$(STRIP) $@
|
|
|
|
|
2008-04-16 21:50:39 +00:00
|
|
|
SUBDIR_VARS := OBJS ASM_OBJS CPP_OBJS FFLIBS CLEANFILES DIRS TESTS
|
2008-03-28 03:13:21 +00:00
|
|
|
|
2008-04-07 21:16:31 +00:00
|
|
|
define RESET
|
|
|
|
$(1) :=
|
|
|
|
$(1)-yes :=
|
|
|
|
endef
|
2008-03-26 09:39:12 +00:00
|
|
|
|
2008-04-07 21:16:31 +00:00
|
|
|
define DOSUBDIR
|
|
|
|
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
|
|
|
|
SUBDIR := $(1)/
|
|
|
|
include $(1)/Makefile
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
|
2008-04-03 23:51:29 +00:00
|
|
|
|
2008-04-07 21:16:31 +00:00
|
|
|
ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
|
|
|
|
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2008-04-10 19:44:26 +00:00
|
|
|
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
|
2008-04-07 21:16:31 +00:00
|
|
|
$(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
|
2003-06-07 18:34:02 +00:00
|
|
|
|
2008-04-10 19:44:26 +00:00
|
|
|
output_example$(EXESUF): output_example.o $(FF_DEP_LIBS)
|
2008-04-07 21:16:31 +00:00
|
|
|
$(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
2003-07-22 12:46:15 +00:00
|
|
|
|
2008-01-26 18:41:20 +00:00
|
|
|
tools/%$(EXESUF): tools/%.c
|
2008-04-07 21:16:31 +00:00
|
|
|
$(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
2008-01-08 23:02:39 +00:00
|
|
|
|
2008-04-10 22:34:37 +00:00
|
|
|
ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
|
2006-09-12 23:13:22 +00:00
|
|
|
|
2008-04-07 22:17:42 +00:00
|
|
|
VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS))
|
|
|
|
|
|
|
|
BASEHOOKS = fish null watermark
|
|
|
|
ALLHOOKS = $(BASEHOOKS) drawtext imlib2 ppm
|
|
|
|
ALLHOOKS_SRCS = $(addprefix vhook/, $(addsuffix .c, $(ALLHOOKS)))
|
|
|
|
|
|
|
|
HOOKS-$(HAVE_FORK) += ppm
|
|
|
|
HOOKS-$(HAVE_IMLIB2) += imlib2
|
|
|
|
HOOKS-$(HAVE_FREETYPE2) += drawtext
|
|
|
|
|
|
|
|
HOOKS = $(addprefix vhook/, $(addsuffix $(SLIBSUF), $(BASEHOOKS) $(HOOKS-yes)))
|
|
|
|
|
|
|
|
VHOOKCFLAGS-$(HAVE_IMLIB2) += `imlib2-config --cflags`
|
|
|
|
LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs`
|
|
|
|
|
|
|
|
VHOOKCFLAGS-$(HAVE_FREETYPE2) += `freetype-config --cflags`
|
|
|
|
LIBS_drawtext$(SLIBSUF) = `freetype-config --libs`
|
|
|
|
|
|
|
|
VHOOKCFLAGS += $(VHOOKCFLAGS-yes)
|
|
|
|
|
2008-04-09 20:48:17 +00:00
|
|
|
vhook/%.o vhook/%.d: CFLAGS:=$(VHOOKCFLAGS)
|
2008-04-07 22:17:42 +00:00
|
|
|
|
2008-03-10 18:37:18 +00:00
|
|
|
# vhooks compile fine without libav*, but need them nonetheless.
|
2008-04-10 19:44:26 +00:00
|
|
|
videohook: $(FF_DEP_LIBS) $(HOOKS)
|
2007-07-08 15:16:25 +00:00
|
|
|
|
2008-04-10 19:44:29 +00:00
|
|
|
$(eval VHOOKSHFLAGS=$(VHOOKSHFLAGS))
|
2007-07-08 15:16:25 +00:00
|
|
|
vhook/%$(SLIBSUF): vhook/%.o
|
2007-07-08 17:47:15 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $(VHOOKSHFLAGS) $< $(VHOOKLIBS) $(LIBS_$(@F))
|
2007-07-08 15:16:25 +00:00
|
|
|
|
2008-04-09 20:48:17 +00:00
|
|
|
VHOOK_DEPS = $(HOOKS:$(SLIBSUF)=.d)
|
|
|
|
depend dep: $(VHOOK_DEPS)
|
2008-04-07 22:17:42 +00:00
|
|
|
|
2007-05-17 08:39:50 +00:00
|
|
|
documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
|
2007-08-28 06:22:57 +00:00
|
|
|
ffplay-doc.html general.html hooks.html \
|
|
|
|
$(ALLMANPAGES))
|
2007-05-17 08:39:50 +00:00
|
|
|
|
|
|
|
doc/%.html: doc/%.texi
|
|
|
|
texi2html -monolithic -number $<
|
|
|
|
mv $(@F) $@
|
|
|
|
|
|
|
|
doc/%.pod: doc/%-doc.texi
|
|
|
|
doc/texi2pod.pl $< $@
|
|
|
|
|
|
|
|
doc/%.1: doc/%.pod
|
|
|
|
pod2man --section=1 --center=" " --release=" " $< > $@
|
2004-07-05 18:06:16 +00:00
|
|
|
|
2008-03-28 01:49:01 +00:00
|
|
|
install: $(INSTALL_TARGETS-yes)
|
|
|
|
|
2008-03-28 01:58:53 +00:00
|
|
|
install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
|
2007-07-21 18:53:06 +00:00
|
|
|
install -d "$(BINDIR)"
|
|
|
|
install -c -m 755 $(PROGS) "$(BINDIR)"
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2008-04-07 21:45:38 +00:00
|
|
|
install-man: $(MANPAGES)
|
2007-07-21 18:53:06 +00:00
|
|
|
install -d "$(MANDIR)/man1"
|
|
|
|
install -m 644 $(MANPAGES) "$(MANDIR)/man1"
|
2003-08-24 16:02:39 +00:00
|
|
|
|
2007-07-08 15:16:25 +00:00
|
|
|
install-vhook: videohook
|
2007-07-21 18:53:06 +00:00
|
|
|
install -d "$(SHLIBDIR)/vhook"
|
|
|
|
install -m 755 $(HOOKS) "$(SHLIBDIR)/vhook"
|
2002-11-20 03:02:23 +00:00
|
|
|
|
2008-03-26 09:39:12 +00:00
|
|
|
uninstall: uninstall-progs uninstall-man uninstall-vhook
|
2006-05-18 12:14:02 +00:00
|
|
|
|
|
|
|
uninstall-progs:
|
2007-11-04 23:00:22 +00:00
|
|
|
rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
|
2006-05-18 12:14:02 +00:00
|
|
|
|
|
|
|
uninstall-man:
|
2007-11-04 23:00:22 +00:00
|
|
|
rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
|
2006-05-18 12:14:02 +00:00
|
|
|
|
|
|
|
uninstall-vhook:
|
2007-11-04 23:00:22 +00:00
|
|
|
rm -f $(addprefix "$(SHLIBDIR)/",$(ALLHOOKS_SRCS:.c=$(SLIBSUF)))
|
2007-07-21 18:53:06 +00:00
|
|
|
-rmdir "$(SHLIBDIR)/vhook/"
|
2006-05-18 12:14:02 +00:00
|
|
|
|
2008-03-26 09:39:12 +00:00
|
|
|
clean::
|
2008-05-27 00:45:45 +00:00
|
|
|
rm -f $(ALLPROGS) $(ALLPROGS_G) output_example$(EXESUF)
|
2007-05-17 08:39:50 +00:00
|
|
|
rm -f doc/*.html doc/*.pod doc/*.1
|
2007-06-07 22:36:39 +00:00
|
|
|
rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
|
|
|
|
rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
|
2008-01-26 13:43:40 +00:00
|
|
|
rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
|
2007-07-08 15:16:25 +00:00
|
|
|
rm -f vhook/*.o vhook/*~ vhook/*.so vhook/*.dylib vhook/*.dll
|
2002-11-20 03:02:23 +00:00
|
|
|
|
2008-03-26 09:39:12 +00:00
|
|
|
distclean::
|
2008-06-16 18:01:55 +00:00
|
|
|
rm -f version.h config.* vhook/*.d
|
2001-07-22 14:37:44 +00:00
|
|
|
|
2002-05-18 23:11:25 +00:00
|
|
|
# regression tests
|
|
|
|
|
2007-06-07 22:36:39 +00:00
|
|
|
fulltest test: codectest libavtest seektest
|
|
|
|
|
|
|
|
FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
|
|
|
|
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
|
|
|
|
LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
|
|
|
|
ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
|
|
|
|
SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
|
|
|
|
|
2008-02-03 19:26:26 +00:00
|
|
|
CODEC_TESTS = $(addprefix regtest-, \
|
|
|
|
mpeg \
|
|
|
|
mpeg2 \
|
|
|
|
mpeg2thread \
|
|
|
|
msmpeg4v2 \
|
|
|
|
msmpeg4 \
|
|
|
|
wmv1 \
|
|
|
|
wmv2 \
|
|
|
|
h261 \
|
|
|
|
h263 \
|
|
|
|
h263p \
|
|
|
|
mpeg4 \
|
|
|
|
huffyuv \
|
|
|
|
rc \
|
|
|
|
mpeg4adv \
|
|
|
|
mpeg4thread \
|
|
|
|
error \
|
|
|
|
mpeg4nr \
|
|
|
|
mpeg1b \
|
|
|
|
mjpeg \
|
|
|
|
ljpeg \
|
|
|
|
jpegls \
|
|
|
|
rv10 \
|
|
|
|
rv20 \
|
|
|
|
asv1 \
|
|
|
|
asv2 \
|
|
|
|
flv \
|
|
|
|
ffv1 \
|
|
|
|
snow \
|
|
|
|
snowll \
|
|
|
|
dv \
|
|
|
|
dv50 \
|
|
|
|
svq1 \
|
|
|
|
flashsv \
|
|
|
|
mp2 \
|
|
|
|
ac3 \
|
|
|
|
g726 \
|
|
|
|
adpcm_ima_wav \
|
2008-03-06 07:30:41 +00:00
|
|
|
adpcm_ima_qt \
|
2008-02-03 19:26:26 +00:00
|
|
|
adpcm_ms \
|
|
|
|
adpcm_yam \
|
|
|
|
adpcm_swf \
|
|
|
|
flac \
|
|
|
|
wma \
|
2008-08-08 23:31:43 +00:00
|
|
|
pcm \
|
2008-02-03 19:26:26 +00:00
|
|
|
)
|
|
|
|
|
2008-02-03 19:26:29 +00:00
|
|
|
LAVF_TESTS = $(addprefix regtest-, \
|
|
|
|
avi \
|
|
|
|
asf \
|
|
|
|
rm \
|
|
|
|
mpg \
|
|
|
|
ts \
|
|
|
|
swf \
|
|
|
|
ffm \
|
|
|
|
flv_fmt \
|
|
|
|
mov \
|
|
|
|
dv_fmt \
|
|
|
|
gxf \
|
|
|
|
nut \
|
|
|
|
mkv \
|
|
|
|
pbmpipe \
|
|
|
|
pgmpipe \
|
|
|
|
ppmpipe \
|
|
|
|
gif \
|
|
|
|
yuv4mpeg \
|
|
|
|
pgm \
|
|
|
|
ppm \
|
|
|
|
bmp \
|
|
|
|
tga \
|
|
|
|
tiff \
|
|
|
|
sgi \
|
|
|
|
jpg \
|
|
|
|
wav \
|
|
|
|
alaw \
|
|
|
|
mulaw \
|
|
|
|
au \
|
|
|
|
mmf \
|
|
|
|
aiff \
|
|
|
|
voc \
|
|
|
|
ogg \
|
|
|
|
pixfmt \
|
|
|
|
)
|
2008-02-03 19:26:26 +00:00
|
|
|
|
|
|
|
REGFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
|
|
|
|
|
|
|
|
CODEC_ROTOZOOM = $(call REGFILES,rotozoom.regression,$(CODEC_TESTS))
|
|
|
|
CODEC_VSYNTH = $(call REGFILES,vsynth.regression,$(CODEC_TESTS))
|
|
|
|
|
|
|
|
LAVF_REGFILES = $(call REGFILES,lavf.regression,$(LAVF_TESTS))
|
|
|
|
|
|
|
|
LAVF_REG = tests/data/lavf.regression
|
|
|
|
ROTOZOOM_REG = tests/data/rotozoom.regression
|
|
|
|
VSYNTH_REG = tests/data/vsynth.regression
|
|
|
|
|
2008-07-17 09:30:48 +00:00
|
|
|
ifeq ($(CONFIG_SWSCALE),yes)
|
|
|
|
servertest codectest $(CODEC_TESTS) libavtest: swscale_error
|
|
|
|
swscale_error:
|
|
|
|
@echo
|
|
|
|
@echo "This regression test is incompatible with --enable-swscale."
|
|
|
|
@echo
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
|
2008-02-03 19:26:26 +00:00
|
|
|
codectest: $(VSYNTH_REG) $(ROTOZOOM_REG)
|
2008-02-23 13:15:24 +00:00
|
|
|
diff -u -w $(FFMPEG_REFFILE) $(VSYNTH_REG)
|
|
|
|
diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_REG)
|
2008-02-03 19:26:26 +00:00
|
|
|
|
|
|
|
libavtest: $(LAVF_REG)
|
|
|
|
diff -u -w $(LIBAV_REFFILE) $(LAVF_REG)
|
|
|
|
|
|
|
|
$(VSYNTH_REG) $(ROTOZOOM_REG) $(LAVF_REG):
|
|
|
|
cat $^ > $@
|
|
|
|
|
|
|
|
$(LAVF_REG): $(LAVF_REGFILES)
|
|
|
|
$(ROTOZOOM_REG): $(CODEC_ROTOZOOM)
|
|
|
|
$(VSYNTH_REG): $(CODEC_VSYNTH)
|
|
|
|
|
|
|
|
$(CODEC_VSYNTH) $(CODEC_ROTOZOOM): $(CODEC_TESTS)
|
|
|
|
|
|
|
|
$(LAVF_REGFILES): $(LAVF_TESTS)
|
|
|
|
|
|
|
|
$(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
|
|
|
|
|
|
|
|
regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw
|
|
|
|
|
|
|
|
$(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(EXESUF)
|
2008-02-03 19:26:29 +00:00
|
|
|
$(SRC_PATH)/tests/regression.sh $@ vsynth tests/vsynth1 a
|
|
|
|
$(SRC_PATH)/tests/regression.sh $@ rotozoom tests/vsynth2 a
|
2008-02-03 19:26:26 +00:00
|
|
|
|
|
|
|
$(LAVF_TESTS):
|
2008-02-03 19:26:29 +00:00
|
|
|
$(SRC_PATH)/tests/regression.sh $@ lavf tests/vsynth1 b
|
2008-02-03 19:26:26 +00:00
|
|
|
|
|
|
|
seektest: codectest libavtest tests/seek_test$(EXESUF)
|
|
|
|
$(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE)
|
|
|
|
|
2008-05-27 00:26:43 +00:00
|
|
|
servertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
|
2007-06-07 22:36:39 +00:00
|
|
|
@echo
|
|
|
|
@echo "Unfortunately ffserver is broken and therefore its regression"
|
|
|
|
@echo "test fails randomly. Treat the results accordingly."
|
|
|
|
@echo
|
|
|
|
$(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
|
|
|
|
|
|
|
|
tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
|
|
|
|
mkdir -p tests/vsynth1
|
|
|
|
$(BUILD_ROOT)/$< 'tests/vsynth1/'
|
|
|
|
|
|
|
|
tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
|
|
|
|
mkdir -p tests/vsynth2
|
|
|
|
$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
|
|
|
|
|
|
|
|
tests/asynth1.sw: tests/audiogen$(EXESUF)
|
|
|
|
$(BUILD_ROOT)/$< $@
|
|
|
|
|
|
|
|
%$(EXESUF): %.c
|
2008-04-07 21:16:31 +00:00
|
|
|
$(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $<
|
2007-06-07 22:36:39 +00:00
|
|
|
|
2008-04-10 19:44:26 +00:00
|
|
|
tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS)
|
2008-04-07 21:16:31 +00:00
|
|
|
$(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
2007-06-07 22:36:39 +00:00
|
|
|
|
2002-05-18 23:11:25 +00:00
|
|
|
|
2008-05-27 00:38:35 +00:00
|
|
|
.PHONY: lib videohook documentation *test regtest-* swscale-error
|
2003-03-12 18:38:18 +00:00
|
|
|
|
2008-04-09 20:48:17 +00:00
|
|
|
-include $(VHOOK_DEPS)
|