1 # LINUX Makefile made by A'rpi / Astral
2 # Some cleanup by LGB: * 'make -C dir' instead of 'cd dir;make;cd..'
3 # * for loops instead of linear sequence of make directories
4 # * some minor problems with make clean and distclean were corrected
10 ifeq ($(CONFIG_LIBAVUTIL
),yes
)
11 LIBAV_INC
+= -I.
/libavutil
13 ifeq ($(CONFIG_LIBAVCODEC
),yes
)
14 LIBAV_INC
+= -I.
/libavcodec
17 CFLAGS
= $(OPTFLAGS
) -I.
$(LIBAV_INC
)
21 # Do not strip the binaries at installation
22 ifeq ($(STRIPBINARIES
),yes
)
26 SRCS_COMMON
= asxparser.c \
42 ifeq ($(UNRARLIB
),yes
)
43 SRCS_COMMON
+= unrarlib.c
46 SRCS_MENCODER
= mencoder.c \
55 ifeq ($(BITMAP_FONT
),yes
)
56 SRCS_MENCODER
+= libvo
/font_load.c
59 SRCS_MPLAYER
= mplayer.c \
67 OBJS_MENCODER
= $(SRCS_MENCODER
:.c
=.o
)
68 OBJS_MPLAYER
= $(SRCS_MPLAYER
:.c
=.o
)
80 VO_LIBS
+= vidix
/libvidix.a
82 ifeq ($(EXTERNAL_VIDIX
),yes
)
83 VO_LIBS
+= $(EXTERNAL_VIDIX_LIB
)
86 AO_LIBS
= $(ARTS_LIB
) \
94 CODEC_LIBS
= $(AV_LIB
) \
114 ifeq ($(LAVC_MP3LAME
),yes
)
115 CODEC_LIBS
+= $(MP3LAME_LIB
)
118 ifeq ($(TOOLAME
),yes
)
119 CODEC_LIBS
+= $(TOOLAME_LIB
)
122 ifeq ($(TWOLAME
),yes
)
123 CODEC_LIBS
+= $(TWOLAME_LIB
)
127 CODEC_LIBS
+= $(FAAC_LIB
)
130 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a \
133 libmpdemux
/libmpdemux.a \
135 libswscale
/libswscale.a \
143 $(MPLAYER_NETWORK_LIB
) \
148 $(MACOSX_FRAMEWORKS
) \
179 ifeq ($(LIBMPEG2
),yes
)
182 ifeq ($(FAAD_INTERNAL
),yes
)
183 COMMON_LIBS
+= libfaad2
/libfaad2.a
187 PARTS
+= libdha vidix
192 ifeq ($(DVDKIT2
),yes
)
193 PARTS
+= libmpdvdkit2
199 PARTS
+= loader loader
/dshow loader
/dmo
201 ifeq ($(LIBMENU
),yes
)
204 ifeq ($(TREMOR_INTERNAL
),yes
)
209 ifeq ($(MENCODER
),yes
)
210 ALL_PRG
+= $(PRG_MENCODER
)
213 COMMON_DEPS
= $(W32_DEP
) \
215 libmpdemux
/libmpdemux.a \
217 libmpcodecs
/libmpcodecs.a \
220 libswscale
/libswscale.a \
226 COMMON_DEPS
+= mp3lib
/libMP3.a
227 COMMON_LIBS
+= mp3lib
/libMP3.a
230 COMMON_DEPS
+= liba52
/liba52.a
231 COMMON_LIBS
+= liba52
/liba52.a
233 ifeq ($(LIBMPEG2
),yes
)
234 COMMON_DEPS
+= libmpeg2
/libmpeg2.a
235 COMMON_LIBS
+= libmpeg2
/libmpeg2.a
237 ifeq ($(FAAD_INTERNAL
),yes
)
238 COMMON_DEPS
+= libfaad2
/libfaad2.a
240 ifeq ($(TREMOR_INTERNAL
),yes
)
241 COMMON_DEPS
+= tremor
/libvorbisidec.a
242 COMMON_LIBS
+= tremor
/libvorbisidec.a
245 COMMON_DEPS
+= libdha
/libdha.so vidix
/libvidix.a
248 COMMON_DEPS
+= libfame
/libfame.a
250 ifeq ($(DVDKIT2
),yes
)
251 COMMON_DEPS
+= libmpdvdkit2
/libmpdvdkit.a
253 ifeq ($(CONFIG_ASS
),yes
)
254 COMMON_DEPS
+= libass
/libass.a
255 COMMON_LIBS
+= libass
/libass.a
258 # FontConfig and FreeType need to come after ASS to avoid link failures on MinGW
259 COMMON_LIBS
+= $(FONTCONFIG_LIB
)
260 ifeq ($(FREETYPE
),yes
)
261 SRCS_MENCODER
+= libvo
/font_load_ft.c
262 COMMON_LIBS
+= $(FREETYPE_LIB
)
265 COMMON_DEPS
+= Gui
/libgui.a
266 GUI_LIBS
= Gui
/libgui.a
$(GTK_LIBS
)
271 #.PHONY: $(COMMON_DEPS)
276 $(CC
) -c
$(CFLAGS
) -o
$@
$<
281 libmpdvdkit2
/libmpdvdkit.a
:
282 $(MAKE
) -C libmpdvdkit2
293 libmpdemux
/libmpdemux.a
:
294 $(MAKE
) -C libmpdemux
299 libmpcodecs
/libmpcodecs.a
:
300 $(MAKE
) -C libmpcodecs
302 loader
/dshow
/libDS_Filter.a
:
303 $(MAKE
) -C loader
/dshow
305 loader
/dmo
/libDMO_Filter.a
:
306 $(MAKE
) -C loader
/dmo
308 libavutil
/libavutil.a
:
309 $(MAKE
) -C libavutil LIBPREF
=lib LIBSUF
=.a
311 libavcodec
/libavcodec.a
:
312 $(MAKE
) -C libavcodec LIBPREF
=lib LIBSUF
=.a
314 libpostproc
/libpostproc.a
:
315 $(MAKE
) -C libpostproc LIBPREF
=lib LIBSUF
=.a
317 libavformat
/libavformat.a
:
318 $(MAKE
) -C libavformat LIBPREF
=lib LIBSUF
=.a
320 libswscale
/libswscale.a
:
321 $(MAKE
) -C libswscale LIBPREF
=lib LIBSUF
=.a
341 tremor
/libvorbisidec.a
:
347 vidix
/libvidix.a
: libdha
/libdha.so
362 MPLAYER_DEP
= $(OBJS_MPLAYER
) $(COMMON_DEPS
)
364 ifeq ($(LIBMENU
),yes
)
365 MPLAYER_DEP
+= libmenu
/libmenu.a
366 MENU_LIBS
= libmenu
/libmenu.a
370 MENCODER_DEP
= $(OBJS_MENCODER
) $(COMMON_DEPS
) libmpcodecs
/libmpencoders.a
372 ifeq ($(TARGET_WIN32
),yes
)
373 OBJS_MPLAYER
+= osdep
/mplayer-rc.o
376 LIBS_MPLAYER
= libvo
/libvo.a \
386 $(PRG
): $(MPLAYER_DEP
)
387 ifeq ($(TARGET_WIN32
),yes
)
388 windres
-o osdep
/mplayer-rc.o osdep
/mplayer.rc
390 $(CC
) $(CFLAGS
) -o
$(PRG
) $(OBJS_MPLAYER
) $(LIBS_MPLAYER
)
392 ifeq ($(MENCODER
),yes
)
393 LIBS_MENCODER
= libmpcodecs
/libmpencoders.a \
397 $(PRG_MENCODER
): $(MENCODER_DEP
)
398 $(CC
) $(CFLAGS
) -o
$(PRG_MENCODER
) $(OBJS_MENCODER
) $(LIBS_MENCODER
)
401 codec-cfg
: codec-cfg.c codec-cfg.h help_mp.h
402 $(HOST_CC
) -I.
-DCODECS2HTML codec-cfg.c
-o
$@
404 codecs.conf.h
: codec-cfg etc
/codecs.conf
405 .
/codec-cfg .
/etc
/codecs.conf
> $@
407 codec-cfg.o
: codecs.conf.h
409 codecs2html
: mp_msg.o
410 $(CC
) -DCODECS2HTML codec-cfg.c mp_msg.o
-o
$@
414 $(MAKE
) -C libdha
install
415 $(MAKE
) -C vidix
install
417 $(INSTALL
) -d
$(BINDIR
)
418 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG
) $(BINDIR
)/$(PRG
)
420 -ln
-sf
$(PRG
) $(BINDIR
)/gmplayer
422 $(INSTALL
) -d
$(MANDIR
)/man1
423 for i in
$(MAN_LANG
); do \
424 if
test "$$i" = en
; then \
425 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/mplayer
.1 ; \
427 $(INSTALL
) -d
$(MANDIR
)/$$i/man1
; \
428 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/mplayer
.1 ; \
431 ifeq ($(MENCODER
),yes
)
432 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG_MENCODER
) $(BINDIR
)/$(PRG_MENCODER
)
433 for i in
$(MAN_LANG
); do \
434 if
test "$$i" = en
; then \
435 cd
$(MANDIR
)/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
437 cd
$(MANDIR
)/$$i/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
441 @
$(INSTALL
) -d
$(DATADIR
)
442 @
$(INSTALL
) -d
$(DATADIR
)/font
443 @if
test ! -f
$(DATADIR
)/font
/font.desc
; then \
444 echo
"*** Download font at http://www.mplayerhq.hu/dload.html" ; \
445 echo
"*** for OSD/Subtitles support and extract to $(DATADIR)/font/" ; \
448 @
$(INSTALL
) -d
$(DATADIR
)/skins
449 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/dload.html"
450 @echo
"*** for GUI, and extract to $(DATADIR)/skins/"
451 @
$(INSTALL
) -d
$(prefix)/share
/pixmaps
452 $(INSTALL
) -m
644 etc
/mplayer.xpm
$(prefix)/share
/pixmaps
/mplayer.xpm
453 @
$(INSTALL
) -d
$(prefix)/share
/applications
454 $(INSTALL
) -m
644 etc
/mplayer.desktop
$(prefix)/share
/applications
/mplayer.desktop
456 @
$(INSTALL
) -d
$(CONFDIR
)
457 @if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
460 -rm -f
$(BINDIR
)/$(PRG
) $(BINDIR
)/gmplayer
$(MANDIR
)/man1
/mplayer
.1
461 -rm -f
$(BINDIR
)/$(PRG_MENCODER
) $(MANDIR
)/man1
/mencoder
.1
462 -rm -f
$(prefix)/share
/pixmaps
/mplayer.xpm
463 -rm -f
$(prefix)/share
/applications
/mplayer.desktop
464 for l in
$(MAN_LANG
); do \
465 if
test "$$l" != "en"; then \
466 rm -f
$(MANDIR
)/$$l/man1
/mplayer
.1 \
467 $(MANDIR
)/$$l/man1
/mencoder
.1 \
468 $(MANDIR
)/$$l/man1
/gmplayer
.1 ; \
472 $(MAKE
) -C libdha
uninstall
473 $(MAKE
) -C vidix
uninstall
475 @echo
"Uninstall completed"
481 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a clean; done
483 distclean: clean doxygen_clean
484 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
485 -rm -f
*~
$(PRG
) $(PRG_MENCODER
) codec-cfg codecs2html codecs.conf.h \
486 .depend configure.log config.mak config.h help_mp.h version.h
493 depend
: help_mp.h version.h
494 $(CC
) -MM
$(CFLAGS
) -DCODECS2HTML mplayer.c mencoder.c
$(SRCS_MPLAYER
) $(SRCS_MENCODER
) 1>.depend
495 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
497 # ./configure must be rerun if it changed
499 @echo
"############################################################"
500 @echo
"####### Please run ./configure again - it's changed! #######"
501 @echo
"############################################################"
503 # rebuild at every config.h/config.mak/Makefile change:
504 version.h
: config.h config.mak Makefile
505 .
/version.sh
`$(CC) -dumpversion`
508 doxygen DOCS
/tech
/Doxyfile
511 -rm -rf DOCS
/tech
/doxygen
513 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
514 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
515 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
517 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
519 iconv
-f
`cat $(HELP_FILE).charset` -t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
522 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
523 @echo
"Adding untranslated messages to help_mp.h"
524 @echo
'// untranslated messages from the English master file:' >> help_mp.h
525 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
528 # explicit dependencies to force version.h to be built even if .depend is missing
529 mplayer.o mencoder.o vobsub.o
: version.h
531 # temporary measure to make sure help_mp.h is built. we desperately need correct deps!
532 $(MPLAYER_DEP
) $(MENCODER_DEP
): help_mp.h
535 # the following lines provide _partial_ dependency information
536 # for the 'library' directories under main dir, in order to cause
537 # the build process to recursively descend into them if something
538 # has changed. ideally this will be replaced with a single
539 # nonrecursive makefile for the whole project.
541 # Now all directories are recursed by default because these rules do not
542 # consider dependencies on files in other directories, while the recursively
543 # invoked Makefiles do. Conditional recursion only to the directories with
544 # changed files can be enabled by creating a file named ".norecurse" and
545 # optionally giving it a timestamp in the past. Directories whose .a files
546 # are newer than the timestamp and newer than other files in the directory
547 # will not be recursed.
550 libvo
/libvo.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
551 libao2
/libao2.a
: .norecurse
$(wildcard libao2
/*.
[ch
])
552 osdep
/libosdep.a
: .norecurse
$(wildcard osdep
/*.
[ch
])
553 input
/libinput.a
: .norecurse
$(wildcard input
/*.
[ch
])
555 libmenu
/libmenu.a
: .norecurse
$(wildcard libmenu
/*.
[ch
])
556 libaf
/libaf.a
: .norecurse
$(wildcard libaf
/*.
[ch
])
557 libmpdvdkit2
/libmpdvdkit.a
: .norecurse
$(wildcard libmpdvdkit2
/*.
[ch
])
559 libmpdemux
/libmpdemux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
] libmpdemux
/*/*.
[ch
])
560 stream
/stream.a
: .norecurse
$(wildcard stream
/*.
[ch
] stream
/*/*.
[ch
])
561 libmpcodecs
/libmpcodecs.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
]) $(wildcard libmpcodecs
/native
/*.
[ch
])
562 libmpcodecs
/libmpencoders.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
])
564 libavutil
/libavutil.a
: .norecurse
$(wildcard libavutil
/*.
[ch
])
565 libavcodec
/libavcodec.a
: .norecurse
$(wildcard libavcodec
/*.
[ch
] libavcodec
/*/*.
[chS
])
566 libavformat
/libavformat.a
: .norecurse
$(wildcard libavformat
/*.
[ch
])
567 libswscale
/libswscale.a
: .norecurse
$(wildcard libswscale
/*.
[ch
])
569 libmpeg2
/libmpeg2.a
: .norecurse
$(wildcard libmpeg2
/*.
[ch
])
570 liba52
/liba52.a
: .norecurse
$(wildcard liba52
/*.
[ch
])
571 mp3lib
/libMP3.a
: .norecurse
$(wildcard mp3lib
/*.
[ch
])
572 libfaad2
/libfaad2.a
: .norecurse
$(wildcard libfaad2
/*.
[ch
] libfaad2
/*/*.
[ch
])
574 loader
/libloader.a
: .norecurse
$(wildcard loader
/*.
[chSs
])
575 loader
/dmo
/libDMO_Filter.a
: .norecurse
$(wildcard loader
/dmo
/*.
[ch
])
576 loader
/dshow
/libDS_Filter.a
: .norecurse
$(wildcard loader
/dshow
/*.
[ch
])
578 libdha
/libdha.so
: .norecurse
$(wildcard libdha
/*.
[ch
])
579 vidix
/libvidix.a
: .norecurse
$(wildcard vidix
/*.
[ch
])
580 Gui
/libgui.a
: .norecurse
$(wildcard Gui
/*.
[ch
] Gui
/*/*.
[ch
] Gui
/*/*/*.
[ch
])
582 libass
/libass.a
: .norecurse
$(wildcard libass
/*.
[ch
])
585 # include dependency files if they exist
587 ifneq ($(wildcard .depend
),)