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 # Do not strip the binaries at installation
18 ifeq ($(STRIPBINARIES
),yes
)
22 SRCS_COMMON
= asxparser.c \
38 SRCS_MENCODER
= mencoder.c \
48 SRCS_MPLAYER
= mplayer.c \
56 ifeq ($(UNRARLIB
),yes
)
57 SRCS_COMMON
+= unrarlib.c
60 OBJS_MENCODER
= $(SRCS_MENCODER
:.c
=.o
)
61 OBJS_MPLAYER
= $(SRCS_MPLAYER
:.c
=.o
)
73 ifeq ($(EXTERNAL_VIDIX
),yes
)
74 VO_LIBS
+= $(EXTERNAL_VIDIX_LIB
)
77 AO_LIBS
= $(ARTS_LIB
) \
85 CODEC_LIBS
= $(AV_LIB
) \
104 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a \
107 libmpdemux
/libmpdemux.a \
109 libswscale
/libswscale.a \
116 $(MPLAYER_NETWORK_LIB
) \
120 $(MACOSX_FRAMEWORKS
) \
125 CFLAGS
= $(OPTFLAGS
) -I.
$(LIBAV_INC
)
129 ifeq ($(TOOLAME
),yes
)
130 CFLAGS
+= $(TOOLAME_EXTRAFLAGS
)
131 CODEC_LIBS
+= $(TOOLAME_LIB
)
134 ifeq ($(TWOLAME
),yes
)
135 CODEC_LIBS
+= $(TWOLAME_LIB
)
139 CODEC_LIBS
+= $(FAAC_LIB
)
162 ifeq ($(LIBMPEG2
),yes
)
165 ifeq ($(FAAD_INTERNAL
),yes
)
166 COMMON_LIBS
+= libfaad2
/libfaad2.a
170 PARTS
+= libdha vidix
175 ifeq ($(DVDKIT2
),yes
)
176 PARTS
+= libmpdvdkit2
183 PARTS
+= loader loader
/dshow loader
/dmo
185 ifeq ($(LIBMENU
),yes
)
188 ifeq ($(TREMOR_INTERNAL
),yes
)
193 ifeq ($(MENCODER
),yes
)
194 ALL_PRG
+= $(PRG_MENCODER
)
197 COMMON_DEPS
= $(W32_DEP
) \
199 libmpdemux
/libmpdemux.a \
201 libmpcodecs
/libmpcodecs.a \
204 libswscale
/libswscale.a \
210 COMMON_DEPS
+= mp3lib
/libMP3.a
211 COMMON_LIBS
+= mp3lib
/libMP3.a
214 COMMON_DEPS
+= liba52
/liba52.a
215 COMMON_LIBS
+= liba52
/liba52.a
217 ifeq ($(LIBMPEG2
),yes
)
218 COMMON_DEPS
+= libmpeg2
/libmpeg2.a
219 COMMON_LIBS
+= libmpeg2
/libmpeg2.a
221 ifeq ($(FAAD_INTERNAL
),yes
)
222 COMMON_DEPS
+= libfaad2
/libfaad2.a
224 ifeq ($(TREMOR_INTERNAL
),yes
)
225 COMMON_DEPS
+= tremor
/libvorbisidec.a
226 COMMON_LIBS
+= tremor
/libvorbisidec.a
229 COMMON_DEPS
+= libdha
/libdha.so vidix
/libvidix.a
232 COMMON_DEPS
+= libfame
/libfame.a
234 ifeq ($(DVDKIT2
),yes
)
235 COMMON_DEPS
+= libmpdvdkit2
/libmpdvdkit.a
237 ifeq ($(CONFIG_ASS
),yes
)
238 COMMON_DEPS
+= libass
/libass.a
239 COMMON_LIBS
+= libass
/libass.a
242 # FontConfig and FreeType need to come after ASS to avoid link failures on MinGW
243 COMMON_LIBS
+= $(FONTCONFIG_LIB
)
244 ifeq ($(FREETYPE
),yes
)
245 SRCS_MENCODER
+= libvo
/font_load_ft.c
246 COMMON_LIBS
+= $(FREETYPE_LIB
)
249 COMMON_DEPS
+= Gui
/libgui.a
250 GUI_LIBS
= Gui
/libgui.a
$(GTK_LIBS
)
255 #.PHONY: $(COMMON_DEPS)
260 $(CC
) -c
$(CFLAGS
) -o
$@
$<
265 libmpdvdkit2
/libmpdvdkit.a
:
266 $(MAKE
) -C libmpdvdkit2
277 libmpdemux
/libmpdemux.a
:
278 $(MAKE
) -C libmpdemux
283 libmpcodecs
/libmpcodecs.a
:
284 $(MAKE
) -C libmpcodecs
286 loader
/dshow
/libDS_Filter.a
:
287 $(MAKE
) -C loader
/dshow
289 loader
/dmo
/libDMO_Filter.a
:
290 $(MAKE
) -C loader
/dmo
292 libavutil
/libavutil.a
:
293 $(MAKE
) -C libavutil LIBPREF
=lib LIBSUF
=.a
295 libavcodec
/libavcodec.a
:
296 $(MAKE
) -C libavcodec LIBPREF
=lib LIBSUF
=.a
298 libpostproc
/libpostproc.a
:
299 $(MAKE
) -C libpostproc LIBPREF
=lib LIBSUF
=.a
301 libavformat
/libavformat.a
:
302 $(MAKE
) -C libavformat LIBPREF
=lib LIBSUF
=.a
304 libswscale
/libswscale.a
:
305 $(MAKE
) -C libswscale LIBPREF
=lib LIBSUF
=.a
325 tremor
/libvorbisidec.a
:
331 vidix
/libvidix.a
: libdha
/libdha.so
346 MPLAYER_DEP
= $(OBJS_MPLAYER
) $(COMMON_DEPS
)
348 ifeq ($(LIBMENU
),yes
)
349 MPLAYER_DEP
+= libmenu
/libmenu.a
350 MENU_LIBS
= libmenu
/libmenu.a
356 MENCODER_DEP
= $(OBJS_MENCODER
) $(COMMON_DEPS
) libmpcodecs
/libmpencoders.a
359 VIDIX_LIBS
= vidix
/libvidix.a
364 ifeq ($(TARGET_WIN32
),yes
)
365 OBJS_MPLAYER
+= osdep
/mplayer-rc.o
368 LIBS_MPLAYER
= libvo
/libvo.a \
385 $(PRG
): $(MPLAYER_DEP
)
386 ifeq ($(TARGET_WIN32
),yes
)
387 windres
-o osdep
/mplayer-rc.o osdep
/mplayer.rc
389 $(CC
) $(CFLAGS
) -o
$(PRG
) $(OBJS_MPLAYER
) $(LIBS_MPLAYER
)
391 ifeq ($(MENCODER
),yes
)
392 LIBS_MENCODER
= libmpcodecs
/libmpencoders.a \
403 $(PRG_MENCODER
): $(MENCODER_DEP
)
404 $(CC
) $(CFLAGS
) -o
$(PRG_MENCODER
) $(OBJS_MENCODER
) $(LIBS_MENCODER
)
407 codec-cfg
: codec-cfg.c codec-cfg.h help_mp.h
408 $(HOST_CC
) -I.
-DCODECS2HTML codec-cfg.c
-o
$@
410 codecs.conf.h
: codec-cfg etc
/codecs.conf
411 .
/codec-cfg .
/etc
/codecs.conf
> $@
413 codec-cfg.o
: codecs.conf.h
415 codecs2html
: mp_msg.o
416 $(CC
) -DCODECS2HTML codec-cfg.c mp_msg.o
-o
$@
420 $(MAKE
) -C libdha
install
421 $(MAKE
) -C vidix
install
423 $(INSTALL
) -d
$(BINDIR
)
424 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG
) $(BINDIR
)/$(PRG
)
426 -ln
-sf
$(PRG
) $(BINDIR
)/gmplayer
428 $(INSTALL
) -d
$(MANDIR
)/man1
429 for i in
$(MAN_LANG
); do \
430 if
test "$$i" = en
; then \
431 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/mplayer
.1 ; \
433 $(INSTALL
) -d
$(MANDIR
)/$$i/man1
; \
434 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/mplayer
.1 ; \
437 ifeq ($(MENCODER
),yes
)
438 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG_MENCODER
) $(BINDIR
)/$(PRG_MENCODER
)
439 for i in
$(MAN_LANG
); do \
440 if
test "$$i" = en
; then \
441 ln
-sf mplayer
.1 $(MANDIR
)/man1
/mencoder
.1 ; \
443 ln
-sf mplayer
.1 $(MANDIR
)/$$i/man1
/mencoder
.1 ; \
447 @
$(INSTALL
) -d
$(DATADIR
)
448 @
$(INSTALL
) -d
$(DATADIR
)/font
449 @if
test ! -f
$(DATADIR
)/font
/font.desc
; then \
450 echo
"*** Download font at http://www.mplayerhq.hu/dload.html" ; \
451 echo
"*** for OSD/Subtitles support and extract to $(DATADIR)/font/" ; \
454 @
$(INSTALL
) -d
$(DATADIR
)/skins
455 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/dload.html"
456 @echo
"*** for GUI, and extract to $(DATADIR)/skins/"
457 @
$(INSTALL
) -d
$(prefix)/share
/pixmaps
458 $(INSTALL
) -m
644 etc
/mplayer.xpm
$(prefix)/share
/pixmaps
/mplayer.xpm
459 @
$(INSTALL
) -d
$(prefix)/share
/applications
460 $(INSTALL
) -m
644 etc
/mplayer.desktop
$(prefix)/share
/applications
/mplayer.desktop
462 @
$(INSTALL
) -d
$(CONFDIR
)
463 @if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
466 -rm -f
$(BINDIR
)/$(PRG
) $(BINDIR
)/gmplayer
$(MANDIR
)/man1
/mplayer
.1
467 -rm -f
$(BINDIR
)/$(PRG_MENCODER
) $(MANDIR
)/man1
/mencoder
.1
468 -rm -f
$(prefix)/share
/pixmaps
/mplayer.xpm
469 -rm -f
$(prefix)/share
/applications
/mplayer.desktop
470 for l in
$(MAN_LANG
); do \
471 if
test "$$l" != "en"; then \
472 rm -f
$(MANDIR
)/$$l/man1
/mplayer
.1 \
473 $(MANDIR
)/$$l/man1
/mencoder
.1 \
474 $(MANDIR
)/$$l/man1
/gmplayer
.1 ; \
478 $(MAKE
) -C libdha
uninstall
479 $(MAKE
) -C vidix
uninstall
481 @echo
"Uninstall completed"
487 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a clean; done
489 distclean: clean doxygen_clean
490 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
491 -rm -f
*~
$(PRG
) $(PRG_MENCODER
) codec-cfg codecs2html
492 -rm -f .depend configure.log codecs.conf.h help_mp.h config.h config.mak
499 depend
: help_mp.h version.h
500 $(CC
) -MM
$(CFLAGS
) -DCODECS2HTML mplayer.c mencoder.c
$(SRCS_MPLAYER
) $(SRCS_MENCODER
) 1>.depend
501 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
503 # ./configure must be rerun if it changed
505 @echo
"############################################################"
506 @echo
"####### Please run ./configure again - it's changed! #######"
507 @echo
"############################################################"
509 # rebuild at every config.h/config.mak/Makefile change:
510 version.h
: config.h config.mak Makefile
511 .
/version.sh
`$(CC) -dumpversion`
514 doxygen DOCS
/tech
/Doxyfile
517 -rm -rf DOCS
/tech
/doxygen
519 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
520 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
521 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
523 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
525 iconv
-f
`cat $(HELP_FILE).charset` -t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
528 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
529 @echo
"Adding untranslated messages to help_mp.h"
530 @echo
'// untranslated messages from the English master file:' >> help_mp.h
531 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
534 # explicit dependencies to force version.h to be built even if .depend is missing
535 mplayer.o mencoder.o vobsub.o
: version.h
537 # temporary measure to make sure help_mp.h is built. we desperately need correct deps!
538 $(MPLAYER_DEP
) $(MENCODER_DEP
): help_mp.h
541 # the following lines provide _partial_ dependency information
542 # for the 'library' directories under main dir, in order to cause
543 # the build process to recursively descend into them if something
544 # has changed. ideally this will be replaced with a single
545 # nonrecursive makefile for the whole project.
547 # Now all directories are recursed by default because these rules do not
548 # consider dependencies on files in other directories, while the recursively
549 # invoked Makefiles do. Conditional recursion only to the directories with
550 # changed files can be enabled by creating a file named ".norecurse" and
551 # optionally giving it a timestamp in the past. Directories whose .a files
552 # are newer than the timestamp and newer than other files in the directory
553 # will not be recursed.
556 libvo
/libvo.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
557 libao2
/libao2.a
: .norecurse
$(wildcard libao2
/*.
[ch
])
558 osdep
/libosdep.a
: .norecurse
$(wildcard osdep
/*.
[ch
])
559 input
/libinput.a
: .norecurse
$(wildcard input
/*.
[ch
])
561 libmenu
/libmenu.a
: .norecurse
$(wildcard libmenu
/*.
[ch
])
562 libaf
/libaf.a
: .norecurse
$(wildcard libaf
/*.
[ch
])
563 libmpdvdkit2
/libmpdvdkit.a
: .norecurse
$(wildcard libmpdvdkit2
/*.
[ch
])
565 libmpdemux
/libmpdemux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
] libmpdemux
/*/*.
[ch
])
566 stream
/stream.a
: .norecurse
$(wildcard stream
/*.
[ch
] stream
/*/*.
[ch
])
567 libmpcodecs
/libmpcodecs.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
]) $(wildcard libmpcodecs
/native
/*.
[ch
])
568 libmpcodecs
/libmpencoders.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
])
570 libavutil
/libavutil.a
: .norecurse
$(wildcard libavutil
/*.
[ch
])
571 libavcodec
/libavcodec.a
: .norecurse
$(wildcard libavcodec
/*.
[ch
] libavcodec
/*/*.
[chS
])
572 libavformat
/libavformat.a
: .norecurse
$(wildcard libavformat
/*.
[ch
])
573 libswscale
/libswscale.a
: .norecurse
$(wildcard libswscale
/*.
[ch
])
575 libmpeg2
/libmpeg2.a
: .norecurse
$(wildcard libmpeg2
/*.
[ch
])
576 liba52
/liba52.a
: .norecurse
$(wildcard liba52
/*.
[ch
])
577 mp3lib
/libMP3.a
: .norecurse
$(wildcard mp3lib
/*.
[ch
])
578 libfaad2
/libfaad2.a
: .norecurse
$(wildcard libfaad2
/*.
[ch
] libfaad2
/*/*.
[ch
])
580 loader
/libloader.a
: .norecurse
$(wildcard loader
/*.
[chSs
])
581 loader
/dmo
/libDMO_Filter.a
: .norecurse
$(wildcard loader
/dmo
/*.
[ch
])
582 loader
/dshow
/libDS_Filter.a
: .norecurse
$(wildcard loader
/dshow
/*.
[ch
])
584 libdha
/libdha.so
: .norecurse
$(wildcard libdha
/*.
[ch
])
585 vidix
/libvidix.a
: .norecurse
$(wildcard vidix
/*.
[ch
])
586 Gui
/libgui.a
: .norecurse
$(wildcard Gui
/*.
[ch
] Gui
/*/*.
[ch
] Gui
/*/*/*.
[ch
])
588 libass
/libass.a
: .norecurse
$(wildcard libass
/*.
[ch
])
591 # include dependency files if they exist
593 ifneq ($(wildcard .depend
),)