Statistics
| Branch: | Revision:

ffmpeg / Makefile @ c7094831

History | View | Annotate | Download (11.1 KB)

1 bde51e6a Justin Ruggles
include config.mak
2
3
SRC_DIR = $(SRC_PATH_BARE)
4
5
vpath %.texi $(SRC_PATH_BARE)
6
7
PROGS-$(CONFIG_FFMPEG)   += ffmpeg
8
PROGS-$(CONFIG_FFPLAY)   += ffplay
9 336ce917 Stefano Sabatini
PROGS-$(CONFIG_FFPROBE)  += ffprobe
10 bde51e6a Justin Ruggles
PROGS-$(CONFIG_FFSERVER) += ffserver
11
12 00962aba Måns Rullgård
PROGS      := $(addsuffix   $(EXESUF), $(PROGS-yes))
13 bde51e6a Justin Ruggles
PROGS_G     = $(addsuffix _g$(EXESUF), $(PROGS-yes))
14
OBJS        = $(addsuffix .o,          $(PROGS-yes)) cmdutils.o
15
MANPAGES    = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
16 94f3c0e5 Diego Biurrun
TOOLS       = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
17 de4070b5 Måns Rullgård
HOSTPROGS   = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
18 bde51e6a Justin Ruggles
19 336ce917 Stefano Sabatini
BASENAMES   = ffmpeg ffplay ffprobe ffserver
20 bde51e6a Justin Ruggles
ALLPROGS    = $(addsuffix   $(EXESUF), $(BASENAMES))
21
ALLPROGS_G  = $(addsuffix _g$(EXESUF), $(BASENAMES))
22
ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
23
24 5a0f7131 Måns Rullgård
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
25 bde51e6a Justin Ruggles
FFLIBS-$(CONFIG_AVFILTER) += avfilter
26 5a0f7131 Måns Rullgård
FFLIBS-$(CONFIG_AVFORMAT) += avformat
27 97d5fa38 Måns Rullgård
FFLIBS-$(CONFIG_AVCODEC)  += avcodec
28 bde51e6a Justin Ruggles
FFLIBS-$(CONFIG_POSTPROC) += postproc
29 5a0f7131 Måns Rullgård
FFLIBS-$(CONFIG_SWSCALE)  += swscale
30 bde51e6a Justin Ruggles
31 5a0f7131 Måns Rullgård
FFLIBS := avutil
32 bde51e6a Justin Ruggles
33 a1a84f69 Robert Swain
DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
34
35 bde51e6a Justin Ruggles
include common.mak
36
37
FF_LDFLAGS   := $(FFLDFLAGS)
38
FF_EXTRALIBS := $(FFEXTRALIBS)
39
FF_DEP_LIBS  := $(DEP_LIBS)
40
41 c73f65d9 Måns Rullgård
ALL_TARGETS-$(CONFIG_DOC)       += documentation
42 bde51e6a Justin Ruggles
43 a48289c7 Måns Rullgård
ifdef PROGS
44 a1a84f69 Robert Swain
INSTALL_TARGETS-yes             += install-progs install-data
45 c73f65d9 Måns Rullgård
INSTALL_TARGETS-$(CONFIG_DOC)   += install-man
46 bde51e6a Justin Ruggles
endif
47 bea81a52 Måns Rullgård
INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
48 bde51e6a Justin Ruggles
49
all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
50
51
$(PROGS): %$(EXESUF): %_g$(EXESUF)
52 4335125c Måns Rullgård
	$(CP) $< $@
53 bde51e6a Justin Ruggles
	$(STRIP) $@
54
55 95f2c769 Måns Rullgård
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
56 de4070b5 Måns Rullgård
               ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
57 aa310a9f Måns Rullgård
               HOSTPROGS BUILT_HEADERS
58 bde51e6a Justin Ruggles
59
define RESET
60
$(1) :=
61
$(1)-yes :=
62
endef
63
64
define DOSUBDIR
65
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
66
SUBDIR := $(1)/
67
include $(1)/Makefile
68
endef
69
70
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
71
72
ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
73
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
74
75
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
76 684b28e0 Måns Rullgård
	$(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
77 bde51e6a Justin Ruggles
78 2dfa3054 Måns Rullgård
tools/%$(EXESUF): tools/%.o
79
	$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
80
81 2205da0d Diego Biurrun
tools/%.o: tools/%.c
82 2dfa3054 Måns Rullgård
	$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
83 bde51e6a Justin Ruggles
84
ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
85
86 36798f1b Måns Rullgård
cmdutils.o cmdutils.d: version.h
87
88 13b1c80b Diego Biurrun
alltools: $(TOOLS)
89 9bce82fa Diego Biurrun
90 15674f12 Diego Biurrun
documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html \
91 336ce917 Stefano Sabatini
                                 ffplay-doc.html ffprobe-doc.html ffserver-doc.html \
92 dba755fa Stefano Sabatini
                                 general.html libavfilter.html $(ALLMANPAGES))
93 bde51e6a Justin Ruggles
94
doc/%.html: doc/%.texi
95
	texi2html -monolithic -number $<
96
	mv $(@F) $@
97
98
doc/%.pod: doc/%-doc.texi
99
	doc/texi2pod.pl $< $@
100
101
doc/%.1: doc/%.pod
102
	pod2man --section=1 --center=" " --release=" " $< > $@
103
104
install: $(INSTALL_TARGETS-yes)
105
106
install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
107 63611f31 Måns Rullgård
	$(Q)mkdir -p "$(BINDIR)"
108 fd676deb Måns Rullgård
	$(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
109 bde51e6a Justin Ruggles
110 a1a84f69 Robert Swain
install-data: $(DATA_FILES)
111 63611f31 Måns Rullgård
	$(Q)mkdir -p "$(DATADIR)"
112 fd676deb Måns Rullgård
	$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
113 a1a84f69 Robert Swain
114 bde51e6a Justin Ruggles
install-man: $(MANPAGES)
115 63611f31 Måns Rullgård
	$(Q)mkdir -p "$(MANDIR)/man1"
116 fd676deb Måns Rullgård
	$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
117 bde51e6a Justin Ruggles
118 d3cb93b3 Ramiro Polla
uninstall: uninstall-progs uninstall-data uninstall-man
119
120
uninstall-progs:
121 50e10cbd Måns Rullgård
	$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
122 d3cb93b3 Ramiro Polla
123
uninstall-data:
124 50e10cbd Måns Rullgård
	$(RM) -r "$(DATADIR)"
125 d3cb93b3 Ramiro Polla
126
uninstall-man:
127 50e10cbd Måns Rullgård
	$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
128 bde51e6a Justin Ruggles
129 250dd6f0 Francesco Cosoleto
testclean:
130 50e10cbd Måns Rullgård
	$(RM) -r tests/vsynth1 tests/vsynth2 tests/data
131
	$(RM) $(addprefix tests/,$(CLEANSUFFIXES))
132
	$(RM) tests/seek_test$(EXESUF) tests/seek_test.o
133
	$(RM) $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
134 250dd6f0 Francesco Cosoleto
135
clean:: testclean
136 50e10cbd Måns Rullgård
	$(RM) $(ALLPROGS) $(ALLPROGS_G)
137
	$(RM) $(CLEANSUFFIXES)
138
	$(RM) doc/*.html doc/*.pod doc/*.1
139
	$(RM) $(TOOLS)
140 bde51e6a Justin Ruggles
141
distclean::
142 50e10cbd Måns Rullgård
	$(RM) $(DISTCLEANSUFFIXES)
143
	$(RM) version.h config.* libavutil/avconfig.h
144 bde51e6a Justin Ruggles
145 0c3b2d65 Måns Rullgård
config:
146
	$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
147
148 bde51e6a Justin Ruggles
# regression tests
149
150 5bab8536 Diego Biurrun
check: test checkheaders
151
152 1cde611d Diego Biurrun
fulltest test: codectest lavftest seektest
153 bde51e6a Justin Ruggles
154
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
155
SEEK_REFFILE     = $(SRC_PATH)/tests/seek.regression.ref
156
157 05e24fa8 Måns Rullgård
ENCDEC = $(and $(CONFIG_$(1)_ENCODER),$(CONFIG_$(1)_DECODER))
158
MUXDEM = $(and $(CONFIG_$(1)_MUXER),$(CONFIG_$(or $(2),$(1))_DEMUXER))
159
160 c676895f Måns Rullgård
VCODEC_TESTS =
161
VCODEC_TESTS-$(call ENCDEC,ASV1)             += asv1
162
VCODEC_TESTS-$(call ENCDEC,ASV2)             += asv2
163
VCODEC_TESTS-$(call ENCDEC,DNXHD)            += dnxhd_1080i dnxhd_720p dnxhd_720p_rd
164
VCODEC_TESTS-$(call ENCDEC,DVVIDEO)          += dv dv50
165
VCODEC_TESTS-$(call ENCDEC,FFV1)             += ffv1
166
VCODEC_TESTS-$(call ENCDEC,FLASHSV)          += flashsv
167
VCODEC_TESTS-$(call ENCDEC,FLV)              += flv
168
VCODEC_TESTS-$(call ENCDEC,H261)             += h261
169
VCODEC_TESTS-$(call ENCDEC,H263)             += h263 h263p
170
VCODEC_TESTS-$(call ENCDEC,HUFFYUV)          += huffyuv
171
VCODEC_TESTS-$(call ENCDEC,JPEGLS)           += jpegls
172
VCODEC_TESTS-$(call ENCDEC,MJPEG)            += mjpeg ljpeg
173
VCODEC_TESTS-$(call ENCDEC,MPEG1VIDEO)       += mpeg mpeg1b
174
VCODEC_TESTS-$(call ENCDEC,MPEG2VIDEO)       += mpeg2 mpeg2thread
175
VCODEC_TESTS-$(call ENCDEC,MPEG4)            += mpeg4 mpeg4adv mpeg4nr mpeg4thread error rc
176
VCODEC_TESTS-$(call ENCDEC,MSMPEG4V1)        += msmpeg4
177
VCODEC_TESTS-$(call ENCDEC,MSMPEG4V2)        += msmpeg4v2
178
VCODEC_TESTS-$(call ENCDEC,ROQ)              += roq
179
VCODEC_TESTS-$(call ENCDEC,RV10)             += rv10
180
VCODEC_TESTS-$(call ENCDEC,RV20)             += rv20
181
VCODEC_TESTS-$(call ENCDEC,SNOW)             += snow snowll
182
VCODEC_TESTS-$(call ENCDEC,SVQ1)             += svq1
183
VCODEC_TESTS-$(call ENCDEC,WMV1)             += wmv1
184
VCODEC_TESTS-$(call ENCDEC,WMV2)             += wmv2
185
186
ACODEC_TESTS =
187
ACODEC_TESTS-$(call ENCDEC,AC3)              += ac3
188
ACODEC_TESTS-$(call ENCDEC,ADPCM_G726)       += g726
189
ACODEC_TESTS-$(call ENCDEC,ADPCM_IMA_QT)     += adpcm_ima_qt
190
ACODEC_TESTS-$(call ENCDEC,ADPCM_IMA_WAV)    += adpcm_ima_wav
191
ACODEC_TESTS-$(call ENCDEC,ADPCM_MS)         += adpcm_ms
192
ACODEC_TESTS-$(call ENCDEC,ADPCM_SWF)        += adpcm_swf
193
ACODEC_TESTS-$(call ENCDEC,ADPCM_YAMAHA)     += adpcm_yam
194
ACODEC_TESTS-$(call ENCDEC,ALAC)             += alac
195
ACODEC_TESTS-$(call ENCDEC,FLAC)             += flac
196
ACODEC_TESTS-$(call ENCDEC,MP2)              += mp2
197
ACODEC_TESTS-$(call ENCDEC,PCM_S16LE)        += pcm         # fixme
198
ACODEC_TESTS-$(call ENCDEC,WMAV1)            += wmav1
199
ACODEC_TESTS-$(call ENCDEC,WMAV1)            += wmav2
200 05e24fa8 Måns Rullgård
201
LAVF_TESTS =
202
LAVF_TESTS-$(call MUXDEM,AIFF)               += aiff
203
LAVF_TESTS-$(call MUXDEM,PCM_ALAW)           += alaw
204
LAVF_TESTS-$(call MUXDEM,ASF)                += asf
205
LAVF_TESTS-$(call MUXDEM,AU)                 += au
206
LAVF_TESTS-$(call MUXDEM,AVI)                += avi
207
LAVF_TESTS-$(call ENCDEC,BMP)                += bmp
208
LAVF_TESTS-$(call MUXDEM,DV)                 += dv_fmt
209
LAVF_TESTS-$(call MUXDEM,FFM)                += ffm
210
LAVF_TESTS-$(call MUXDEM,FLV)                += flv_fmt
211
LAVF_TESTS-$(call ENCDEC,GIF)                += gif
212
LAVF_TESTS-$(call MUXDEM,GXF)                += gxf
213
LAVF_TESTS-$(call ENCDEC,MJPEG)              += jpg
214
LAVF_TESTS-$(call MUXDEM,MATROSKA)           += mkv
215
LAVF_TESTS-$(call MUXDEM,MMF)                += mmf
216
LAVF_TESTS-$(call MUXDEM,MOV)                += mov
217
LAVF_TESTS-$(call MUXDEM,MPEG1SYSTEM,MPEGPS) += mpg
218
LAVF_TESTS-$(call MUXDEM,PCM_MULAW)          += mulaw
219
LAVF_TESTS-$(call MUXDEM,MXF)                += mxf
220
LAVF_TESTS-$(call MUXDEM,NUT)                += nut
221
LAVF_TESTS-$(call MUXDEM,OGG)                += ogg
222
LAVF_TESTS-$(call ENCDEC,PBM)                += pbmpipe
223
LAVF_TESTS-$(call ENCDEC,PCX)                += pcx
224
LAVF_TESTS-$(call ENCDEC,PGM)                += pgm pgmpipe
225
LAVF_TESTS-$(call MUXDEM,RAWVIDEO)           += pixfmt
226
LAVF_TESTS-$(call ENCDEC,PPM)                += ppm ppmpipe
227
LAVF_TESTS-$(call MUXDEM,RM)                 += rm
228
LAVF_TESTS-$(call ENCDEC,SGI)                += sgi
229
LAVF_TESTS-$(call MUXDEM,SWF)                += swf
230
LAVF_TESTS-$(call ENCDEC,TARGA)              += tga
231
LAVF_TESTS-$(call ENCDEC,TIFF)               += tiff
232
LAVF_TESTS-$(call MUXDEM,MPEGTS)             += ts
233
LAVF_TESTS-$(call MUXDEM,VOC)                += voc
234
LAVF_TESTS-$(call MUXDEM,WAV)                += wav
235
LAVF_TESTS-$(call MUXDEM,YUV4MPEGPIPE)       += yuv4mpeg
236
237
LAVFI_TESTS =
238
239 c676895f Måns Rullgård
ACODEC_TESTS := $(addprefix regtest-, $(ACODEC_TESTS) $(ACODEC_TESTS-yes))
240
VCODEC_TESTS := $(addprefix regtest-, $(VCODEC_TESTS) $(VCODEC_TESTS-yes))
241 05e24fa8 Måns Rullgård
LAVF_TESTS  := $(addprefix regtest-, $(LAVF_TESTS)  $(LAVF_TESTS-yes))
242
LAVFI_TESTS := $(addprefix regtest-, $(LAVFI_TESTS) $(LAVFI_TESTS-yes))
243 20a93972 Diego Biurrun
244 c676895f Måns Rullgård
CODEC_TESTS = $(VCODEC_TESTS) $(ACODEC_TESTS)
245
246 eca478c3 Måns Rullgård
codectest: $(CODEC_TESTS)
247
lavftest:  $(LAVF_TESTS)
248 bde51e6a Justin Ruggles
249 eca478c3 Måns Rullgård
# lavfitest: $(LAVFI_TESTS)
250 40e02409 Stefano Sabatini
251 c676895f Måns Rullgård
$(ACODEC_TESTS): regtest-aref
252
$(VCODEC_TESTS): regtest-vref
253
$(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref
254 bde51e6a Justin Ruggles
255 eca478c3 Måns Rullgård
REFFILE = $(SRC_PATH)/tests/ref/$(1)/$(2:regtest-%=%)
256
RESFILE = tests/data/$(2:regtest-%=%).$(1).regression
257 bde51e6a Justin Ruggles
258 eca478c3 Måns Rullgård
define CODECTEST_CMD
259 801b571e Måns Rullgård
	$(SRC_PATH)/tests/codec-regression.sh $@ vsynth1 tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
260
	$(SRC_PATH)/tests/codec-regression.sh $@ vsynth2 tests/vsynth2 "$(TARGET_EXEC)" "$(TARGET_PATH)"
261 eca478c3 Måns Rullgård
endef
262 bde51e6a Justin Ruggles
263 c676895f Måns Rullgård
regtest-ref: regtest-aref regtest-vref
264
265
regtest-vref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
266 eca478c3 Måns Rullgård
	$(CODECTEST_CMD)
267 bde51e6a Justin Ruggles
268 c676895f Måns Rullgård
regtest-aref: ffmpeg$(EXESUF) tests/data/asynth1.sw
269 801b571e Måns Rullgård
	@$(SRC_PATH)/tests/codec-regression.sh $@ acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
270 c676895f Måns Rullgård
271
$(VCODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
272
	@echo "TEST VCODEC $(@:regtest-%=%)"
273 eca478c3 Måns Rullgård
	@$(CODECTEST_CMD)
274
	@diff -u -w $(call REFFILE,vsynth1,$@) $(call RESFILE,vsynth1,$@)
275
	@diff -u -w $(call REFFILE,vsynth2,$@) $(call RESFILE,vsynth2,$@)
276 bde51e6a Justin Ruggles
277 c676895f Måns Rullgård
$(ACODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
278
	@echo "TEST ACODEC $(@:regtest-%=%)"
279 801b571e Måns Rullgård
	@$(SRC_PATH)/tests/codec-regression.sh $@ acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
280 c676895f Måns Rullgård
	@diff -u -w $(call REFFILE,acodec,$@) $(call RESFILE,acodec,$@)
281
282 bde51e6a Justin Ruggles
$(LAVF_TESTS):
283 eca478c3 Måns Rullgård
	@echo "TEST LAVF  $(@:regtest-%=%)"
284 801b571e Måns Rullgård
	@$(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
285 eca478c3 Måns Rullgård
	@diff -u -w $(call REFFILE,lavf,$@) $(call RESFILE,lavf,$@)
286 bde51e6a Justin Ruggles
287 40e02409 Stefano Sabatini
$(LAVFI_TESTS):
288 eca478c3 Måns Rullgård
	@echo "TEST LAVFI $(@:regtest-%=%)"
289 801b571e Måns Rullgård
	@$(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
290 eca478c3 Måns Rullgård
	@diff -u -w $(call REFFILE,lavfi,$@) $(call RESFILE,lavfi,$@)
291 40e02409 Stefano Sabatini
292 1cde611d Diego Biurrun
seektest: codectest lavftest tests/seek_test$(EXESUF)
293 d7096d6f Måns Rullgård
	$(SRC_PATH)/tests/seek-regression.sh $(SRC_PATH) "$(TARGET_EXEC)" "$(TARGET_PATH)"
294 bde51e6a Justin Ruggles
295 d7167f05 Diego Biurrun
ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
296 bde51e6a Justin Ruggles
	@echo
297
	@echo "Unfortunately ffserver is broken and therefore its regression"
298
	@echo "test fails randomly. Treat the results accordingly."
299
	@echo
300 767e14c3 Diego Biurrun
	$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
301 bde51e6a Justin Ruggles
302 82bb3329 Måns Rullgård
tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
303 bde51e6a Justin Ruggles
	mkdir -p tests/vsynth1
304
	$(BUILD_ROOT)/$< 'tests/vsynth1/'
305
306 82bb3329 Måns Rullgård
tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
307 bde51e6a Justin Ruggles
	mkdir -p tests/vsynth2
308
	$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
309
310 d7167f05 Diego Biurrun
tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
311
	mkdir -p tests/data
312 bde51e6a Justin Ruggles
	$(BUILD_ROOT)/$< $@
313
314 684b28e0 Måns Rullgård
tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
315
	$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
316 bde51e6a Justin Ruggles
317
318 0c3b2d65 Måns Rullgård
.PHONY: documentation *test regtest-* zlib-error alltools check config