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
11 # Do not strip the binaries at installation
12 ifeq ($(STRIPBINARIES
),yes
)
16 # These subdirectories require installation due to binaries within them.
18 SUBDIRS
+= libdha vidix
19 DO_MAKE
= @ for i in
$(SUBDIRS
); do
$(MAKE
) -C
$$i $@
; done
22 SRCS_COMMON
= asxparser.c \
38 SRCS_MENCODER
= mencoder.c \
44 libvo
/font_load_ft.c \
50 SRCS_MPLAYER
= mplayer.c \
57 ifeq ($(UNRARLIB
),yes
)
58 SRCS_COMMON
+= unrarlib.c
61 OBJS_MENCODER
= $(SRCS_MENCODER
:.c
=.o
)
62 OBJS_MPLAYER
= $(SRCS_MPLAYER
:.c
=.o
)
74 AO_LIBS
= $(ARTS_LIB
) \
81 CODEC_LIBS
= $(AV_LIB
) \
98 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a \
102 libmpdemux
/libmpdemux.a \
104 postproc
/libswscale.a \
111 $(MPLAYER_NETWORK_LIB
) \
114 $(MACOSX_FRAMEWORKS
) \
120 CFLAGS
= $(OPTFLAGS
) -I. \
134 ifeq ($(TOOLAME
),yes
)
135 CFLAGS
+= $(TOOLAME_EXTRAFLAGS
)
136 CODEC_LIBS
+= $(TOOLAME_LIB
)
139 ifeq ($(TWOLAME
),yes
)
140 CODEC_LIBS
+= $(TWOLAME_LIB
)
144 CODEC_LIBS
+= $(FAAC_LIB
)
164 ifeq ($(LIBMPEG2
),yes
)
167 ifeq ($(INTERNAL_FAAD
),yes
)
168 COMMON_LIBS
+= libfaad2
/libfaad2.a
172 PARTS
+= libdha vidix
177 ifeq ($(DVDKIT2
),yes
)
178 PARTS
+= libmpdvdkit2
188 PARTS
+= loader loader
/dshow loader
/dmo
190 ifeq ($(LIBMENU
),yes
)
198 ifeq ($(MENCODER
),yes
)
199 ALL_PRG
+= $(PRG_MENCODER
)
202 COMMON_DEPS
= $(W32_DEP
) \
206 libmpdemux
/libmpdemux.a \
207 libmpcodecs
/libmpcodecs.a \
210 postproc
/libswscale.a \
216 COMMON_DEPS
+= mp3lib
/libMP3.a
217 COMMON_LIBS
+= mp3lib
/libMP3.a
220 COMMON_DEPS
+= liba52
/liba52.a
221 COMMON_LIBS
+= liba52
/liba52.a
223 ifeq ($(LIBMPEG2
),yes
)
224 COMMON_DEPS
+= libmpeg2
/libmpeg2.a
225 COMMON_LIBS
+= libmpeg2
/libmpeg2.a
227 ifeq ($(INTERNAL_FAAD
),yes
)
228 COMMON_DEPS
+= libfaad2
/libfaad2.a
231 COMMON_DEPS
+= tremor
/libvorbisidec.a
232 COMMON_LIBS
+= tremor
/libvorbisidec.a
235 COMMON_DEPS
+= libdha
/libdha.so vidix
/libvidix.a
238 COMMON_DEPS
+= libfame
/libfame.a
240 ifeq ($(DVDKIT2
),yes
)
241 ifeq ($(DVDKIT_SHARED
),yes
)
242 COMMON_DEPS
+= libmpdvdkit2
/libmpdvdkit.so
244 COMMON_DEPS
+= libmpdvdkit2
/libmpdvdkit.a
248 ifeq ($(SHARED_PP
),yes
)
249 COMMON_DEPS
+= libavcodec
/libpostproc
/libpostproc.so
250 COMMON_LIBS
+= libavcodec
/libpostproc
/libpostproc.so
254 COMMON_DEPS
+= Gui
/libgui.a
255 GUI_LIBS
= Gui
/libgui.a
260 #.PHONY: $(COMMON_DEPS)
262 all: version.h
$(ALL_PRG
)
265 $(CC
) -c
$(CFLAGS
) -o
$@
$<
270 libmpdvdkit2
/libmpdvdkit.a
:
271 $(MAKE
) -C libmpdvdkit2
273 libmpdvdkit2
/libmpdvdkit.so
:
274 $(MAKE
) -C libmpdvdkit2 libmpdvdkit.so
282 libmpdemux
/libmpdemux.a
:
283 $(MAKE
) -C libmpdemux
285 libmpcodecs
/libmpcodecs.a
:
286 $(MAKE
) -C libmpcodecs
288 loader
/dshow
/libDS_Filter.a
:
289 $(MAKE
) -C loader
/dshow
291 loader
/dmo
/libDMO_Filter.a
:
292 $(MAKE
) -C loader
/dmo
294 libavcodec
/libavcodec.a
:
295 $(MAKE
) -C libavcodec LIBPREF
=lib LIBSUF
=.a
297 libavformat
/libavformat.a
:
298 $(MAKE
) -C libavformat LIBPREF
=lib LIBSUF
=.a
318 tremor
/libvorbisidec.a
:
333 postproc
/libswscale.a
:
342 libavcodec
/libpostproc
/libpostproc.so
:
343 $(MAKE
) -C libavcodec
/libpostproc
345 MPLAYER_DEP
= $(OBJS_MPLAYER
) $(COMMON_DEPS
)
347 ifeq ($(LIBMENU
),yes
)
348 MPLAYER_DEP
+= libmenu
/libmenu.a
349 MENU_LIBS
= libmenu
/libmenu.a
355 MENCODER_DEP
= $(OBJS_MENCODER
) $(COMMON_DEPS
) libmpcodecs
/libmpencoders.a
358 VIDIX_LIBS
= vidix
/libvidix.a
363 ifeq ($(TARGET_WIN32
),yes
)
364 OBJS_MPLAYER
+= osdep
/mplayer-rc.o
367 LIBS_MPLAYER
= libvo
/libvo.a \
384 $(PRG
): $(MPLAYER_DEP
)
385 ifeq ($(TARGET_WIN32
),yes
)
386 windres
-o osdep
/mplayer-rc.o osdep
/mplayer.rc
388 $(CC
) $(CFLAGS
) -o
$(PRG
) $(OBJS_MPLAYER
) $(LIBS_MPLAYER
)
390 mplayer.exe.spec.c
: libmpcodecs
/libmpcodecs.a
391 winebuild
-fPIC
-o mplayer.exe.spec.c
-exe mplayer.exe
-mcui \
392 libmpcodecs
/ad_qtaudio.o libmpcodecs
/vd_qtvideo.o \
393 -L
/usr
/local
/lib
/wine
-lkernel32
395 mplayer.exe.so
: $(MPLAYER_DEP
) mplayer.exe.spec.c
396 $(CC
) $(CFLAGS
) -Wall
-shared
-Wl
,-rpath
,/usr
/local
/lib
-Wl
,-Bsymbolic
-o mplayer.exe.so
$(OBJS_MPLAYER
) mplayer.exe.spec.c libvo
/libvo.a libao2
/libao2.a
$(MENU_LIBS
) $(VIDIX_LIBS
) $(GUI_LIBS
) $(COMMON_LIBS
) $(GTK_LIBS
) $(VO_LIBS
) $(AO_LIBS
) $(EXTRA_LIB
) $(LIRC_LIB
) $(LIRCC_LIB
) $(STATIC_LIB
) $(ARCH_LIB
) -lwine
$(MATH_LIB
)
398 mplayer_wine.so
: $(MPLAYER_DEP
)
399 $(CC
) $(CFLAGS
) -shared
-Wl
,-Bsymbolic
-o mplayer_wine.so mplayer_wine.spec.c
$(OBJS_MPLAYER
) libvo
/libvo.a libao2
/libao2.a
$(MENU_LIBS
) $(VIDIX_LIBS
) $(GUI_LIBS
) $(COMMON_LIBS
) $(GTK_LIBS
) $(VO_LIBS
) $(AO_LIBS
) $(EXTRA_LIB
) $(LIRC_LIB
) $(LIRCC_LIB
) $(STATIC_LIB
) -lwine
$(ARCH_LIB
) $(MATH_LIB
)
401 ifeq ($(MENCODER
),yes
)
402 LIBS_MENCODER
= libmpcodecs
/libmpencoders.a \
413 $(PRG_MENCODER
): $(MENCODER_DEP
)
414 $(CC
) $(CFLAGS
) -o
$(PRG_MENCODER
) $(OBJS_MENCODER
) $(LIBS_MENCODER
)
417 codecs.conf.h
: $(PRG_CFG
) etc
/codecs.conf
418 .
/$(PRG_CFG
) .
/etc
/codecs.conf
> $@
420 codec-cfg.o
: codecs.conf.h
422 # Every mplayer dependency depends on version.h, to force building version.h
423 # first (in serial mode) before any other of the dependencies for a parallel make
424 # run. This is necessary, because the make rule for version.h removes objects
425 # in a recursive "make distclean" and we must wait for this "make distclean" to
426 # finish before we can start building new object files.
427 # help_mp.h is also required by a lot of files, so force generating it early.
428 $(MPLAYER_DEP
): version.h help_mp.h
429 $(MENCODER_DEP
): version.h help_mp.h
431 $(PRG_CFG
): version.h codec-cfg.c codec-cfg.h
432 $(HOST_CC
) $(HOST_CFLAGS
) -I.
-g codec-cfg.c mp_msg.c
-o
$(PRG_CFG
) -DCODECS2HTML
$(EXTRA_LIB
) $(EXTRA_INC
) $(I18NLIBS
)
438 ifeq ($(SHARED_PP
),yes
)
439 $(MAKE
) install -C libavcodec
/libpostproc
441 if
test ! -d
$(BINDIR
) ; then mkdir
-p
$(BINDIR
) ; fi
442 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG
) $(BINDIR
)/$(PRG
)
444 -ln
-sf
$(PRG
) $(BINDIR
)/gmplayer
446 if
test ! -d
$(MANDIR
)/man1
; then mkdir
-p
$(MANDIR
)/man1
; fi
447 for i in
$(MAN_LANG
); do \
448 if
test "$$i" = en
; then \
449 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/mplayer
.1 ; \
451 mkdir
-p
$(MANDIR
)/$$i/man1
; \
452 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/mplayer
.1 ; \
455 ifeq ($(MENCODER
),yes
)
456 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG_MENCODER
) $(BINDIR
)/$(PRG_MENCODER
)
457 for i in
$(MAN_LANG
); do \
458 if
test "$$i" = en
; then \
459 ln
-sf mplayer
.1 $(MANDIR
)/man1
/mencoder
.1 ; \
461 ln
-sf mplayer
.1 $(MANDIR
)/$$i/man1
/mencoder
.1 ; \
465 @if
test ! -d
$(DATADIR
) ; then mkdir
-p
$(DATADIR
) ; fi
466 @if
test ! -d
$(DATADIR
)/font
; then mkdir
-p
$(DATADIR
)/font
; fi
467 @if
test ! -f
$(DATADIR
)/font
/font.desc
; then \
468 echo
"*** Download font at http://www.mplayerhq.hu/homepage/dload.html" ; \
469 echo
"*** for OSD/Subtitles support and extract to $(DATADIR)/font/" ; \
472 @if
test ! -d
$(DATADIR
)/Skin
; then mkdir
-p
$(DATADIR
)/Skin
; fi
473 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/homepage/dload.html"
474 @echo
"*** for GUI, and extract to $(DATADIR)/Skin/"
475 @if
test ! -d
$(prefix)/share
/pixmaps
; then mkdir
-p
$(prefix)/share
/pixmaps
; fi
476 $(INSTALL
) -m
644 Gui
/mplayer
/pixmaps
/mplayer-desktop.xpm
$(prefix)/share
/pixmaps
/mplayer-desktop.xpm
477 @if
test ! -d
$(prefix)/share
/applications
; then mkdir
-p
$(prefix)/share
/applications
; fi
478 $(INSTALL
) -m
644 etc
/mplayer.desktop
$(prefix)/share
/applications
/mplayer.desktop
480 @if
test ! -d
$(CONFDIR
) ; then mkdir
-p
$(CONFDIR
) ; fi
481 @if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
482 ifeq ($(DVDKIT_SHARED
),yes
)
483 ifeq ($(DVDKIT2
),yes
)
484 if
test ! -d
$(LIBDIR
) ; then mkdir
-p
$(LIBDIR
) ; fi
485 $(INSTALL
) -m
755 $(INSTALLSTRIP
) libmpdvdkit2
/libmpdvdkit.so
$(LIBDIR
)/libmpdvdkit.so
488 if
test ! -d
$(LIBDIR
) ; then mkdir
-p
$(LIBDIR
) ; fi
489 $(INSTALL
) -m
755 $(INSTALLSTRIP
) libmpdvdkit
/libmpdvdkit.so
$(LIBDIR
)/libmpdvdkit.so
495 -rm -f
$(BINDIR
)/$(PRG
) $(BINDIR
)/gmplayer
$(MANDIR
)/man1
/mplayer
.1
496 -rm -f
$(BINDIR
)/$(PRG_MENCODER
) $(MANDIR
)/man1
/mencoder
.1
497 -rm -f
$(prefix)/share
/pixmaps
/mplayer-desktop.xpm
498 -rm -f
$(prefix)/share
/applications
/mplayer.desktop
499 -rm -f
$(LIBDIR
)/libmpdvdkit.so
500 for l in
$(MAN_LANG
); do \
501 if
test "i$$l" != "en"; then \
502 -rm -f
$(MANDIR
)/$$l/man1
/mplayer
.1 $(MANDIR
)/$$l/man1
/mencoder
.1 \
503 -rm -f
$(MANDIR
)/$$l/man1
/gmplayer
.1 \
509 @echo
"Uninstall completed"
512 -rm -f
*.o
*~
$(OBJS
) codecs.conf.h
514 distclean: doxygen_clean
515 -rm -f
*~
$(PRG
) $(PRG_MENCODER
) $(PRG_CFG
) $(OBJS
)
516 -rm -f
*.o
*.a .depend configure.log codecs.conf.h help_mp.h
517 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
525 .
/version.sh
`$(CC) -dumpversion`
526 $(CC
) -MM
$(CFLAGS
) -DCODECS2HTML mplayer.c mencoder.c
$(SRCS_MPLAYER
) $(SRCS_MENCODER
) 1>.depend
527 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
529 # ./configure must be run if it changed in CVS
531 @echo
"############################################################"
532 @echo
"####### Please run ./configure again - it's changed! #######"
533 @echo
"############################################################"
534 ifeq ($(wildcard .developer
),)
538 # do not rebuild after cvs commits if .developer file is present!
540 # rebuild at every config.h/config.mak change:
542 .
/version.sh
`$(CC) -dumpversion`
543 ifeq ($(wildcard .developer
),)
549 doxygen DOCS
/tech
/Doxyfile
552 -rm -rf DOCS
/tech
/doxygen
554 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
555 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
556 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
558 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
560 iconv
-f
`cat $(HELP_FILE).charset` -t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
563 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
564 @echo
"Adding untranslated messages to help_mp.h"
565 @echo
'// untranslated messages from the English master file:' >> help_mp.h
566 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
569 # rebuild at every CVS update or config/makefile change:
570 ifeq ($(wildcard .developer
),)
571 ifneq ($(wildcard CVS
/Entries
),)
572 version.h
: CVS
/Entries
574 version.h
: config.h config.mak Makefile
578 # include dependencies to get make to recurse into lib dirs,
579 # if the user desires such behavior
581 ifneq ($(wildcard .libdeps
),)
586 # include dependency files if they exist
588 ifneq ($(wildcard .depend
),)