Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 5f6cb6eb

History | View | Annotate | Download (11.3 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
PROGS-$(CONFIG_FFSERVER) += ffserver
10
11 00962aba Måns Rullgård
PROGS      := $(addsuffix   $(EXESUF), $(PROGS-yes))
12 bde51e6a Justin Ruggles
PROGS_G     = $(addsuffix _g$(EXESUF), $(PROGS-yes))
13
OBJS        = $(addsuffix .o,          $(PROGS-yes)) cmdutils.o
14
MANPAGES    = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
15 94f3c0e5 Diego Biurrun
TOOLS       = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
16 de4070b5 Måns Rullgård
HOSTPROGS   = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
17 bde51e6a Justin Ruggles
18
BASENAMES   = ffmpeg ffplay ffserver
19
ALLPROGS    = $(addsuffix   $(EXESUF), $(BASENAMES))
20
ALLPROGS_G  = $(addsuffix _g$(EXESUF), $(BASENAMES))
21
ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
22
23
FFLIBS-$(CONFIG_AVFILTER) += avfilter
24
FFLIBS-$(CONFIG_POSTPROC) += postproc
25
26 6d4f53cb Michael Niedermayer
FFLIBS := avdevice avformat avcodec avutil swscale
27 bde51e6a Justin Ruggles
28 a1a84f69 Robert Swain
DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
29
30 bde51e6a Justin Ruggles
include common.mak
31
32
FF_LDFLAGS   := $(FFLDFLAGS)
33
FF_EXTRALIBS := $(FFEXTRALIBS)
34
FF_DEP_LIBS  := $(DEP_LIBS)
35
36 c73f65d9 Måns Rullgård
ALL_TARGETS-$(CONFIG_DOC)       += documentation
37 bde51e6a Justin Ruggles
38 a48289c7 Måns Rullgård
ifdef PROGS
39 a1a84f69 Robert Swain
INSTALL_TARGETS-yes             += install-progs install-data
40 c73f65d9 Måns Rullgård
INSTALL_TARGETS-$(CONFIG_DOC)   += install-man
41 bde51e6a Justin Ruggles
endif
42 bea81a52 Måns Rullgård
INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
43 bde51e6a Justin Ruggles
44
all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
45
46
$(PROGS): %$(EXESUF): %_g$(EXESUF)
47
	cp -p $< $@
48
	$(STRIP) $@
49
50 95f2c769 Måns Rullgård
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
51 de4070b5 Måns Rullgård
               ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
52
               HOSTPROGS
53 bde51e6a Justin Ruggles
54
define RESET
55
$(1) :=
56
$(1)-yes :=
57
endef
58
59
define DOSUBDIR
60
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
61
SUBDIR := $(1)/
62
include $(1)/Makefile
63
endef
64
65
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
66
67
ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
68
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
69
70
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
71 684b28e0 Måns Rullgård
	$(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
72 bde51e6a Justin Ruggles
73 2dfa3054 Måns Rullgård
tools/%$(EXESUF): tools/%.o
74
	$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
75
76 2205da0d Diego Biurrun
tools/%.o: tools/%.c
77 2dfa3054 Måns Rullgård
	$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
78 bde51e6a Justin Ruggles
79
ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
80
81 36798f1b Måns Rullgård
cmdutils.o cmdutils.d: version.h
82
83 13b1c80b Diego Biurrun
alltools: $(TOOLS)
84 9bce82fa Diego Biurrun
85 15674f12 Diego Biurrun
documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html \
86
                                 ffplay-doc.html ffserver-doc.html       \
87 dba755fa Stefano Sabatini
                                 general.html libavfilter.html $(ALLMANPAGES))
88 bde51e6a Justin Ruggles
89
doc/%.html: doc/%.texi
90
	texi2html -monolithic -number $<
91
	mv $(@F) $@
92
93
doc/%.pod: doc/%-doc.texi
94
	doc/texi2pod.pl $< $@
95
96
doc/%.1: doc/%.pod
97
	pod2man --section=1 --center=" " --release=" " $< > $@
98
99
install: $(INSTALL_TARGETS-yes)
100
101
install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
102
	install -d "$(BINDIR)"
103
	install -c -m 755 $(PROGS) "$(BINDIR)"
104
105 a1a84f69 Robert Swain
install-data: $(DATA_FILES)
106
	install -d "$(DATADIR)"
107
	install -m 644 $(DATA_FILES) "$(DATADIR)"
108
109 bde51e6a Justin Ruggles
install-man: $(MANPAGES)
110
	install -d "$(MANDIR)/man1"
111
	install -m 644 $(MANPAGES) "$(MANDIR)/man1"
112
113 fdf11906 Diego Biurrun
uninstall: uninstall-progs uninstall-data uninstall-man
114 bde51e6a Justin Ruggles
115
uninstall-progs:
116
	rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
117
118 a1a84f69 Robert Swain
uninstall-data:
119
	rm -rf "$(DATADIR)"
120
121 bde51e6a Justin Ruggles
uninstall-man:
122
	rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
123
124 250dd6f0 Francesco Cosoleto
testclean:
125 d7167f05 Diego Biurrun
	rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/*~
126 250dd6f0 Francesco Cosoleto
127
clean:: testclean
128 219a7185 Diego Biurrun
	rm -f $(ALLPROGS) $(ALLPROGS_G)
129 2b7a351e Dave Yeo
	rm -f $(CLEANSUFFIXES)
130 bde51e6a Justin Ruggles
	rm -f doc/*.html doc/*.pod doc/*.1
131 4e67aedd Diego Biurrun
	rm -f tests/seek_test$(EXESUF) tests/seek_test.o
132 82bb3329 Måns Rullgård
	rm -f $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
133 13b1c80b Diego Biurrun
	rm -f $(TOOLS)
134 bde51e6a Justin Ruggles
135
distclean::
136 2b7a351e Dave Yeo
	rm -f $(DISTCLEANSUFFIXES)
137 fdf11906 Diego Biurrun
	rm -f version.h config.*
138 bde51e6a Justin Ruggles
139 0c3b2d65 Måns Rullgård
config:
140
	$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
141
142 bde51e6a Justin Ruggles
# regression tests
143
144 5bab8536 Diego Biurrun
check: test checkheaders
145
146 1cde611d Diego Biurrun
fulltest test: codectest lavftest seektest
147 bde51e6a Justin Ruggles
148
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
149 f1f66d3a Diego Biurrun
LAVF_REFFILE     = $(SRC_PATH)/tests/lavf.regression.ref
150 40e02409 Stefano Sabatini
LAVFI_REFFILE    = $(SRC_PATH)/tests/lavfi.regression.ref
151 bde51e6a Justin Ruggles
ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
152
SEEK_REFFILE     = $(SRC_PATH)/tests/seek.regression.ref
153 97668ac7 Stefano Sabatini
VSYNTH_REFFILE   = $(SRC_PATH)/tests/vsynth.regression.ref
154 bde51e6a Justin Ruggles
155
CODEC_TESTS = $(addprefix regtest-,             \
156
        mpeg                                    \
157
        mpeg2                                   \
158
        mpeg2thread                             \
159
        msmpeg4v2                               \
160
        msmpeg4                                 \
161
        wmv1                                    \
162
        wmv2                                    \
163
        h261                                    \
164
        h263                                    \
165
        h263p                                   \
166
        mpeg4                                   \
167
        huffyuv                                 \
168
        rc                                      \
169
        mpeg4adv                                \
170
        mpeg4thread                             \
171
        error                                   \
172
        mpeg4nr                                 \
173
        mpeg1b                                  \
174
        mjpeg                                   \
175
        ljpeg                                   \
176
        jpegls                                  \
177
        rv10                                    \
178
        rv20                                    \
179
        asv1                                    \
180
        asv2                                    \
181
        flv                                     \
182
        ffv1                                    \
183
        snow                                    \
184
        snowll                                  \
185
        dv                                      \
186
        dv50                                    \
187 96fdb624 Måns Rullgård
        dnxhd_1080i                             \
188
        dnxhd_720p                              \
189
        dnxhd_720p_rd                           \
190 bde51e6a Justin Ruggles
        svq1                                    \
191
        flashsv                                 \
192 ae5e8caa Reimar Döffinger
        roq                                     \
193 bde51e6a Justin Ruggles
        mp2                                     \
194
        ac3                                     \
195
        g726                                    \
196
        adpcm_ima_wav                           \
197
        adpcm_ima_qt                            \
198
        adpcm_ms                                \
199
        adpcm_yam                               \
200
        adpcm_swf                               \
201 9797ce58 Justin Ruggles
        alac                                    \
202 bde51e6a Justin Ruggles
        flac                                    \
203
        wma                                     \
204
        pcm                                     \
205
    )
206
207
LAVF_TESTS = $(addprefix regtest-,              \
208
        avi                                     \
209
        asf                                     \
210
        rm                                      \
211
        mpg                                     \
212 b686d0ab Baptiste Coudurier
        mxf                                     \
213 bde51e6a Justin Ruggles
        ts                                      \
214
        swf                                     \
215
        ffm                                     \
216
        flv_fmt                                 \
217
        mov                                     \
218
        dv_fmt                                  \
219
        gxf                                     \
220
        nut                                     \
221
        mkv                                     \
222
        pbmpipe                                 \
223
        pgmpipe                                 \
224
        ppmpipe                                 \
225
        gif                                     \
226
        yuv4mpeg                                \
227
        pgm                                     \
228
        ppm                                     \
229
        bmp                                     \
230
        tga                                     \
231
        tiff                                    \
232
        sgi                                     \
233
        jpg                                     \
234
        wav                                     \
235
        alaw                                    \
236
        mulaw                                   \
237
        au                                      \
238
        mmf                                     \
239
        aiff                                    \
240
        voc                                     \
241
        ogg                                     \
242
        pixfmt                                  \
243 effcedf7 Daniel Verkamp
        pcx                                     \
244 bde51e6a Justin Ruggles
    )
245
246 40e02409 Stefano Sabatini
LAVFI_TESTS = $(addprefix regtest-,             \
247
    )
248
249 2795e357 Stefano Sabatini
RESFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
250 bde51e6a Justin Ruggles
251 2795e357 Stefano Sabatini
ROTOZOOM_RESFILES = $(call RESFILES,rotozoom.regression,$(CODEC_TESTS))
252
VSYNTH_RESFILES   = $(call RESFILES,vsynth.regression,$(CODEC_TESTS))
253 bde51e6a Justin Ruggles
254 2795e357 Stefano Sabatini
LAVF_RESFILES = $(call RESFILES,lavf.regression,$(LAVF_TESTS))
255 40e02409 Stefano Sabatini
LAVFI_RESFILES = $(call RESFILES,lavfi.regression,$(LAVFI_TESTS))
256 bde51e6a Justin Ruggles
257 2795e357 Stefano Sabatini
LAVF_RESFILE     = tests/data/lavf.regression
258 40e02409 Stefano Sabatini
LAVFI_RESFILE    = tests/data/lavfi.regression
259 2795e357 Stefano Sabatini
ROTOZOOM_RESFILE = tests/data/rotozoom.regression
260
VSYNTH_RESFILE   = tests/data/vsynth.regression
261 bde51e6a Justin Ruggles
262 20a93972 Diego Biurrun
ifneq ($(CONFIG_ZLIB),yes)
263
regtest-flashsv codectest: zlib-error
264
endif
265
zlib-error:
266
	@echo
267
	@echo "This regression test requires zlib."
268
	@echo
269
	@exit 1
270
271 2795e357 Stefano Sabatini
codectest: $(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE)
272
	diff -u -w $(VSYNTH_REFFILE)   $(VSYNTH_RESFILE)
273
	diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_RESFILE)
274 bde51e6a Justin Ruggles
275 2795e357 Stefano Sabatini
lavftest: $(LAVF_RESFILE)
276
	diff -u -w $(LAVF_REFFILE) $(LAVF_RESFILE)
277 bde51e6a Justin Ruggles
278 40e02409 Stefano Sabatini
# lavfitest: $(LAVFI_RESFILE)
279
# 	diff -u -w $(LAVFI_REFFILE) $(LAVFI_RESFILE)
280
281
$(VSYNTH_RESFILE) $(ROTOZOOM_RESFILE) $(LAVF_RESFILE) $(LAVFI_RESFILE):
282 bde51e6a Justin Ruggles
	cat $^ > $@
283
284 2795e357 Stefano Sabatini
$(LAVF_RESFILE):     $(LAVF_RESFILES)
285 40e02409 Stefano Sabatini
$(LAVFI_RESFILE):    $(LAVFI_RESFILES)
286 2795e357 Stefano Sabatini
$(ROTOZOOM_RESFILE): $(ROTOZOOM_RESFILES)
287
$(VSYNTH_RESFILE):   $(VSYNTH_RESFILES)
288 bde51e6a Justin Ruggles
289 2795e357 Stefano Sabatini
$(VSYNTH_RESFILES) $(ROTOZOOM_RESFILES): $(CODEC_TESTS)
290 bde51e6a Justin Ruggles
291 2795e357 Stefano Sabatini
$(LAVF_RESFILES): $(LAVF_TESTS)
292 40e02409 Stefano Sabatini
$(LAVFI_RESFILES): $(LAVFI_TESTS)
293 bde51e6a Justin Ruggles
294 40e02409 Stefano Sabatini
$(CODEC_TESTS) $(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref
295 bde51e6a Justin Ruggles
296 d7167f05 Diego Biurrun
regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/data/asynth1.sw
297 bde51e6a Justin Ruggles
298 82bb3329 Måns Rullgård
$(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(HOSTEXESUF)
299 6117ffbe Diego Biurrun
	$(SRC_PATH)/tests/codec-regression.sh $@ vsynth   tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
300
	$(SRC_PATH)/tests/codec-regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
301 bde51e6a Justin Ruggles
302
$(LAVF_TESTS):
303 8f1e4d4f Stefano Sabatini
	$(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
304 bde51e6a Justin Ruggles
305 40e02409 Stefano Sabatini
$(LAVFI_TESTS):
306 77f66963 Stefano Sabatini
	$(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
307 40e02409 Stefano Sabatini
308 1cde611d Diego Biurrun
seektest: codectest lavftest tests/seek_test$(EXESUF)
309 62cb577e Diego Biurrun
	$(SRC_PATH)/tests/seek-regression.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
310 bde51e6a Justin Ruggles
311 d7167f05 Diego Biurrun
ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
312 bde51e6a Justin Ruggles
	@echo
313
	@echo "Unfortunately ffserver is broken and therefore its regression"
314
	@echo "test fails randomly. Treat the results accordingly."
315
	@echo
316 767e14c3 Diego Biurrun
	$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
317 bde51e6a Justin Ruggles
318 82bb3329 Måns Rullgård
tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
319 bde51e6a Justin Ruggles
	mkdir -p tests/vsynth1
320
	$(BUILD_ROOT)/$< 'tests/vsynth1/'
321
322 82bb3329 Måns Rullgård
tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
323 bde51e6a Justin Ruggles
	mkdir -p tests/vsynth2
324
	$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
325
326 d7167f05 Diego Biurrun
tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
327
	mkdir -p tests/data
328 bde51e6a Justin Ruggles
	$(BUILD_ROOT)/$< $@
329
330 684b28e0 Måns Rullgård
tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
331
	$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
332 bde51e6a Justin Ruggles
333
334 0c3b2d65 Måns Rullgård
.PHONY: documentation *test regtest-* zlib-error alltools check config