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
) \
115 ifeq ($(TOOLAME
),yes
)
116 CODEC_LIBS
+= $(TOOLAME_LIB
)
119 ifeq ($(TWOLAME
),yes
)
120 CODEC_LIBS
+= $(TWOLAME_LIB
)
124 CODEC_LIBS
+= $(FAAC_LIB
)
127 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a \
130 libmpdemux
/libmpdemux.a \
132 libswscale
/libswscale.a \
140 $(MPLAYER_NETWORK_LIB
) \
145 $(MACOSX_FRAMEWORKS
) \
176 ifeq ($(LIBMPEG2
),yes
)
179 ifeq ($(FAAD_INTERNAL
),yes
)
180 COMMON_LIBS
+= libfaad2
/libfaad2.a
184 PARTS
+= libdha vidix
189 ifeq ($(DVDKIT2
),yes
)
190 PARTS
+= libmpdvdkit2
196 PARTS
+= loader loader
/dshow loader
/dmo
198 ifeq ($(LIBMENU
),yes
)
201 ifeq ($(TREMOR_INTERNAL
),yes
)
206 ifeq ($(MENCODER
),yes
)
207 ALL_PRG
+= $(PRG_MENCODER
)
210 COMMON_DEPS
= $(W32_DEP
) \
212 libmpdemux
/libmpdemux.a \
214 libmpcodecs
/libmpcodecs.a \
217 libswscale
/libswscale.a \
223 COMMON_DEPS
+= mp3lib
/libMP3.a
224 COMMON_LIBS
+= mp3lib
/libMP3.a
227 COMMON_DEPS
+= liba52
/liba52.a
228 COMMON_LIBS
+= liba52
/liba52.a
230 ifeq ($(LIBMPEG2
),yes
)
231 COMMON_DEPS
+= libmpeg2
/libmpeg2.a
232 COMMON_LIBS
+= libmpeg2
/libmpeg2.a
234 ifeq ($(FAAD_INTERNAL
),yes
)
235 COMMON_DEPS
+= libfaad2
/libfaad2.a
237 ifeq ($(TREMOR_INTERNAL
),yes
)
238 COMMON_DEPS
+= tremor
/libvorbisidec.a
239 COMMON_LIBS
+= tremor
/libvorbisidec.a
242 COMMON_DEPS
+= libdha
/libdha.so vidix
/libvidix.a
245 COMMON_DEPS
+= libfame
/libfame.a
247 ifeq ($(DVDKIT2
),yes
)
248 COMMON_DEPS
+= libmpdvdkit2
/libmpdvdkit.a
250 ifeq ($(CONFIG_ASS
),yes
)
251 COMMON_DEPS
+= libass
/libass.a
252 COMMON_LIBS
+= libass
/libass.a
255 # FontConfig and FreeType need to come after ASS to avoid link failures on MinGW
256 COMMON_LIBS
+= $(FONTCONFIG_LIB
)
257 ifeq ($(FREETYPE
),yes
)
258 SRCS_MENCODER
+= libvo
/font_load_ft.c
259 COMMON_LIBS
+= $(FREETYPE_LIB
)
262 COMMON_DEPS
+= Gui
/libgui.a
263 GUI_LIBS
= Gui
/libgui.a
$(GTK_LIBS
)
268 #.PHONY: $(COMMON_DEPS)
273 $(CC
) -c
$(CFLAGS
) -o
$@
$<
278 libmpdvdkit2
/libmpdvdkit.a
:
279 $(MAKE
) -C libmpdvdkit2
290 libmpdemux
/libmpdemux.a
:
291 $(MAKE
) -C libmpdemux
296 libmpcodecs
/libmpcodecs.a
:
297 $(MAKE
) -C libmpcodecs
299 loader
/dshow
/libDS_Filter.a
:
300 $(MAKE
) -C loader
/dshow
302 loader
/dmo
/libDMO_Filter.a
:
303 $(MAKE
) -C loader
/dmo
305 libavutil
/libavutil.a
:
306 $(MAKE
) -C libavutil LIBPREF
=lib LIBSUF
=.a
308 libavcodec
/libavcodec.a
:
309 $(MAKE
) -C libavcodec LIBPREF
=lib LIBSUF
=.a
311 libpostproc
/libpostproc.a
:
312 $(MAKE
) -C libpostproc LIBPREF
=lib LIBSUF
=.a
314 libavformat
/libavformat.a
:
315 $(MAKE
) -C libavformat LIBPREF
=lib LIBSUF
=.a
317 libswscale
/libswscale.a
:
318 $(MAKE
) -C libswscale LIBPREF
=lib LIBSUF
=.a
338 tremor
/libvorbisidec.a
:
344 vidix
/libvidix.a
: libdha
/libdha.so
359 MPLAYER_DEP
= $(OBJS_MPLAYER
) $(COMMON_DEPS
)
361 ifeq ($(LIBMENU
),yes
)
362 MPLAYER_DEP
+= libmenu
/libmenu.a
363 MENU_LIBS
= libmenu
/libmenu.a
367 MENCODER_DEP
= $(OBJS_MENCODER
) $(COMMON_DEPS
) libmpcodecs
/libmpencoders.a
369 ifeq ($(TARGET_WIN32
),yes
)
370 OBJS_MPLAYER
+= osdep
/mplayer-rc.o
373 LIBS_MPLAYER
= libvo
/libvo.a \
383 $(PRG
): $(MPLAYER_DEP
)
384 ifeq ($(TARGET_WIN32
),yes
)
385 windres
-o osdep
/mplayer-rc.o osdep
/mplayer.rc
387 $(CC
) $(CFLAGS
) -o
$(PRG
) $(OBJS_MPLAYER
) $(LIBS_MPLAYER
)
389 ifeq ($(MENCODER
),yes
)
390 LIBS_MENCODER
= libmpcodecs
/libmpencoders.a \
394 $(PRG_MENCODER
): $(MENCODER_DEP
)
395 $(CC
) $(CFLAGS
) -o
$(PRG_MENCODER
) $(OBJS_MENCODER
) $(LIBS_MENCODER
)
398 codec-cfg
: codec-cfg.c codec-cfg.h help_mp.h
399 $(HOST_CC
) -I.
-DCODECS2HTML codec-cfg.c
-o
$@
401 codecs.conf.h
: codec-cfg etc
/codecs.conf
402 .
/codec-cfg .
/etc
/codecs.conf
> $@
404 codec-cfg.o
: codecs.conf.h
406 codecs2html
: mp_msg.o
407 $(CC
) -DCODECS2HTML codec-cfg.c mp_msg.o
-o
$@
411 $(MAKE
) -C libdha
install
412 $(MAKE
) -C vidix
install
414 $(INSTALL
) -d
$(BINDIR
)
415 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG
) $(BINDIR
)/$(PRG
)
417 -ln
-sf
$(PRG
) $(BINDIR
)/gmplayer
419 $(INSTALL
) -d
$(MANDIR
)/man1
420 for i in
$(MAN_LANG
); do \
421 if
test "$$i" = en
; then \
422 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/mplayer
.1 ; \
424 $(INSTALL
) -d
$(MANDIR
)/$$i/man1
; \
425 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/mplayer
.1 ; \
428 ifeq ($(MENCODER
),yes
)
429 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG_MENCODER
) $(BINDIR
)/$(PRG_MENCODER
)
430 for i in
$(MAN_LANG
); do \
431 if
test "$$i" = en
; then \
432 cd
$(MANDIR
)/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
434 cd
$(MANDIR
)/$$i/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
438 @
$(INSTALL
) -d
$(DATADIR
)
439 @
$(INSTALL
) -d
$(DATADIR
)/font
440 @if
test ! -f
$(DATADIR
)/font
/font.desc
; then \
441 echo
"*** Download font at http://www.mplayerhq.hu/dload.html" ; \
442 echo
"*** for OSD/Subtitles support and extract to $(DATADIR)/font/" ; \
445 @
$(INSTALL
) -d
$(DATADIR
)/skins
446 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/dload.html"
447 @echo
"*** for GUI, and extract to $(DATADIR)/skins/"
448 @
$(INSTALL
) -d
$(prefix)/share
/pixmaps
449 $(INSTALL
) -m
644 etc
/mplayer.xpm
$(prefix)/share
/pixmaps
/mplayer.xpm
450 @
$(INSTALL
) -d
$(prefix)/share
/applications
451 $(INSTALL
) -m
644 etc
/mplayer.desktop
$(prefix)/share
/applications
/mplayer.desktop
453 @
$(INSTALL
) -d
$(CONFDIR
)
454 @if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
457 -rm -f
$(BINDIR
)/$(PRG
) $(BINDIR
)/gmplayer
$(MANDIR
)/man1
/mplayer
.1
458 -rm -f
$(BINDIR
)/$(PRG_MENCODER
) $(MANDIR
)/man1
/mencoder
.1
459 -rm -f
$(prefix)/share
/pixmaps
/mplayer.xpm
460 -rm -f
$(prefix)/share
/applications
/mplayer.desktop
461 for l in
$(MAN_LANG
); do \
462 if
test "$$l" != "en"; then \
463 rm -f
$(MANDIR
)/$$l/man1
/mplayer
.1 \
464 $(MANDIR
)/$$l/man1
/mencoder
.1 \
465 $(MANDIR
)/$$l/man1
/gmplayer
.1 ; \
469 $(MAKE
) -C libdha
uninstall
470 $(MAKE
) -C vidix
uninstall
472 @echo
"Uninstall completed"
478 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a clean; done
480 distclean: clean doxygen_clean
481 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
482 -rm -f
*~
$(PRG
) $(PRG_MENCODER
) codec-cfg codecs2html codecs.conf.h \
483 .depend configure.log config.mak config.h help_mp.h version.h
490 depend
: help_mp.h version.h
491 $(CC
) -MM
$(CFLAGS
) -DCODECS2HTML mplayer.c mencoder.c
$(SRCS_MPLAYER
) $(SRCS_MENCODER
) 1>.depend
492 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
494 # ./configure must be rerun if it changed
496 @echo
"############################################################"
497 @echo
"####### Please run ./configure again - it's changed! #######"
498 @echo
"############################################################"
500 # rebuild at every config.h/config.mak/Makefile change:
501 version.h
: config.h config.mak Makefile
502 .
/version.sh
`$(CC) -dumpversion`
505 doxygen DOCS
/tech
/Doxyfile
508 -rm -rf DOCS
/tech
/doxygen
510 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
511 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
512 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
514 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
516 iconv
-f
`cat $(HELP_FILE).charset` -t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
519 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
520 @echo
"Adding untranslated messages to help_mp.h"
521 @echo
'// untranslated messages from the English master file:' >> help_mp.h
522 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
525 # explicit dependencies to force version.h to be built even if .depend is missing
526 mplayer.o mencoder.o vobsub.o
: version.h
528 # temporary measure to make sure help_mp.h is built. we desperately need correct deps!
529 $(MPLAYER_DEP
) $(MENCODER_DEP
): help_mp.h
532 # the following lines provide _partial_ dependency information
533 # for the 'library' directories under main dir, in order to cause
534 # the build process to recursively descend into them if something
535 # has changed. ideally this will be replaced with a single
536 # nonrecursive makefile for the whole project.
538 # Now all directories are recursed by default because these rules do not
539 # consider dependencies on files in other directories, while the recursively
540 # invoked Makefiles do. Conditional recursion only to the directories with
541 # changed files can be enabled by creating a file named ".norecurse" and
542 # optionally giving it a timestamp in the past. Directories whose .a files
543 # are newer than the timestamp and newer than other files in the directory
544 # will not be recursed.
547 libvo
/libvo.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
548 libao2
/libao2.a
: .norecurse
$(wildcard libao2
/*.
[ch
])
549 osdep
/libosdep.a
: .norecurse
$(wildcard osdep
/*.
[ch
])
550 input
/libinput.a
: .norecurse
$(wildcard input
/*.
[ch
])
552 libmenu
/libmenu.a
: .norecurse
$(wildcard libmenu
/*.
[ch
])
553 libaf
/libaf.a
: .norecurse
$(wildcard libaf
/*.
[ch
])
554 libmpdvdkit2
/libmpdvdkit.a
: .norecurse
$(wildcard libmpdvdkit2
/*.
[ch
])
556 libmpdemux
/libmpdemux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
] libmpdemux
/*/*.
[ch
])
557 stream
/stream.a
: .norecurse
$(wildcard stream
/*.
[ch
] stream
/*/*.
[ch
])
558 libmpcodecs
/libmpcodecs.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
]) $(wildcard libmpcodecs
/native
/*.
[ch
])
559 libmpcodecs
/libmpencoders.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
])
561 libavutil
/libavutil.a
: .norecurse
$(wildcard libavutil
/*.
[ch
])
562 libavcodec
/libavcodec.a
: .norecurse
$(wildcard libavcodec
/*.
[ch
] libavcodec
/*/*.
[chS
])
563 libavformat
/libavformat.a
: .norecurse
$(wildcard libavformat
/*.
[ch
])
564 libswscale
/libswscale.a
: .norecurse
$(wildcard libswscale
/*.
[ch
])
566 libmpeg2
/libmpeg2.a
: .norecurse
$(wildcard libmpeg2
/*.
[ch
])
567 liba52
/liba52.a
: .norecurse
$(wildcard liba52
/*.
[ch
])
568 mp3lib
/libMP3.a
: .norecurse
$(wildcard mp3lib
/*.
[ch
])
569 libfaad2
/libfaad2.a
: .norecurse
$(wildcard libfaad2
/*.
[ch
] libfaad2
/*/*.
[ch
])
571 loader
/libloader.a
: .norecurse
$(wildcard loader
/*.
[chSs
])
572 loader
/dmo
/libDMO_Filter.a
: .norecurse
$(wildcard loader
/dmo
/*.
[ch
])
573 loader
/dshow
/libDS_Filter.a
: .norecurse
$(wildcard loader
/dshow
/*.
[ch
])
575 libdha
/libdha.so
: .norecurse
$(wildcard libdha
/*.
[ch
])
576 vidix
/libvidix.a
: .norecurse
$(wildcard vidix
/*.
[ch
])
577 Gui
/libgui.a
: .norecurse
$(wildcard Gui
/*.
[ch
] Gui
/*/*.
[ch
] Gui
/*/*/*.
[ch
])
579 libass
/libass.a
: .norecurse
$(wildcard libass
/*.
[ch
])
582 # include dependency files if they exist
584 ifneq ($(wildcard .depend
),)