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