Build ffmpeg using automake instead of ffmpeg's (broken) Makefiles
[platform/upstream/gstreamer.git] / gst-libs / ext / ffmpeg / Makefile.am
1 # this doesn't trigger the distdir target in the ffmpeg checkout
2 DIST_SUBDIRS =
3
4 if USE_FFMPEG
5 FFMPEG_DIR=ffmpeg
6 else
7 FFMPEG_DIR=
8 endif
9
10 MAKEFLAGS=-j1
11
12 # patch it up before descending into dirs
13 all-recursive: patches
14
15 # ignore failures on patching
16 # ignore failures on rm
17 PATCHES = patch/function.patch
18
19 patches:
20         @echo -n Patching ffmpeg if necessary ...
21         @patch -p0 -N -r rejects < patch/function.patch > /dev/null || true
22         @rm -f rejects || true
23         @echo done.
24
25
26 SUBDIRS = $(FFMPEG_DIR)
27
28 DISTFILES = \
29         $(PATCHES) \
30         Tag \
31         ffmpeg/COPYING \
32         ffmpeg/CREDITS \
33         ffmpeg/INSTALL \
34         ffmpeg/README \
35         ffmpeg/VERSION \
36         ffmpeg/config.mak \
37         ffmpeg/configure \
38         ffmpeg/Makefile \
39         ffmpeg/cygwin_inttypes.h \
40         ffmpeg/ffserver.h \
41         ffmpeg/ffmpeg.c \
42         ffmpeg/ffserver.c \
43         ffmpeg/berrno.h \
44         ffmpeg/config.h \
45         ffmpeg/libavcodec/alpha/*.c \
46         ffmpeg/libavcodec/alpha/*.h \
47         ffmpeg/libavcodec/alpha/*.S \
48         ffmpeg/libavcodec/armv4l/*.c \
49         ffmpeg/libavcodec/armv4l/*.S \
50         ffmpeg/libavcodec/i386/*.c \
51         ffmpeg/libavcodec/i386/*.h \
52         ffmpeg/libavcodec/liba52/*.c \
53         ffmpeg/libavcodec/liba52/*.h \
54         ffmpeg/libavcodec/ppc/*.c \
55         ffmpeg/libavcodec/ppc/*.h \
56         ffmpeg/libavcodec/ps2/*.c \
57         ffmpeg/libavcodec/ps2/*.h \
58         ffmpeg/libavcodec/*.c \
59         ffmpeg/libavcodec/*.h \
60         ffmpeg/libavcodec/Makefile \
61         ffmpeg/libavformat/*.c \
62         ffmpeg/libavformat/*.h \
63         ffmpeg/libavformat/Makefile \
64         ffmpeg/tests/Makefile \
65         ffmpeg/tests/*.c \
66         ffmpeg/tests/*.ref \
67         ffmpeg/tests/*.sh \
68         ffmpeg/tests/test.conf \
69         ffmpeg/vhook/*.c \
70         ffmpeg/vhook/Makefile \
71         Makefile.in
72
73
74 checkout:
75         cvs -d:pserver:anonymous@cvs.ffmpeg.sourceforge.net:/cvsroot/ffmpeg co ffmpeg
76
77 # on running make install, make sure make has been run first
78 install: all
79         @true
80
81 # we don't install stuff so no need to uninstall
82 uninstall:
83         @true
84
85 # override recursive targets
86 # FIXME: maybe this can be prettier, so it doesn't generate warnings
87 dvi-recursive:
88         true
89 check-recursive:
90         true
91 installcheck-recursive:
92         true
93
94
95
96 noinst_LTLIBRARIES = libavformat.la libavcodec.la
97
98 if HAVE_CPU_I386
99 defs_i386 = -DARCH_X86=1 -DHAVE_MMX=1
100 else
101 defs_i386 =
102 endif
103
104 if HAVE_CPU_PPC
105 defs_powerpc = -DARCH_PPC=1
106 else
107 defs_powerpc = 
108 endif
109
110 defs = \
111  $(defs_i386) \
112  $(defs_powerpc) \
113  -DTUNECPU=generic \
114  -DHAVE_STRPTIME=1 \
115  -DHAVE_LRINTF=1 \
116  -DCONFIG_ENCODERS=1 \
117  -DCONFIG_DECODERS=1 \
118  -DCONFIG_PP=1 \
119  -DCONFIG_MPEGAUDIO_HP=1 \
120  -DCONFIG_HAVE_DLOPEN=1 \
121  -DCONFIG_HAVE_DLFCN=1 \
122  -DHAVE_MALLOC_H=1 \
123  -DHAVE_MEMALIGN=1 \
124  -DSIMPLE_IDCT=1 \
125  -DCONFIG_RISKY=1
126
127 libavformat_la_SOURCES = \
128         ffmpeg/libavformat/utils.c \
129         ffmpeg/libavformat/cutils.c \
130         ffmpeg/libavformat/allformats.c \
131         ffmpeg/libavformat/mpeg.c \
132         ffmpeg/libavformat/mpegts.c \
133         ffmpeg/libavformat/mpegtsenc.c \
134         ffmpeg/libavformat/ffm.c \
135         ffmpeg/libavformat/crc.c \
136         ffmpeg/libavformat/img.c \
137         ffmpeg/libavformat/raw.c \
138         ffmpeg/libavformat/rm.c \
139         ffmpeg/libavformat/avienc.c \
140         ffmpeg/libavformat/avidec.c \
141         ffmpeg/libavformat/wav.c \
142         ffmpeg/libavformat/swf.c \
143         ffmpeg/libavformat/au.c \
144         ffmpeg/libavformat/gif.c \
145         ffmpeg/libavformat/mov.c \
146         ffmpeg/libavformat/mpjpeg.c \
147         ffmpeg/libavformat/dv.c \
148         ffmpeg/libavformat/yuv4mpeg.c \
149         ffmpeg/libavformat/4xm.c \
150         ffmpeg/libavformat/asf.c \
151         ffmpeg/libavformat/pnm.c \
152         ffmpeg/libavformat/yuv.c \
153         ffmpeg/libavformat/png.c \
154         ffmpeg/libavformat/jpeg.c \
155         ffmpeg/libavformat/gifdec.c \
156         ffmpeg/libavformat/avio.c \
157         ffmpeg/libavformat/aviobuf.c \
158         ffmpeg/libavformat/file.c  \
159         ffmpeg/libavformat/framehook.c 
160
161 libavformat_la_LDFLAGS = -lm -lz
162 libavformat_la_CFLAGS = $(defs) -Wall -I$(srcdir)/ffmpeg -I$(srcdir)/ffmpeg/libavformat \
163         -I$(srcdir)/ffmpeg/libavcodec -DHAVE_AV_CONFIG_H \
164         -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
165
166
167 if HAVE_CPU_I386
168 sources_i386 = \
169         ffmpeg/libavcodec/i386/fdct_mmx.c \
170         ffmpeg/libavcodec/i386/cputest.c \
171         ffmpeg/libavcodec/i386/dsputil_mmx.c \
172         ffmpeg/libavcodec/i386/motion_est_mmx.c \
173         ffmpeg/libavcodec/i386/simple_idct_mmx.c \
174         ffmpeg/libavcodec/i386/idct_mmx.c \
175         ffmpeg/libavcodec/i386/mpegvideo_mmx.c \
176         ffmpeg/libavcodec/i386/fft_sse.c
177 else
178 sources_i386 = 
179 endif
180
181 if HAVE_CPU_PPC
182 sources_powerpc = \
183         ffmpeg/libavcodec/ppc/dsputil_ppc.c \
184         ffmpeg/libavcodec/ppc/mpegvideo_ppc.c
185 else
186 sources_powerpc =
187 endif
188
189 libavcodec_la_DEFS = $(defs)
190 libavcodec_la_CFLAGS = $(defs) -Wall -I$(srcdir)/ffmpeg -I$(srcdir)/ffmpeg/libavformat \
191         -I$(srcdir)/ffmpeg/libavcodec -DHAVE_AV_CONFIG_H \
192         -I$(srcdir)/ffmpeg/libavcodec/liba52 \
193         -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
194 libavcodec_la_LDFLAGS = -lm -lz
195 libavcodec_la_SOURCES = \
196         ffmpeg/libavcodec/common.c \
197         ffmpeg/libavcodec/utils.c \
198         ffmpeg/libavcodec/mem.c \
199         ffmpeg/libavcodec/allcodecs.c \
200         ffmpeg/libavcodec/mpegvideo.c \
201         ffmpeg/libavcodec/jrevdct.c \
202         ffmpeg/libavcodec/jfdctfst.c \
203         ffmpeg/libavcodec/jfdctint.c \
204         ffmpeg/libavcodec/mpegaudio.c \
205         ffmpeg/libavcodec/ac3enc.c \
206         ffmpeg/libavcodec/mjpeg.c \
207         ffmpeg/libavcodec/resample.c \
208         ffmpeg/libavcodec/dsputil.c \
209         ffmpeg/libavcodec/motion_est.c \
210         ffmpeg/libavcodec/imgconvert.c \
211         ffmpeg/libavcodec/imgresample.c \
212         ffmpeg/libavcodec/mpeg12.c \
213         ffmpeg/libavcodec/mpegaudiodec.c \
214         ffmpeg/libavcodec/pcm.c \
215         ffmpeg/libavcodec/simple_idct.c \
216         ffmpeg/libavcodec/ratecontrol.c \
217         ffmpeg/libavcodec/adpcm.c \
218         ffmpeg/libavcodec/eval.c \
219         ffmpeg/libavcodec/dv.c \
220         ffmpeg/libavcodec/error_resilience.c \
221         ffmpeg/libavcodec/fft.c \
222         ffmpeg/libavcodec/mdct.c \
223         ffmpeg/libavcodec/mace.c \
224         ffmpeg/libavcodec/huffyuv.c \
225         ffmpeg/libavcodec/cyuv.c \
226         ffmpeg/libavcodec/opts.c \
227         ffmpeg/libavcodec/raw.c \
228         ffmpeg/libavcodec/h264.c \
229         ffmpeg/libavcodec/golomb.c \
230         ffmpeg/libavcodec/vp3.c \
231         ffmpeg/libavcodec/asv1.c \
232         ffmpeg/libavcodec/4xm.c \
233         ffmpeg/libavcodec/cabac.c \
234         ffmpeg/libavcodec/ffv1.c \
235         ffmpeg/libavcodec/ra144.c \
236         ffmpeg/libavcodec/ra288.c \
237         ffmpeg/libavcodec/h263.c \
238         ffmpeg/libavcodec/msmpeg4.c \
239         ffmpeg/libavcodec/h263dec.c \
240         ffmpeg/libavcodec/svq1.c \
241         ffmpeg/libavcodec/rv10.c \
242         ffmpeg/libavcodec/wmadec.c \
243         ffmpeg/libavcodec/indeo3.c \
244         $(sources_i386) \
245         $(sources_powerpc)
246