Statistics
| Branch: | Revision:

ffmpeg / Makefile @ 0eb4ff9e

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