Cope with OSD changes.
[vaapi:sewalliniusms-mplayer.git] / Makefile
1 # MPlayer Makefile
2 #
3 # copyright (c) 2008 Diego Biurrun
4 # Rewritten entirely from a set of Makefiles written by Arpi and many others.
5 #
6 # This file is part of MPlayer.
7 #
8 # MPlayer is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # MPlayer is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License along
19 # with MPlayer; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22 include config.mak
23
24 ###### variable declarations #######
25
26 # local fallbacks for missing operating system features
27 OS_FEATURE-$(GETTIMEOFDAY)           += osdep/gettimeofday.c
28 OS_FEATURE-$(GLOB_WIN)               += osdep/glob-win.c
29 OS_FEATURE-$(MMAP)                   += osdep/mmap-os2.c
30 OS_FEATURE-$(SETENV)                 += osdep/setenv.c
31 OS_FEATURE-$(SHMEM)                  += osdep/shmem.c
32 OS_FEATURE-$(STRSEP)                 += osdep/strsep.c
33 OS_FEATURE-$(VSSCANF)                += osdep/vsscanf.c
34
35 # conditional source declarations
36 SRCS_AUDIO_INPUT-$(ALSA)             += stream/ai_alsa.c
37 SRCS_AUDIO_INPUT-$(OSS)              += stream/ai_oss.c
38 SRCS_COMMON-$(AUDIO_INPUT)           += $(SRCS_AUDIO_INPUT-yes)
39 SRCS_COMMON-$(BITMAP_FONT)           += sub/font_load.c
40 SRCS_COMMON-$(CDDA)                  += stream/stream_cdda.c \
41                                         stream/cdinfo.c
42 SRCS_COMMON-$(CDDB)                  += stream/stream_cddb.c
43 SRCS_COMMON-$(DVBIN)                 += stream/dvb_tune.c \
44                                         stream/stream_dvb.c
45 SRCS_COMMON-$(DVDNAV)                += stream/stream_dvdnav.c
46 SRCS_COMMON-$(DVDNAV_INTERNAL)       += libdvdnav/dvdnav.c \
47                                         libdvdnav/highlight.c \
48                                         libdvdnav/navigation.c \
49                                         libdvdnav/read_cache.c \
50                                         libdvdnav/remap.c \
51                                         libdvdnav/searching.c \
52                                         libdvdnav/settings.c \
53                                         libdvdnav/vm/decoder.c \
54                                         libdvdnav/vm/vm.c \
55                                         libdvdnav/vm/vmcmd.c \
56
57 SRCS_COMMON-$(DVDREAD)               += stream/stream_dvd.c \
58                                         stream/stream_dvd_common.c
59 SRCS_COMMON-$(DVDREAD_INTERNAL)      += libdvdread4/bitreader.c \
60                                         libdvdread4/dvd_input.c \
61                                         libdvdread4/dvd_reader.c \
62                                         libdvdread4/dvd_udf.c \
63                                         libdvdread4/ifo_print.c \
64                                         libdvdread4/ifo_read.c \
65                                         libdvdread4/md5.c \
66                                         libdvdread4/nav_print.c \
67                                         libdvdread4/nav_read.c \
68
69 SRCS_COMMON-$(FAAD)                  += libmpcodecs/ad_faad.c
70 SRCS_COMMON-$(FASTMEMCPY)            += libvo/aclib.c
71 SRCS_COMMON-$(FFMPEG)                += av_helpers.c                \
72                                         av_opts.c                   \
73                                         libaf/af_lavcresample.c     \
74                                         libmpcodecs/ad_ffmpeg.c     \
75                                         libmpcodecs/ad_spdif.c      \
76                                         libmpcodecs/vd_ffmpeg.c     \
77                                         libmpcodecs/vf_geq.c        \
78                                         libmpcodecs/vf_lavc.c       \
79                                         libmpcodecs/vf_lavcdeint.c  \
80                                         libmpcodecs/vf_pp.c         \
81                                         libmpcodecs/vf_screenshot.c \
82                                         libmpdemux/demux_lavf.c     \
83                                         stream/stream_ffmpeg.c      \
84                                         sub/av_sub.c                \
85
86 SRCS_COMMON-$(CONFIG_VF_LAVFI)      +=  libmpcodecs/vf_lavfi.c
87
88 # These filters use private headers and do not work with shared FFmpeg.
89 SRCS_COMMON-$(FFMPEG_A)              += libaf/af_lavcac3enc.c    \
90                                         libmpcodecs/vf_fspp.c    \
91                                         libmpcodecs/vf_mcdeint.c \
92                                         libmpcodecs/vf_qp.c      \
93                                         libmpcodecs/vf_spp.c     \
94                                         libmpcodecs/vf_uspp.c    \
95
96 SRCS_COMMON-$(FREETYPE)              += sub/font_load_ft.c
97 SRCS_COMMON-$(FTP)                   += stream/stream_ftp.c
98 SRCS_COMMON-$(GIF)                   += libmpdemux/demux_gif.c
99 SRCS_COMMON-$(HAVE_POSIX_SELECT)     += libmpcodecs/vf_bmovl.c
100 SRCS_COMMON-$(HAVE_SYS_MMAN_H)       += libaf/af_export.c osdep/mmap_anon.c
101 SRCS_COMMON-$(JPEG)                  += libmpcodecs/vd_ijpg.c
102 SRCS_COMMON-$(LADSPA)                += libaf/af_ladspa.c
103 SRCS_COMMON-$(LIBA52)                += libmpcodecs/ad_liba52.c
104 SRCS_COMMON-$(LIBASS)                += libmpcodecs/vf_ass.c \
105                                         sub/ass_mp.c \
106                                         sub/subassconvert.c \
107
108 SRCS_COMMON-$(LIBASS_INTERNAL)       += libass/ass.c \
109                                         libass/ass_bitmap.c \
110                                         libass/ass_cache.c \
111                                         libass/ass_drawing.c \
112                                         libass/ass_font.c \
113                                         libass/ass_fontconfig.c \
114                                         libass/ass_library.c \
115                                         libass/ass_parse.c \
116                                         libass/ass_render.c \
117                                         libass/ass_render_api.c \
118                                         libass/ass_shaper.c \
119                                         libass/ass_strtod.c \
120                                         libass/ass_utils.c \
121
122 SRCS_COMMON-$(LIBBLURAY)             += stream/stream_bluray.c
123 SRCS_COMMON-$(LIBBS2B)               += libaf/af_bs2b.c
124 SRCS_COMMON-$(LIBDCA)                += libmpcodecs/ad_libdca.c
125 SRCS_COMMON-$(LIBDV)                 += libmpcodecs/ad_libdv.c \
126                                         libmpcodecs/vd_libdv.c \
127                                         libmpdemux/demux_rawdv.c
128 SRCS_COMMON-$(LIBDVDCSS_INTERNAL)    += libdvdcss/css.c \
129                                         libdvdcss/device.c \
130                                         libdvdcss/error.c \
131                                         libdvdcss/ioctl.c \
132                                         libdvdcss/libdvdcss.c \
133
134 SRCS_COMMON-$(LIBMAD)                += libmpcodecs/ad_libmad.c
135
136 SRCS_COMMON-$(LIBMPEG2)              += libmpcodecs/vd_libmpeg2.c
137 SRCS_LIBMPEG2-INTERNAL-$(ARCH_ALPHA) += libmpeg2/idct_alpha.c \
138                                         libmpeg2/motion_comp_alpha.c
139 SRCS_LIBMPEG2-INTERNAL-$(ARCH_ARM)   += libmpeg2/motion_comp_arm.c \
140                                         libmpeg2/motion_comp_arm_s.S
141 SRCS_LIBMPEG2-INTERNAL-$(HAVE_ALTIVEC) += libmpeg2/idct_altivec.c \
142                                         libmpeg2/motion_comp_altivec.c
143 SRCS_LIBMPEG2-INTERNAL-$(HAVE_MMX)   += libmpeg2/idct_mmx.c \
144                                         libmpeg2/motion_comp_mmx.c
145 SRCS_LIBMPEG2-INTERNAL-$(HAVE_VIS)   += libmpeg2/motion_comp_vis.c
146 SRCS_COMMON-$(LIBMPEG2_INTERNAL)     += libmpeg2/alloc.c \
147                                         libmpeg2/cpu_accel.c\
148                                         libmpeg2/cpu_state.c \
149                                         libmpeg2/decode.c \
150                                         libmpeg2/header.c \
151                                         libmpeg2/idct.c \
152                                         libmpeg2/motion_comp.c \
153                                         libmpeg2/slice.c \
154                                         $(SRCS_LIBMPEG2-INTERNAL-yes)
155
156 SRCS_COMMON-$(LIBNEMESI)             += libmpdemux/demux_nemesi.c \
157                                         stream/stream_nemesi.c
158 SRCS_COMMON-$(LIBNUT)                += libmpdemux/demux_nut.c
159 SRCS_COMMON-$(LIBSMBCLIENT)          += stream/stream_smb.c
160 SRCS_COMMON-$(LIBTHEORA)             += libmpcodecs/vd_theora.c
161 SRCS_COMMON-$(LIVE555)               += libmpdemux/demux_rtp.cpp \
162                                         libmpdemux/demux_rtp_codec.cpp \
163                                         stream/stream_live555.c
164 SRCS_COMMON-$(MACOSX_FINDER)         += osdep/macosx_finder_args.c
165 SRCS_COMMON-$(MNG)                   += libmpdemux/demux_mng.c
166 SRCS_COMMON-$(MPG123)                += libmpcodecs/ad_mpg123.c
167
168 SRCS_MP3LIB-X86-$(HAVE_AMD3DNOW)     += mp3lib/dct36_3dnow.c \
169                                         mp3lib/dct64_3dnow.c
170 SRCS_MP3LIB-X86-$(HAVE_AMD3DNOWEXT)  += mp3lib/dct36_k7.c \
171                                         mp3lib/dct64_k7.c
172 SRCS_MP3LIB-X86-$(HAVE_MMX)          += mp3lib/dct64_mmx.c
173 SRCS_MP3LIB-$(ARCH_X86_32)           += mp3lib/decode_i586.c \
174                                         $(SRCS_MP3LIB-X86-yes)
175 SRCS_MP3LIB-$(HAVE_ALTIVEC)          += mp3lib/dct64_altivec.c
176 SRCS_MP3LIB-$(HAVE_MMX)              += mp3lib/decode_mmx.c
177 SRCS_MP3LIB-$(HAVE_SSE)              += mp3lib/dct64_sse.c
178 SRCS_MP3LIB                          += mp3lib/sr1.c \
179                                         $(SRCS_MP3LIB-yes)
180 SRCS_COMMON-$(MP3LIB)                += libmpcodecs/ad_mp3lib.c \
181                                         $(SRCS_MP3LIB)
182
183 SRCS_COMMON-$(MUSEPACK)              += libmpcodecs/ad_mpc.c \
184                                         libmpdemux/demux_mpc.c
185 SRCS_COMMON-$(NATIVE_RTSP)           += stream/stream_rtsp.c \
186                                         stream/freesdp/common.c \
187                                         stream/freesdp/errorlist.c \
188                                         stream/freesdp/parser.c \
189                                         stream/librtsp/rtsp.c \
190                                         stream/librtsp/rtsp_rtp.c \
191                                         stream/librtsp/rtsp_session.c \
192
193 SRCS_COMMON-$(NETWORKING)            += stream/stream_netstream.c \
194                                         stream/asf_mmst_streaming.c \
195                                         stream/asf_streaming.c \
196                                         stream/cookies.c \
197                                         stream/http.c \
198                                         stream/network.c \
199                                         stream/pnm.c \
200                                         stream/rtp.c \
201                                         stream/udp.c \
202                                         stream/tcp.c \
203                                         stream/stream_rtp.c \
204                                         stream/stream_udp.c \
205                                         stream/librtsp/rtsp.c \
206                                         stream/realrtsp/asmrp.c \
207                                         stream/realrtsp/real.c \
208                                         stream/realrtsp/rmff.c \
209                                         stream/realrtsp/sdpplin.c \
210                                         stream/realrtsp/xbuffer.c \
211
212 SRCS_COMMON-$(PNG)                   += libmpcodecs/vd_mpng.c
213 SRCS_COMMON-$(PRIORITY)              += osdep/priority.c
214 SRCS_COMMON-$(PVR)                   += stream/stream_pvr.c
215 SRCS_COMMON-$(QTX_CODECS)            += libmpcodecs/ad_qtaudio.c \
216                                         libmpcodecs/vd_qtvideo.c
217 SRCS_COMMON-$(RADIO)                 += stream/stream_radio.c
218 SRCS_COMMON-$(RADIO_CAPTURE)         += stream/audio_in.c
219 SRCS_COMMON-$(REAL_CODECS)           += libmpcodecs/ad_realaud.c \
220                                         libmpcodecs/vd_realvid.c
221 SRCS_COMMON-$(SPEEX)                 += libmpcodecs/ad_speex.c
222 SRCS_COMMON-$(STREAM_CACHE)          += stream/cache2.c
223
224 SRCS_COMMON-$(TREMOR_INTERNAL)       += tremor/bitwise.c \
225                                         tremor/block.c \
226                                         tremor/codebook.c \
227                                         tremor/floor0.c \
228                                         tremor/floor1.c \
229                                         tremor/framing.c \
230                                         tremor/info.c \
231                                         tremor/mapping0.c \
232                                         tremor/mdct.c \
233                                         tremor/registry.c \
234                                         tremor/res012.c \
235                                         tremor/sharedbook.c \
236                                         tremor/synthesis.c \
237                                         tremor/window.c \
238
239 SRCS_COMMON-$(TV)                    += stream/stream_tv.c stream/tv.c \
240                                         stream/frequencies.c stream/tvi_dummy.c
241 SRCS_COMMON-$(TV_BSDBT848)           += stream/tvi_bsdbt848.c
242 SRCS_COMMON-$(TV_DSHOW)              += stream/tvi_dshow.c \
243                                         loader/dshow/guids.c \
244                                         loader/dshow/mediatype.c \
245
246 SRCS_COMMON-$(TV_V4L1)               += stream/tvi_v4l.c  stream/audio_in.c
247 SRCS_COMMON-$(TV_V4L2)               += stream/tvi_v4l2.c stream/audio_in.c
248 SRCS_COMMON-$(UNRAR_EXEC)            += sub/unrar_exec.c
249 SRCS_COMMON-$(VCD)                   += stream/stream_vcd.c
250 SRCS_COMMON-$(VORBIS)                += libmpcodecs/ad_libvorbis.c \
251                                         libmpdemux/demux_ogg.c
252 SRCS_COMMON-$(VSTREAM)               += stream/stream_vstream.c
253 SRCS_QTX_EMULATION                   += loader/wrapper.S
254 SRCS_COMMON-$(QTX_EMULATION)         += $(SRCS_QTX_EMULATION)
255 SRCS_WIN32_EMULATION                 += loader/elfdll.c \
256                                         loader/ext.c \
257                                         loader/ldt_keeper.c \
258                                         loader/module.c \
259                                         loader/pe_image.c \
260                                         loader/pe_resource.c \
261                                         loader/registry.c \
262                                         loader/resource.c \
263                                         loader/win32.c \
264
265 SRCS_COMMON-$(WIN32_EMULATION)       += $(SRCS_WIN32_EMULATION)
266
267 SRCS_COMMON-$(WIN32DLL)              += libmpcodecs/ad_acm.c \
268                                         libmpcodecs/ad_dmo.c \
269                                         libmpcodecs/ad_dshow.c \
270                                         libmpcodecs/ad_twin.c \
271                                         libmpcodecs/vd_dmo.c \
272                                         libmpcodecs/vd_dshow.c \
273                                         libmpcodecs/vd_vfw.c \
274                                         libmpcodecs/vd_vfwex.c \
275                                         libmpdemux/demux_avs.c \
276                                         loader/afl.c \
277                                         loader/drv.c \
278                                         loader/vfl.c \
279                                         loader/dshow/DS_AudioDecoder.c \
280                                         loader/dshow/DS_Filter.c \
281                                         loader/dshow/DS_VideoDecoder.c \
282                                         loader/dshow/allocator.c \
283                                         loader/dshow/cmediasample.c \
284                                         loader/dshow/graph.c \
285                                         loader/dshow/guids.c \
286                                         loader/dshow/inputpin.c \
287                                         loader/dshow/mediatype.c \
288                                         loader/dshow/outputpin.c \
289                                         loader/dmo/DMO_AudioDecoder.c \
290                                         loader/dmo/DMO_VideoDecoder.c   \
291                                         loader/dmo/buffer.c   \
292                                         loader/dmo/dmo.c  \
293                                         loader/dmo/dmo_guids.c \
294
295 SRCS_COMMON-$(XANIM_CODECS)          += libmpcodecs/vd_xanim.c
296 SRCS_COMMON-$(XMMS_PLUGINS)          += libmpdemux/demux_xmms.c
297 SRCS_COMMON-$(XVID4)                 += libmpcodecs/vd_xvid4.c
298 SRCS_COMMON-$(ZR)                    += libmpcodecs/vd_zrmjpeg.c \
299                                         libmpcodecs/vf_zrmjpeg.c
300 SRCS_COMMON = asxparser.c \
301               bstr.c \
302               codec-cfg.c \
303               cpudetect.c \
304               edl.c \
305               fmt-conversion.c \
306               m_config.c \
307               m_option.c \
308               m_struct.c \
309               mp_msg.c \
310               mp_strings.c \
311               mpcommon.c \
312               parser-cfg.c \
313               path.c \
314               playtree.c \
315               playtreeparser.c \
316               subopt-helper.c \
317               libaf/af.c \
318               libaf/af_center.c \
319               libaf/af_channels.c \
320               libaf/af_comp.c \
321               libaf/af_delay.c \
322               libaf/af_dummy.c \
323               libaf/af_equalizer.c \
324               libaf/af_extrastereo.c \
325               libaf/af_format.c \
326               libaf/af_gate.c \
327               libaf/af_hrtf.c \
328               libaf/af_karaoke.c \
329               libaf/af_pan.c \
330               libaf/af_resample.c \
331               libaf/af_scaletempo.c \
332               libaf/af_sinesuppress.c \
333               libaf/af_stats.c \
334               libaf/af_sub.c \
335               libaf/af_surround.c \
336               libaf/af_sweep.c \
337               libaf/af_tools.c \
338               libaf/af_volnorm.c \
339               libaf/af_volume.c \
340               libaf/filter.c \
341               libaf/format.c \
342               libaf/reorder_ch.c \
343               libaf/window.c \
344               libmpcodecs/ad.c \
345               libmpcodecs/ad_alaw.c \
346               libmpcodecs/ad_dk3adpcm.c \
347               libmpcodecs/ad_dvdpcm.c \
348               libmpcodecs/ad_hwac3.c \
349               libmpcodecs/ad_hwmpa.c \
350               libmpcodecs/ad_imaadpcm.c \
351               libmpcodecs/ad_msadpcm.c \
352               libmpcodecs/ad_pcm.c \
353               libmpcodecs/dec_audio.c \
354               libmpcodecs/dec_teletext.c \
355               libmpcodecs/dec_video.c \
356               libmpcodecs/img_format.c \
357               libmpcodecs/mp_image.c \
358               libmpcodecs/pullup.c \
359               libmpcodecs/vd.c \
360               libmpcodecs/vd_hmblck.c \
361               libmpcodecs/vd_lzo.c \
362               libmpcodecs/vd_mpegpes.c \
363               libmpcodecs/vd_mtga.c \
364               libmpcodecs/vd_null.c \
365               libmpcodecs/vd_raw.c \
366               libmpcodecs/vd_sgi.c \
367               libmpcodecs/vf.c \
368               libmpcodecs/vf_1bpp.c \
369               libmpcodecs/vf_2xsai.c \
370               libmpcodecs/vf_blackframe.c \
371               libmpcodecs/vf_boxblur.c \
372               libmpcodecs/vf_crop.c \
373               libmpcodecs/vf_cropdetect.c \
374               libmpcodecs/vf_decimate.c \
375               libmpcodecs/vf_delogo.c \
376               libmpcodecs/vf_denoise3d.c \
377               libmpcodecs/vf_detc.c \
378               libmpcodecs/vf_dint.c \
379               libmpcodecs/vf_divtc.c \
380               libmpcodecs/vf_down3dright.c \
381               libmpcodecs/vf_dsize.c \
382               libmpcodecs/vf_dvbscale.c \
383               libmpcodecs/vf_eq.c \
384               libmpcodecs/vf_eq2.c \
385               libmpcodecs/vf_expand.c \
386               libmpcodecs/vf_field.c \
387               libmpcodecs/vf_fil.c \
388               libmpcodecs/vf_filmdint.c \
389               libmpcodecs/vf_fixpts.c \
390               libmpcodecs/vf_flip.c \
391               libmpcodecs/vf_format.c \
392               libmpcodecs/vf_framestep.c \
393               libmpcodecs/vf_gradfun.c \
394               libmpcodecs/vf_halfpack.c \
395               libmpcodecs/vf_harddup.c \
396               libmpcodecs/vf_hqdn3d.c \
397               libmpcodecs/vf_hue.c \
398               libmpcodecs/vf_il.c \
399               libmpcodecs/vf_ilpack.c \
400               libmpcodecs/vf_ivtc.c \
401               libmpcodecs/vf_kerndeint.c \
402               libmpcodecs/vf_mirror.c \
403               libmpcodecs/vf_noformat.c \
404               libmpcodecs/vf_noise.c \
405               libmpcodecs/vf_ow.c \
406               libmpcodecs/vf_palette.c \
407               libmpcodecs/vf_perspective.c \
408               libmpcodecs/vf_phase.c \
409               libmpcodecs/vf_pp7.c \
410               libmpcodecs/vf_pullup.c \
411               libmpcodecs/vf_rectangle.c \
412               libmpcodecs/vf_remove_logo.c \
413               libmpcodecs/vf_rgbtest.c \
414               libmpcodecs/vf_rotate.c \
415               libmpcodecs/vf_sab.c \
416               libmpcodecs/vf_scale.c \
417               libmpcodecs/vf_smartblur.c \
418               libmpcodecs/vf_softpulldown.c \
419               libmpcodecs/vf_stereo3d.c \
420               libmpcodecs/vf_softskip.c \
421               libmpcodecs/vf_swapuv.c \
422               libmpcodecs/vf_telecine.c \
423               libmpcodecs/vf_test.c \
424               libmpcodecs/vf_tfields.c \
425               libmpcodecs/vf_tile.c \
426               libmpcodecs/vf_tinterlace.c \
427               libmpcodecs/vf_unsharp.c \
428               libmpcodecs/vf_vo.c \
429               libmpcodecs/vf_yadif.c \
430               libmpcodecs/vf_yuvcsp.c \
431               libmpcodecs/vf_yvu9.c \
432               libmpdemux/aac_hdr.c \
433               libmpdemux/asfheader.c \
434               libmpdemux/aviheader.c \
435               libmpdemux/aviprint.c \
436               libmpdemux/demuxer.c \
437               libmpdemux/demux_aac.c \
438               libmpdemux/demux_asf.c \
439               libmpdemux/demux_audio.c \
440               libmpdemux/demux_avi.c \
441               libmpdemux/demux_demuxers.c \
442               libmpdemux/demux_film.c \
443               libmpdemux/demux_fli.c \
444               libmpdemux/demux_lmlm4.c \
445               libmpdemux/demux_mf.c \
446               libmpdemux/demux_mkv.c \
447               libmpdemux/demux_mov.c \
448               libmpdemux/demux_mpg.c \
449               libmpdemux/demux_nsv.c \
450               libmpdemux/demux_pva.c \
451               libmpdemux/demux_rawaudio.c \
452               libmpdemux/demux_rawvideo.c \
453               libmpdemux/demux_realaud.c \
454               libmpdemux/demux_real.c \
455               libmpdemux/demux_roq.c \
456               libmpdemux/demux_smjpeg.c \
457               libmpdemux/demux_ts.c \
458               libmpdemux/demux_ty.c \
459               libmpdemux/demux_ty_osd.c \
460               libmpdemux/demux_viv.c \
461               libmpdemux/demux_vqf.c \
462               libmpdemux/demux_y4m.c \
463               libmpdemux/ebml.c \
464               libmpdemux/extension.c \
465               libmpdemux/mf.c \
466               libmpdemux/mp3_hdr.c \
467               libmpdemux/mp_taglists.c \
468               libmpdemux/mpeg_hdr.c \
469               libmpdemux/mpeg_packetizer.c \
470               libmpdemux/parse_es.c \
471               libmpdemux/parse_mp4.c \
472               libmpdemux/video.c \
473               libmpdemux/yuv4mpeg.c \
474               libmpdemux/yuv4mpeg_ratio.c \
475               osdep/$(GETCH) \
476               osdep/$(TIMER) \
477               stream/open.c \
478               stream/stream.c \
479               stream/stream_bd.c \
480               stream/stream_cue.c \
481               stream/stream_file.c \
482               stream/stream_mf.c \
483               stream/stream_null.c \
484               stream/url.c \
485               sub/eosd.c \
486               sub/find_sub.c \
487               sub/osd.c \
488               sub/spudec.c \
489               sub/sub.c \
490               sub/sub_cc.c \
491               sub/subreader.c \
492               sub/vobsub.c \
493               $(SRCS_COMMON-yes) \
494               $(OS_FEATURE-no)
495
496
497 SRCS_MPLAYER-$(3DFX)         += libvo/vo_3dfx.c
498 SRCS_MPLAYER-$(AA)           += libvo/vo_aa.c
499 SRCS_MPLAYER-$(ALSA)         += libao2/ao_alsa.c
500 SRCS_MPLAYER-$(APPLE_IR)     += input/appleir.c
501 SRCS_MPLAYER-$(APPLE_REMOTE) += input/ar.c
502 SRCS_MPLAYER-$(ARTS)         += libao2/ao_arts.c
503 SRCS_MPLAYER-$(BL)           += libvo/vo_bl.c
504 SRCS_MPLAYER-$(CACA)         += libvo/vo_caca.c
505 SRCS_MPLAYER-$(COREAUDIO)    += libao2/ao_coreaudio.c
506 SRCS_MPLAYER-$(COREVIDEO)    += libvo/vo_corevideo.m libvo/osx_common.c
507 SRCS_MPLAYER-$(DART)         += libao2/ao_dart.c
508 SRCS_MPLAYER-$(DGA)          += libvo/vo_dga.c
509 SRCS_MPLAYER-$(DIRECT3D)     += libvo/vo_direct3d.c libvo/w32_common.c
510 SRCS_MPLAYER-$(DIRECTFB)     += libvo/vo_directfb2.c libvo/vo_dfbmga.c
511 SRCS_MPLAYER-$(DIRECTX)      += libao2/ao_dsound.c libvo/vo_directx.c
512 SRCS_MPLAYER-$(DXR2)         += libao2/ao_dxr2.c libvo/vo_dxr2.c
513 SRCS_MPLAYER-$(DXR3)         += libvo/vo_dxr3.c
514 SRCS_MPLAYER-$(ESD)          += libao2/ao_esd.c
515 SRCS_MPLAYER-$(FBDEV)        += libvo/vo_fbdev.c libvo/vo_fbdev2.c
516 SRCS_MPLAYER-$(FFMPEG)       += libvo/vo_png.c
517 SRCS_MPLAYER-$(GGI)          += libvo/vo_ggi.c
518 SRCS_MPLAYER-$(GIF)          += libvo/vo_gif89a.c
519 SRCS_MPLAYER-$(GL)           += libvo/gl_common.c libvo/vo_gl.c \
520                                 libvo/vo_gl2.c libvo/csputils.c
521 SRCS_MPLAYER-$(GL_SDL)       += libvo/sdl_common.c
522 SRCS_MPLAYER-$(GL_WIN32)     += libvo/w32_common.c
523 SRCS_MPLAYER-$(GL_X11)       += libvo/x11_common.c
524 SRCS_MPLAYER-$(MATRIXVIEW)   += libvo/vo_matrixview.c libvo/matrixview.c
525 SRCS_MPLAYER-$(GUI)          += gui/util/bitmap.c \
526                                 gui/util/list.c \
527                                 gui/util/string.c
528 SRCS_MPLAYER-$(GUI_GTK)      += gui/app.c \
529                                 gui/cfg.c \
530                                 gui/interface.c \
531                                 gui/skin/font.c \
532                                 gui/skin/skin.c \
533                                 gui/ui/actions.c \
534                                 gui/ui/gtk/about.c \
535                                 gui/ui/gtk/equalizer.c \
536                                 gui/ui/gtk/fileselect.c \
537                                 gui/ui/gtk/menu.c \
538                                 gui/ui/gtk/msgbox.c \
539                                 gui/ui/gtk/playlist.c \
540                                 gui/ui/gtk/preferences.c \
541                                 gui/ui/gtk/skinbrowser.c \
542                                 gui/ui/gtk/tools.c \
543                                 gui/ui/gtk/url.c \
544                                 gui/ui/main.c \
545                                 gui/ui/menu.c \
546                                 gui/ui/playbar.c \
547                                 gui/ui/render.c \
548                                 gui/ui/sub.c \
549                                 gui/ui/widgets.c \
550                                 gui/util/cut.c \
551                                 gui/wm/ws.c \
552                                 gui/wm/wsxdnd.c \
553
554 SRCS_MPLAYER-$(GUI_WIN32)    += gui/win32/dialogs.c \
555                                 gui/win32/gui.c \
556                                 gui/win32/interface.c \
557                                 gui/win32/playlist.c \
558                                 gui/win32/preferences.c \
559                                 gui/win32/skinload.c \
560                                 gui/win32/widgetrender.c \
561                                 gui/win32/wincfg.c \
562
563 SRCS_MPLAYER-$(IVTV)         += libao2/ao_ivtv.c libvo/vo_ivtv.c
564 SRCS_MPLAYER-$(JACK)         += libao2/ao_jack.c
565 SRCS_MPLAYER-$(JOYSTICK)     += input/joystick.c
566 SRCS_MPLAYER-$(JPEG)         += libvo/vo_jpeg.c
567 SRCS_MPLAYER-$(KAI)          += libao2/ao_kai.c
568 SRCS_MPLAYER-$(KVA)          += libvo/vo_kva.c
569 SRCS_MPLAYER-$(LIBMENU)      += libmenu/menu.c \
570                                 libmenu/menu_chapsel.c \
571                                 libmenu/menu_cmdlist.c  \
572                                 libmenu/menu_console.c \
573                                 libmenu/menu_filesel.c \
574                                 libmenu/menu_list.c  \
575                                 libmenu/menu_param.c \
576                                 libmenu/menu_pt.c \
577                                 libmenu/menu_txt.c \
578                                 libmenu/vf_menu.c \
579
580 SRCS_MPLAYER-$(LIBMENU_DVBIN) += libmenu/menu_dvbin.c
581 SRCS_MPLAYER-$(LIRC)          += input/lirc.c
582 SRCS_MPLAYER-$(MD5SUM)        += libvo/vo_md5sum.c
583 SRCS_MPLAYER-$(MGA)           += libvo/vo_mga.c
584 SRCS_MPLAYER-$(MNG)           += libvo/vo_mng.c
585 SRCS_MPLAYER-$(NAS)           += libao2/ao_nas.c
586 SRCS_MPLAYER-$(NETWORKING)    += udp_sync.c
587 SRCS_MPLAYER-$(OPENAL)        += libao2/ao_openal.c
588 SRCS_MPLAYER-$(OSS)           += libao2/ao_oss.c
589 SRCS_MPLAYER-$(PNM)           += libvo/vo_pnm.c
590 SRCS_MPLAYER-$(PULSE)         += libao2/ao_pulse.c
591 SRCS_MPLAYER-$(QUARTZ)        += libvo/vo_quartz.c libvo/osx_common.c
592 SRCS_MPLAYER-$(S3FB)          += libvo/vo_s3fb.c
593 SRCS_MPLAYER-$(SDL)           += libao2/ao_sdl.c libvo/vo_sdl.c libvo/sdl_common.c
594 SRCS_MPLAYER-$(SGIAUDIO)      += libao2/ao_sgi.c
595 SRCS_MPLAYER-$(SUNAUDIO)      += libao2/ao_sun.c
596 SRCS_MPLAYER-$(SVGA)          += libvo/vo_svga.c
597 SRCS_MPLAYER-$(TDFXFB)        += libvo/vo_tdfxfb.c
598 SRCS_MPLAYER-$(TDFXVID)       += libvo/vo_tdfx_vid.c
599 SRCS_MPLAYER-$(TGA)           += libvo/vo_tga.c
600 SRCS_MPLAYER-$(V4L2)          += libvo/vo_v4l2.c
601 SRCS_MPLAYER-$(V4L2)          += libao2/ao_v4l2.c
602 SRCS_MPLAYER-$(VAAPI)         += libvo/vo_vaapi.c
603 SRCS_MPLAYER-$(VDPAU)         += libvo/vo_vdpau.c
604 SRCS_MPLAYER-$(VESA)          += libvo/gtf.c libvo/vo_vesa.c libvo/vesa_lvo.c
605 SRCS_MPLAYER-$(VIDIX)         += libvo/vo_cvidix.c \
606                                  libvo/vosub_vidix.c \
607                                  vidix/vidix.c \
608                                  vidix/drivers.c \
609                                  vidix/dha.c \
610                                  vidix/mtrr.c \
611                                  vidix/pci.c \
612                                  vidix/pci_names.c \
613                                  vidix/pci_dev_ids.c\
614
615 SRCS_MPLAYER-$(VIDIX_CYBERBLADE)    += vidix/cyberblade_vid.c
616 SRCS_MPLAYER-$(VIDIX_IVTV)          += vidix/ivtv_vid.c
617 SRCS_MPLAYER-$(VIDIX_MACH64)        += vidix/mach64_vid.c
618 SRCS_MPLAYER-$(VIDIX_MGA)           += vidix/mga_vid.c
619 SRCS_MPLAYER-$(VIDIX_MGA_CRTC2)     += vidix/mga_crtc2_vid.c
620 SRCS_MPLAYER-$(VIDIX_NVIDIA)        += vidix/nvidia_vid.c
621 SRCS_MPLAYER-$(VIDIX_PM2)           += vidix/pm2_vid.c
622 SRCS_MPLAYER-$(VIDIX_PM3)           += vidix/pm3_vid.c
623 SRCS_MPLAYER-$(VIDIX_RADEON)        += vidix/radeon_vid.c
624 SRCS_MPLAYER-$(VIDIX_RAGE128)       += vidix/rage128_vid.c
625 SRCS_MPLAYER-$(VIDIX_S3)            += vidix/s3_vid.c
626 SRCS_MPLAYER-$(VIDIX_SH_VEU)        += vidix/sh_veu_vid.c
627 SRCS_MPLAYER-$(VIDIX_SIS)           += vidix/sis_vid.c vidix/sis_bridge.c
628 SRCS_MPLAYER-$(VIDIX_UNICHROME)     += vidix/unichrome_vid.c
629 SRCS_MPLAYER-$(WII)           += libvo/vo_wii.c
630 SRCS_MPLAYER-$(WIN32WAVEOUT)  += libao2/ao_win32.c
631 SRCS_MPLAYER-$(WINVIDIX)      += libvo/vo_winvidix.c
632 SRCS_MPLAYER-$(X11)           += libvo/vo_x11.c libvo/vo_xover.c \
633                                  libvo/x11_common.c
634 SRCS_MPLAYER-$(XMGA)          += libvo/vo_xmga.c
635 SRCS_MPLAYER-$(XV)            += libvo/vo_xv.c
636 SRCS_MPLAYER-$(XVIDIX)        += libvo/vo_xvidix.c
637 SRCS_MPLAYER-$(XVMC)          += libvo/vo_xvmc.c
638 SRCS_MPLAYER-$(XVR100)        += libvo/vo_xvr100.c
639 SRCS_MPLAYER-$(YUV4MPEG)      += libvo/vo_yuv4mpeg.c
640 SRCS_MPLAYER-$(ZR)            += libvo/jpeg_enc.c libvo/vo_zr.c libvo/vo_zr2.c
641
642 SRCS_MPLAYER = command.c \
643                m_property.c \
644                mixer.c \
645                mp_fifo.c \
646                mplayer.c \
647                parser-mpcmd.c \
648                pnm_loader.c \
649                input/input.c \
650                libao2/ao_mpegpes.c \
651                libao2/ao_null.c \
652                libao2/ao_pcm.c \
653                libao2/audio_out.c \
654                libvo/aspect.c \
655                libvo/geometry.c \
656                libvo/stats.c \
657                libvo/video_out.c \
658                libvo/vo_mpegpes.c \
659                libvo/vo_null.c \
660                sub/spuenc.c \
661                $(SRCS_MPLAYER-yes)
662
663
664 SRCS_MENCODER-$(FAAC)             += libmpcodecs/ae_faac.c
665 SRCS_MENCODER-$(FFMPEG)           += libmpcodecs/ae_lavc.c \
666                                      libmpcodecs/ve_lavc.c \
667                                      libmpdemux/muxer_lavf.c
668 SRCS_MENCODER-$(LIBDV)            += libmpcodecs/ve_libdv.c
669 SRCS_MENCODER-$(LIBLZO)           += libmpcodecs/ve_nuv.c \
670                                      libmpcodecs/native/rtjpegn.c
671 SRCS_MENCODER-$(MP3LAME)          += libmpcodecs/ae_lame.c
672 SRCS_MENCODER-$(QTX_CODECS_WIN32) += libmpcodecs/ve_qtvideo.c
673 SRCS_MENCODER-$(TOOLAME)          += libmpcodecs/ae_toolame.c
674 SRCS_MENCODER-$(TWOLAME)          += libmpcodecs/ae_twolame.c
675 SRCS_MENCODER-$(WIN32DLL)         += libmpcodecs/ve_vfw.c
676 SRCS_MENCODER-$(X264)             += libmpcodecs/ve_x264.c
677 SRCS_MENCODER-$(XVID4)            += libmpcodecs/ve_xvid4.c
678
679 SRCS_MENCODER = mencoder.c \
680                 parser-mecmd.c \
681                 xvid_vbr.c \
682                 libmpcodecs/ae.c \
683                 libmpcodecs/ae_pcm.c \
684                 libmpcodecs/ve.c \
685                 libmpcodecs/ve_raw.c \
686                 libmpdemux/muxer.c \
687                 libmpdemux/muxer_avi.c \
688                 libmpdemux/muxer_mpeg.c \
689                 libmpdemux/muxer_rawaudio.c \
690                 libmpdemux/muxer_rawvideo.c \
691                 $(SRCS_MENCODER-yes)
692
693 # (linking) order matters for these libraries
694 FFMPEGPARTS = libpostproc libswscale libavfilter libavformat libavcodec libavutil
695 FFMPEGLIBS  = $(foreach part, $(FFMPEGPARTS), ffmpeg/$(part)/$(part).a)
696 FFMPEGFILES = $(foreach part, $(FFMPEGPARTS), $(wildcard $(addprefix ffmpeg/$(part)/,*.[chS] /*/*.[chS] /*/*.asm)))
697
698 COMMON_LIBS-$(FFMPEG_A)           += $(FFMPEGLIBS)
699 COMMON_LIBS                       += $(COMMON_LIBS-yes)
700
701 OBJS_COMMON    += $(addsuffix .o, $(basename $(SRCS_COMMON)))
702 OBJS_MENCODER  += $(addsuffix .o, $(basename $(SRCS_MENCODER)))
703 OBJS_MPLAYER   += $(addsuffix .o, $(basename $(SRCS_MPLAYER)))
704 OBJS_MPLAYER-$(PE_EXECUTABLE) += osdep/mplayer-rc.o
705 OBJS_MPLAYER   += $(OBJS_MPLAYER-yes)
706
707 MENCODER_DEPS = $(OBJS_MENCODER) $(OBJS_COMMON) $(COMMON_LIBS)
708 MPLAYER_DEPS  = $(OBJS_MPLAYER)  $(OBJS_COMMON) $(COMMON_LIBS)
709 DEP_FILES = $(SRCS_COMMON) $(SRCS_MPLAYER) $(SRCS_MENCODER)
710 $(foreach suffix,.c .cpp .m .S,$(eval DEP_FILES := $(DEP_FILES:$(suffix)=.d)))
711
712 ALL_PRG-$(MPLAYER)  += mplayer$(EXESUF)
713 ALL_PRG-$(MENCODER) += mencoder$(EXESUF)
714
715 INSTALL_TARGETS-$(GUI)      += install-gui
716 INSTALL_TARGETS-$(MENCODER) += install-mencoder install-mencoder-man
717 INSTALL_TARGETS-$(MPLAYER)  += install-mplayer  install-mplayer-man
718
719 DIRS =  . \
720         gui \
721         gui/skin \
722         gui/ui \
723         gui/ui/gtk \
724         gui/util \
725         gui/win32 \
726         gui/wm \
727         input \
728         libaf \
729         libao2 \
730         libmenu \
731         libmpcodecs \
732         libmpcodecs/native \
733         libmpdemux \
734         libvo \
735         loader \
736         loader/dmo \
737         loader/dshow \
738         loader/wine \
739         mp3lib \
740         osdep \
741         stream \
742         stream/freesdp \
743         stream/librtsp \
744         stream/realrtsp \
745         sub \
746         TOOLS \
747         vidix \
748
749 ALL_DIRS = $(DIRS) \
750         libass \
751         libdvdcss \
752         libdvdnav \
753         libdvdnav/vm \
754         libdvdread4 \
755         libmpeg2 \
756         tremor \
757
758 ALLHEADERS = $(foreach dir,$(DIRS),$(wildcard $(dir)/*.h))
759
760 ADDSUFFIXES     = $(foreach suf,$(1),$(addsuffix $(suf),$(2)))
761 ADD_ALL_DIRS    = $(call ADDSUFFIXES,$(1),$(ALL_DIRS))
762 ADD_ALL_EXESUFS = $(1) $(call ADDSUFFIXES,$(EXESUFS_ALL),$(1))
763
764 GUI_ICONSIZES = 16x16 22x22 24x24 32x32 48x48 256x256
765
766
767
768 ###### generic rules #######
769
770 all: $(ALL_PRG-yes)
771
772 %.o: %.S
773         $(CC) $(CC_DEPFLAGS) $(CFLAGS) -c -o $@ $<
774
775 %.o: %.c
776         $(CC) $(CC_DEPFLAGS) $(CFLAGS) -c -o $@ $<
777
778 %.o: %.cpp
779         $(CC) $(CC_DEPFLAGS) $(CXXFLAGS) -c -o $@ $<
780
781 %.o: %.m
782         $(CC) $(CC_DEPFLAGS) $(CFLAGS) -c -o $@ $<
783
784 %-rc.o: %.rc
785         $(WINDRES) -I. $< -o $@
786
787 $(FFMPEGLIBS): $(FFMPEGFILES) config.h
788         $(MAKE) -C ffmpeg $(@:ffmpeg/%=%)
789
790 mencoder$(EXESUF): $(MENCODER_DEPS)
791 mencoder$(EXESUF): EXTRALIBS += $(EXTRALIBS_MENCODER)
792 mplayer$(EXESUF): $(MPLAYER_DEPS)
793 mplayer$(EXESUF): EXTRALIBS += $(EXTRALIBS_MPLAYER)
794 mencoder$(EXESUF) mplayer$(EXESUF):
795         $(CC) -o $@ $^ $(EXTRALIBS)
796
797 codec-cfg$(EXESUF): codec-cfg.c codec-cfg.h help_mp.h
798         $(HOST_CC) -O -DCODECS2HTML -I. -Iffmpeg -o $@ $<
799
800 codecs.conf.h: codec-cfg$(EXESUF) etc/codecs.conf
801         ./$^ > $@
802
803 checksums: $(MPLAYER_DEPS) $(MENCODER_DEPS) mplayer$(EXESUF) mencoder$(EXESUF)
804         md5sum $^ > checksums
805
806 check_checksums: $(MPLAYER_DEPS) $(MENCODER_DEPS) mplayer$(EXESUF) mencoder$(EXESUF)
807         md5sum -c checksums
808
809 # ./configure must be rerun if it changed
810 config.mak: configure
811         @echo "############################################################"
812         @echo "####### Please run ./configure again - it's changed! #######"
813         @echo "############################################################"
814
815 help_mp.h: help/help_mp-en.h $(HELP_FILE)
816         help/help_create.sh $(HELP_FILE) $(CHARSET)
817
818 # rebuild version.h each time the working copy is updated
819 version.h: version.sh $(wildcard .svn/entries .git/logs/HEAD)
820         ./$< `$(CC) -dumpversion`
821
822 %$(EXESUF): %.c
823         $(CC) $(CC_DEPFLAGS) $(CFLAGS) -o $@ $^
824
825 %.ho: %.h
826         $(CC) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
827
828 checkheaders: $(ALLHEADERS:.h=.ho)
829
830
831
832 ###### XML documentation ######
833
834 doc: html-chunked html-single
835
836 html-chunked: $(addprefix html-chunked-,$(DOC_LANGS))
837 html-single:  $(addprefix html-single-,$(DOC_LANGS))
838
839 xmllint: $(addprefix xmllint-,$(DOC_LANGS))
840
841 define lang-def
842 html-chunked-$(lang): DOCS/HTML/$(lang)/dummy.html
843 html-single-$(lang):  DOCS/HTML/$(lang)/MPlayer.html
844 DOCS/HTML/$(lang)/dummy.html DOCS/HTML/$(lang)/MPlayer.html: DOCS/xml/$(lang)/main.xml $(wildcard DOCS/xml/$(lang)/*.xml) DOCS/xml/html-common.xsl DOCS/HTML/$(lang)/default.css
845
846 DOCS/HTML/$(lang)/default.css:
847         mkdir -p $$(@D)
848         cp -f DOCS/xml/default.css $$(@D)
849
850 DOCS/HTML/$(lang)/dummy.html:
851         SGML_CATALOG_FILES=$(CATALOG) $(XSLT_COMMAND) $$@ DOCS/xml/html-chunk.xsl $$<
852
853 DOCS/HTML/$(lang)/MPlayer.html:
854         SGML_CATALOG_FILES=$(CATALOG) $(XSLT_COMMAND) $$@ DOCS/xml/html-single.xsl $$<
855
856 xmllint-$(lang):
857         SGML_CATALOG_FILES=$(CATALOG) $(XMLLINT_COMMAND) DOCS/xml/$(lang)/main.xml
858 endef
859
860 $(foreach lang, $(DOC_LANG_ALL),$(eval $(lang-def)))
861
862
863
864 ###### dependency declarations / specific CFLAGS ######
865
866 # Make sure all generated header files are created.
867 codec-cfg.o: codecs.conf.h
868 $(DEP_FILES) $(MENCODER_DEPS) $(MPLAYER_DEPS): help_mp.h
869 mpcommon.o osdep/mplayer-rc.o gui/ui/gtk/about.o gui/win32/gui.o: version.h
870
871 osdep/mplayer-rc.o: osdep/mplayer.exe.manifest
872
873 gui/%: CFLAGS += -Wno-strict-prototypes
874
875 libdvdcss/%:   CFLAGS := -Ilibdvdcss -D_GNU_SOURCE -DVERSION=\"1.2.10\" $(CFLAGS_LIBDVDCSS) $(CFLAGS)
876 libdvdnav/%:   CFLAGS := -Ilibdvdnav -D_GNU_SOURCE -DHAVE_CONFIG_H -DVERSION=\"MPlayer-custom\" $(CFLAGS)
877 libdvdread4/%: CFLAGS := -Ilibdvdread4 -D_GNU_SOURCE $(CFLAGS_LIBDVDCSS_DVDREAD) $(CFLAGS)
878
879 loader/%: CFLAGS += -fno-omit-frame-pointer $(CFLAGS_NO_OMIT_LEAF_FRAME_POINTER)
880 #loader/%: CFLAGS += -Ddbg_printf=__vprintf -DTRACE=__vprintf -DDETAILED_OUT
881 loader/win32%: CFLAGS += $(CFLAGS_STACKREALIGN)
882
883 mp3lib/decode_i586%: CFLAGS += -fomit-frame-pointer
884
885 stream/stream_dvdnav%: CFLAGS := $(CFLAGS_LIBDVDNAV) $(CFLAGS)
886
887 tremor/%: CFLAGS += $(CFLAGS_TREMOR_LOW)
888
889 vidix/%: CFLAGS += $(CFLAGS_DHAHELPER) $(CFLAGS_SVGALIB_HELPER)
890
891 VIDIX_PCI_FILES = vidix/pci_dev_ids.c vidix/pci_ids.h vidix/pci_names.c \
892                   vidix/pci_vendors.h
893
894 $(VIDIX_PCI_FILES): vidix/pci_db2c.awk vidix/pci.db
895         awk -f $^ $(VIDIX_PCIDB)
896
897 VIDIX_OBJS = $(filter vidix/%,$(SRCS_MPLAYER:.c=.o))
898
899 $(VIDIX_OBJS): $(VIDIX_PCI_FILES)
900
901
902
903 ###### installation / clean / generic rules #######
904
905 install: $(INSTALL_TARGETS-yes)
906
907 install-dirs:
908         $(INSTALL) -d $(BINDIR) $(CONFDIR) $(LIBDIR)
909
910 install-%: %$(EXESUF) install-dirs
911         $(INSTALL) -m 755 $(INSTALLSTRIP) $< $(BINDIR)
912
913 install-gui: install-mplayer install-gui-icons
914         -ln -sf mplayer$(EXESUF) $(BINDIR)/gmplayer$(EXESUF)
915         $(INSTALL) -d $(DATADIR)/skins $(prefix)/share/applications
916         $(INSTALL) -m 644 etc/mplayer.desktop $(prefix)/share/applications/
917
918 install-gui-icons:    $(foreach size,$(GUI_ICONSIZES),install-gui-icon-$(size))
919 install-gui-man:      $(foreach lang,$(MAN_LANGS),install-gui-man-$(lang))
920 install-mencoder-man: $(foreach lang,$(MAN_LANGS),install-mencoder-man-$(lang))
921 install-mplayer-man:  $(foreach lang,$(MAN_LANGS),install-mplayer-man-$(lang))
922
923 install-gui-man-en: install-mplayer-man-en
924         cd $(MANDIR)/man1/ && ln -sf mplayer.1 gmplayer.1
925
926 install-mencoder-man-en: install-mplayer-man-en
927         cd $(MANDIR)/man1 && ln -sf mplayer.1 mencoder.1
928
929 install-mplayer-man-en:
930         $(INSTALL) -d $(MANDIR)/man1
931         $(INSTALL) -m 644 DOCS/man/en/mplayer.1 $(MANDIR)/man1/
932
933 define GUI_ICON_RULE
934 install-gui-icon-$(size):
935         $(INSTALL) -d $(prefix)/share/icons/hicolor/$(size)/apps
936         $(INSTALL) -m 644 etc/mplayer$(size).png $(prefix)/share/icons/hicolor/$(size)/apps/mplayer.png
937 endef
938
939 define GUI_MAN_RULE
940 install-gui-man-$(lang): install-mplayer-man-$(lang)
941         cd $(MANDIR)/$(lang)/man1/ && ln -sf mplayer.1 gmplayer.1
942 endef
943
944 define MENCODER_MAN_RULE
945 install-mencoder-man-$(lang): install-mplayer-man-$(lang)
946         cd $(MANDIR)/$(lang)/man1 && ln -sf mplayer.1 mencoder.1
947 endef
948
949 define MPLAYER_MAN_RULE
950 install-mplayer-man-$(lang):
951         $(INSTALL) -d $(MANDIR)/$(lang)/man1
952         $(INSTALL) -m 644 DOCS/man/$(lang)/mplayer.1 $(MANDIR)/$(lang)/man1/
953 endef
954
955 $(foreach size,$(GUI_ICONSIZES),$(eval $(GUI_ICON_RULE)))
956 $(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(GUI_MAN_RULE)))
957 $(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(MENCODER_MAN_RULE)))
958 $(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(MPLAYER_MAN_RULE)))
959
960 uninstall:
961         rm -f $(BINDIR)/mplayer$(EXESUF) $(BINDIR)/gmplayer$(EXESUF)
962         rm -f $(BINDIR)/mencoder$(EXESUF)
963         rm -f $(MANDIR)/man1/mencoder.1 $(MANDIR)/man1/mplayer.1
964         rm -f $(foreach size,$(GUI_ICONSIZES),$(prefix)/share/icons/hicolor/$(size)/apps/mplayer.png)
965         rm -f $(prefix)/share/applications/mplayer.desktop
966         rm -f $(MANDIR)/man1/mplayer.1 $(MANDIR)/man1/mencoder.1
967         rm -f $(foreach lang,$(MAN_LANGS),$(foreach man,mplayer.1 mencoder.1,$(MANDIR)/$(lang)/man1/$(man)))
968
969 clean:
970         -$(MAKE) -C ffmpeg $@
971         -rm -rf tests/res
972         -rm -f $(call ADD_ALL_DIRS,/*.o /*.a /*.ho /*~)
973         -rm -f $(call ADD_ALL_EXESUFS,mplayer mencoder)
974
975 distclean: clean testsclean toolsclean driversclean dhahelperclean
976         -$(MAKE) -C ffmpeg $@
977         -rm -rf DOCS/tech/doxygen DOCS/HTML
978         -rm -f DOCS/xml/html-chunk.xsl DOCS/xml/html-single.xsl
979         -rm -f $(call ADD_ALL_DIRS,/*.d)
980         -rm -f config.* codecs.conf.h help_mp.h version.h TAGS tags
981         -rm -f $(VIDIX_PCI_FILES)
982         -rm -f $(call ADD_ALL_EXESUFS,codec-cfg cpuinfo)
983
984 doxygen:
985         doxygen DOCS/tech/Doxyfile
986
987 TAGS:
988         rm -f $@; find . -name '*.[chS]' -o -name '*.asm' | xargs etags -a
989
990 tags:
991         rm -f $@; find . -name '*.[chS]' -o -name '*.asm' | xargs ctags -a
992
993
994
995 ###### regression tests #######
996
997 BROKEN_SAMPLES =                         \
998     h264-conformance/FM1_BT_B.h264       \
999     h264-conformance/FM1_FT_E.264        \
1000     h264-conformance/FM2_SVA_B.264       \
1001     pva/PVA_test-partial.pva             \
1002     wmv8/wmv_drm.wmv                     \
1003     wtv/law-and-order-partial.wtv        \
1004
1005 AUDIO_ONLY_SAMPLES =                                               \
1006     aac/% ac3/% amrnb/% amrwb/% atrac1/% atrac3/% bink/binkaudio%  \
1007     creative/% dts/% duck/%-audio-only.avi eac3/% gsm/% imc/%      \
1008     lossless-audio/% mp3-conformance/% musepack/% nellymoser/%     \
1009     qcp/%                                                          \
1010     qt-surge-suite/% real/ra% sipr/% truespeech/% vorbis/%         \
1011     vqf/% w64/% wmapro/% wmavoice/%                                \
1012
1013 # running wildcard with empty FATE_SAMPLES seems to cause a lot of issues
1014 ifdef FATE_SAMPLES
1015 ALLSAMPLES_FULLPATH = $(wildcard $(FATE_SAMPLES)/*/*.*)
1016 ALLSAMPLES          = $(patsubst $(FATE_SAMPLES)/%,%,$(ALLSAMPLES_FULLPATH))
1017 SAMPLES := $(filter-out $(BROKEN_SAMPLES),$(ALLSAMPLES))
1018 SAMPLES := $(filter-out $(AUDIO_ONLY_SAMPLES),$(SAMPLES))
1019 RESULTS  = $(patsubst %,tests/res/%.md5,$(SAMPLES))
1020
1021 fatetest: $(RESULTS)
1022
1023 tests/res/%.md5: mplayer$(EXESUF) $(FATE_SAMPLES)/%
1024         @tests/faterun.sh $*
1025 else
1026 fatetest:
1027         @echo "You need to set FATE_SAMPLES for fatetest to work"
1028 endif
1029
1030
1031
1032 ###### tests / tools #######
1033
1034 TEST_OBJS = mp_msg.o mp_fifo.o osdep/$(GETCH) osdep/$(TIMER) -ltermcap -lm
1035
1036 codec-cfg-test$(EXESUF): codec-cfg.c codecs.conf.h help_mp.h $(TEST_OBJS)
1037         $(CC) -I. -Iffmpeg -DTESTING -o $@ $^
1038
1039 codecs2html$(EXESUF): codec-cfg.c help_mp.h
1040         $(CC) -I. -Iffmpeg -DCODECS2HTML -o $@ $^
1041
1042 libvo/aspecttest$(EXESUF): libvo/aspect.o libvo/geometry.o $(TEST_OBJS)
1043
1044 LOADER_TEST_OBJS = $(SRCS_WIN32_EMULATION:.c=.o) $(SRCS_QTX_EMULATION:.S=.o) ffmpeg/libavutil/libavutil.a osdep/mmap_anon.o cpudetect.o path.o $(TEST_OBJS)
1045
1046 loader/qtx/list$(EXESUF) loader/qtx/qtxload$(EXESUF): CFLAGS += -g
1047 loader/qtx/list$(EXESUF) loader/qtx/qtxload$(EXESUF): $(LOADER_TEST_OBJS)
1048
1049 mp3lib/test$(EXESUF) mp3lib/test2$(EXESUF): $(SRCS_MP3LIB:.c=.o) libvo/aclib.o cpudetect.o $(TEST_OBJS)
1050
1051 TESTS = codecs2html codec-cfg-test libvo/aspecttest mp3lib/test mp3lib/test2
1052
1053 ifdef ARCH_X86_32
1054 TESTS += loader/qtx/list loader/qtx/qtxload
1055 endif
1056
1057 TESTS_DEP_FILES = $(addsuffix .d,$(TESTS))
1058
1059 tests: $(addsuffix $(EXESUF),$(TESTS))
1060
1061 testsclean:
1062         -rm -f $(call ADD_ALL_EXESUFS,$(TESTS))
1063
1064 TOOLS = $(addprefix TOOLS/,alaw-gen asfinfo avi-fix avisubdump compare dump_mp4 movinfo netstream subrip vivodump)
1065
1066 ifdef ARCH_X86
1067 TOOLS += TOOLS/fastmemcpybench TOOLS/modify_reg
1068 endif
1069
1070 ALLTOOLS = $(TOOLS) TOOLS/bmovl-test TOOLS/vfw2menc
1071
1072 TOOLS_DEP_FILES = $(addsuffix .d,$(ALLTOOLS))
1073
1074 tools: $(addsuffix $(EXESUF),$(TOOLS))
1075 alltools: $(addsuffix $(EXESUF),$(ALLTOOLS))
1076
1077 toolsclean:
1078         -rm -f $(call ADD_ALL_EXESUFS,$(ALLTOOLS))
1079         -rm -f TOOLS/realcodecs/*.so.6.0
1080
1081 TOOLS/bmovl-test$(EXESUF): -lSDL_image
1082
1083 TOOLS/subrip$(EXESUF): path.o sub/vobsub.o sub/spudec.o sub/unrar_exec.o \
1084     ffmpeg/libswscale/libswscale.a ffmpeg/libavutil/libavutil.a $(TEST_OBJS)
1085
1086 TOOLS/vfw2menc$(EXESUF): -lwinmm -lole32
1087
1088 mplayer-nomain.o: mplayer.c
1089         $(CC) $(CFLAGS) -DDISABLE_MAIN -c -o $@ $<
1090
1091 TOOLS/netstream$(EXESUF): TOOLS/netstream.c
1092 TOOLS/vivodump$(EXESUF): TOOLS/vivodump.c
1093 TOOLS/netstream$(EXESUF) TOOLS/vivodump$(EXESUF): $(subst mplayer.o,mplayer-nomain.o,$(OBJS_MPLAYER)) $(filter-out %mencoder.o,$(OBJS_MENCODER)) $(OBJS_COMMON) $(COMMON_LIBS)
1094         $(CC) $(CC_DEPFLAGS) $(CFLAGS) -o $@ $^ $(EXTRALIBS_MPLAYER) $(EXTRALIBS_MENCODER) $(EXTRALIBS)
1095
1096 REAL_SRCS    = $(wildcard TOOLS/realcodecs/*.c)
1097 REAL_TARGETS = $(REAL_SRCS:.c=.so.6.0)
1098
1099 realcodecs: $(REAL_TARGETS)
1100 realcodecs: CFLAGS += -g
1101
1102 %.so.6.0: %.o
1103         ld -shared -o $@ $< -ldl -lc
1104
1105
1106
1107 ###### drivers #######
1108
1109 KERNEL_INC = /lib/modules/`uname -r`/build/include
1110 KERNEL_VERSION = $(shell grep RELEASE $(KERNEL_INC)/linux/version.h | cut -d'"' -f2)
1111 KERNEL_CFLAGS = -O2 -D__KERNEL__ -DMODULE -Wall -I$(KERNEL_INC) -include $(KERNEL_INC)/linux/modversions.h
1112 KERNEL_OBJS = $(addprefix drivers/, mga_vid.o tdfx_vid.o radeon_vid.o rage128_vid.o)
1113 MODULES_DIR = /lib/modules/$(KERNEL_VERSION)/misc
1114 DRIVER_OBJS = $(KERNEL_OBJS) drivers/mga_vid_test drivers/tdfx_vid_test
1115 DRIVER_DEP_FILES = $(KERNEL_OBJS:.o=.d) drivers/mga_vid_test.d drivers/tdfx_vid_test.d
1116
1117 drivers: $(DRIVER_OBJS)
1118
1119 $(DRIVER_OBJS): CFLAGS = $(KERNEL_CFLAGS)
1120 drivers/radeon_vid.o drivers/rage128_vid.o: CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -fno-common -ffast-math
1121
1122 install-drivers: $(DRIVER_OBJS)
1123         -mkdir -p $(MODULES_DIR)
1124         $(INSTALL) -m 644 $(KERNEL_OBJS) $(MODULES_DIR)
1125         depmod -a
1126         -mknod /dev/mga_vid    c 178 0
1127         -mknod /dev/tdfx_vid   c 178 0
1128         -mknod /dev/radeon_vid c 178 0
1129         -ln -s /dev/radeon_vid /dev/rage128_vid
1130
1131 driversclean:
1132         -rm -f $(DRIVER_OBJS) drivers/*~
1133
1134 DHAHELPER_DEP_FILES = vidix/dhahelper/dhahelper.d vidix/dhahelper/test.d vidix/dhahelperwin/dhahelper.d vidix/dhahelperwin/dhasetup.d
1135 dhahelper: vidix/dhahelper/dhahelper.o vidix/dhahelper/test
1136
1137 vidix/dhahelper/dhahelper.o vidix/dhahelper/test: CFLAGS = $(KERNEL_CFLAGS)
1138
1139 install-dhahelper: vidix/dhahelper/dhahelper.o
1140         -mkdir -p $(MODULES_DIR)
1141         $(INSTALL) -m 644 $< $(MODULES_DIR)
1142         depmod -a
1143         -mknod /dev/dhahelper c 180 0
1144
1145 dhahelperwin: vidix/dhahelperwin/dhasetup.exe vidix/dhahelperwin/dhahelper.sys
1146
1147 vidix/dhahelperwin/dhahelper-rc.o: vidix/dhahelperwin/common.ver vidix/dhahelperwin/ntverp.h
1148
1149 vidix/dhahelperwin/base.tmp: vidix/dhahelperwin/dhahelper.o vidix/dhahelperwin/dhahelper-rc.o
1150         $(CC) -Wl,--base-file,$@ -Wl,--entry,_DriverEntry@8 -nostartfiles \
1151             -nostdlib -o $(@D)/junk.tmp $^ -lntoskrnl
1152         -rm -f $(@D)/junk.tmp
1153
1154 vidix/dhahelperwin/temp.exp: vidix/dhahelperwin/base.tmp
1155         dlltool --dllname $(@D)/dhahelper.sys --base-file $< --output-exp $@
1156
1157 vidix/dhahelperwin/dhahelper.sys: vidix/dhahelperwin/temp.exp vidix/dhahelperwin/dhahelper.o vidix/dhahelperwin/dhahelper-rc.o
1158         $(CC) -Wl,--subsystem,native -Wl,--image-base,0x10000 \
1159             -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 \
1160             -Wl,--entry,_DriverEntry@8 -Wl,$< -mdll -nostartfiles -nostdlib \
1161             -o $@ $(@:.sys=.o) $(@:.sys=-rc.o) -lntoskrnl
1162         strip $@
1163
1164 install-dhahelperwin:
1165         vidix/dhahelperwin/dhasetup.exe install
1166
1167 dhahelperclean:
1168         -rm -f vidix/dhahelper/*.o vidix/dhahelper/*~ vidix/dhahelper/test
1169         -rm -f $(addprefix vidix/dhahelperwin/,*.o *~ dhahelper.sys dhasetup.exe base.tmp temp.exp)
1170
1171
1172 -include $(DEP_FILES) $(DRIVER_DEP_FILES) $(TESTS_DEP_FILES) $(TOOLS_DEP_FILES) $(DHAHELPER_DEP_FILES)
1173
1174 .PHONY: all doxygen *install* *tools drivers dhahelper*
1175 .PHONY: checkheaders *clean tests check_checksums fatetest
1176 .PHONY: doc html-chunked* html-single* xmllint*
1177
1178 # Disable suffix rules.  Most of the builtin rules are suffix rules,
1179 # so this saves some time on slow systems.
1180 .SUFFIXES: