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
12 ifeq ($(CONFIG_LIBAVUTIL
),yes
)
13 LIBAV_INC
+= -I.
/libavutil
15 ifeq ($(CONFIG_LIBAVCODEC
),yes
)
16 LIBAV_INC
+= -I.
/libavcodec
19 # Do not strip the binaries at installation
20 ifeq ($(STRIPBINARIES
),yes
)
24 # These subdirectories require installation due to binaries within them.
26 SUBDIRS
+= libdha vidix
27 DO_MAKE
= @ for i in
$(SUBDIRS
); do
$(MAKE
) -C
$$i $@
; done
30 SRCS_COMMON
= asxparser.c \
46 SRCS_MENCODER
= mencoder.c \
52 libvo
/font_load_ft.c \
58 SRCS_MPLAYER
= mplayer.c \
65 ifeq ($(UNRARLIB
),yes
)
66 SRCS_COMMON
+= unrarlib.c
69 OBJS_MENCODER
= $(SRCS_MENCODER
:.c
=.o
)
70 OBJS_MPLAYER
= $(SRCS_MPLAYER
:.c
=.o
)
83 AO_LIBS
= $(ARTS_LIB
) \
90 CODEC_LIBS
= $(AV_LIB
) \
108 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a \
112 libmpdemux
/libmpdemux.a \
114 postproc
/libswscale.a \
121 $(MPLAYER_NETWORK_LIB
) \
124 $(MACOSX_FRAMEWORKS
) \
130 CFLAGS
= $(OPTFLAGS
) -I. \
145 ifeq ($(TOOLAME
),yes
)
146 CFLAGS
+= $(TOOLAME_EXTRAFLAGS
)
147 CODEC_LIBS
+= $(TOOLAME_LIB
)
150 ifeq ($(TWOLAME
),yes
)
151 CODEC_LIBS
+= $(TWOLAME_LIB
)
155 CODEC_LIBS
+= $(FAAC_LIB
)
176 ifeq ($(LIBMPEG2
),yes
)
179 ifeq ($(INTERNAL_FAAD
),yes
)
180 COMMON_LIBS
+= libfaad2
/libfaad2.a
184 PARTS
+= libdha vidix
189 ifeq ($(DVDKIT2
),yes
)
190 PARTS
+= libmpdvdkit2
200 PARTS
+= loader loader
/dshow loader
/dmo
202 ifeq ($(LIBMENU
),yes
)
210 ifeq ($(MENCODER
),yes
)
211 ALL_PRG
+= $(PRG_MENCODER
)
214 COMMON_DEPS
= $(W32_DEP
) \
218 libmpdemux
/libmpdemux.a \
219 libmpcodecs
/libmpcodecs.a \
222 postproc
/libswscale.a \
228 COMMON_DEPS
+= mp3lib
/libMP3.a
229 COMMON_LIBS
+= mp3lib
/libMP3.a
232 COMMON_DEPS
+= liba52
/liba52.a
233 COMMON_LIBS
+= liba52
/liba52.a
235 ifeq ($(LIBMPEG2
),yes
)
236 COMMON_DEPS
+= libmpeg2
/libmpeg2.a
237 COMMON_LIBS
+= libmpeg2
/libmpeg2.a
239 ifeq ($(INTERNAL_FAAD
),yes
)
240 COMMON_DEPS
+= libfaad2
/libfaad2.a
243 COMMON_DEPS
+= tremor
/libvorbisidec.a
244 COMMON_LIBS
+= tremor
/libvorbisidec.a
247 COMMON_DEPS
+= libdha
/libdha.so vidix
/libvidix.a
250 COMMON_DEPS
+= libfame
/libfame.a
252 ifeq ($(DVDKIT2
),yes
)
253 ifeq ($(DVDKIT_SHARED
),yes
)
254 COMMON_DEPS
+= libmpdvdkit2
/libmpdvdkit.so
256 COMMON_DEPS
+= libmpdvdkit2
/libmpdvdkit.a
261 COMMON_DEPS
+= Gui
/libgui.a
262 GUI_LIBS
= Gui
/libgui.a
267 #.PHONY: $(COMMON_DEPS)
269 all: version.h
$(ALL_PRG
)
272 $(CC
) -c
$(CFLAGS
) -o
$@
$<
277 libmpdvdkit2
/libmpdvdkit.a
:
278 $(MAKE
) -C libmpdvdkit2
280 libmpdvdkit2
/libmpdvdkit.so
:
281 $(MAKE
) -C libmpdvdkit2 libmpdvdkit.so
289 libmpdemux
/libmpdemux.a
:
290 $(MAKE
) -C libmpdemux
292 libmpcodecs
/libmpcodecs.a
:
293 $(MAKE
) -C libmpcodecs
295 loader
/dshow
/libDS_Filter.a
:
296 $(MAKE
) -C loader
/dshow
298 loader
/dmo
/libDMO_Filter.a
:
299 $(MAKE
) -C loader
/dmo
301 libavutil
/libavutil.a
:
302 $(MAKE
) -C libavutil LIBPREF
=lib LIBSUF
=.a
304 libavcodec
/libavcodec.a
:
305 $(MAKE
) -C libavcodec LIBPREF
=lib LIBSUF
=.a
307 libavformat
/libavformat.a
:
308 $(MAKE
) -C libavformat LIBPREF
=lib LIBSUF
=.a
328 tremor
/libvorbisidec.a
:
343 postproc
/libswscale.a
:
352 libavcodec
/libpostproc
/libpostproc.so
:
353 $(MAKE
) -C libavcodec
/libpostproc
355 MPLAYER_DEP
= $(OBJS_MPLAYER
) $(COMMON_DEPS
)
357 ifeq ($(LIBMENU
),yes
)
358 MPLAYER_DEP
+= libmenu
/libmenu.a
359 MENU_LIBS
= libmenu
/libmenu.a
365 MENCODER_DEP
= $(OBJS_MENCODER
) $(COMMON_DEPS
) libmpcodecs
/libmpencoders.a
368 VIDIX_LIBS
= vidix
/libvidix.a
373 ifeq ($(TARGET_WIN32
),yes
)
374 OBJS_MPLAYER
+= osdep
/mplayer-rc.o
377 LIBS_MPLAYER
= libvo
/libvo.a \
394 $(PRG
): $(MPLAYER_DEP
)
395 ifeq ($(TARGET_WIN32
),yes
)
396 windres
-o osdep
/mplayer-rc.o osdep
/mplayer.rc
398 $(CC
) $(CFLAGS
) -o
$(PRG
) $(OBJS_MPLAYER
) $(LIBS_MPLAYER
)
400 mplayer.exe.spec.c
: libmpcodecs
/libmpcodecs.a
401 winebuild
-fPIC
-o mplayer.exe.spec.c
-exe mplayer.exe
-mcui \
402 libmpcodecs
/ad_qtaudio.o libmpcodecs
/vd_qtvideo.o \
403 -L
/usr
/local
/lib
/wine
-lkernel32
405 mplayer.exe.so
: $(MPLAYER_DEP
) mplayer.exe.spec.c
406 $(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
)
408 mplayer_wine.so
: $(MPLAYER_DEP
)
409 $(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
)
411 ifeq ($(MENCODER
),yes
)
412 LIBS_MENCODER
= libmpcodecs
/libmpencoders.a \
423 $(PRG_MENCODER
): $(MENCODER_DEP
)
424 $(CC
) $(CFLAGS
) -o
$(PRG_MENCODER
) $(OBJS_MENCODER
) $(LIBS_MENCODER
)
427 codecs.conf.h
: $(PRG_CFG
) etc
/codecs.conf
428 .
/$(PRG_CFG
) .
/etc
/codecs.conf
> $@
430 codec-cfg.o
: codecs.conf.h
432 # Every mplayer dependency depends on version.h, to force building version.h
433 # first (in serial mode) before any other of the dependencies for a parallel make
434 # run. This is necessary, because the make rule for version.h removes objects
435 # in a recursive "make distclean" and we must wait for this "make distclean" to
436 # finish before we can start building new object files.
437 # help_mp.h is also required by a lot of files, so force generating it early.
438 $(MPLAYER_DEP
): version.h help_mp.h
439 $(MENCODER_DEP
): version.h help_mp.h
441 $(PRG_CFG
): version.h codec-cfg.c codec-cfg.h
442 $(HOST_CC
) $(HOST_CFLAGS
) -I.
-g codec-cfg.c mp_msg.c
-o
$(PRG_CFG
) -DCODECS2HTML
$(EXTRA_LIB
) $(EXTRA_INC
) $(I18NLIBS
)
448 if
test ! -d
$(BINDIR
) ; then mkdir
-p
$(BINDIR
) ; fi
449 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG
) $(BINDIR
)/$(PRG
)
451 -ln
-sf
$(PRG
) $(BINDIR
)/gmplayer
453 if
test ! -d
$(MANDIR
)/man1
; then mkdir
-p
$(MANDIR
)/man1
; fi
454 for i in
$(MAN_LANG
); do \
455 if
test "$$i" = en
; then \
456 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/mplayer
.1 ; \
458 mkdir
-p
$(MANDIR
)/$$i/man1
; \
459 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/mplayer
.1 ; \
462 ifeq ($(MENCODER
),yes
)
463 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG_MENCODER
) $(BINDIR
)/$(PRG_MENCODER
)
464 for i in
$(MAN_LANG
); do \
465 if
test "$$i" = en
; then \
466 ln
-sf mplayer
.1 $(MANDIR
)/man1
/mencoder
.1 ; \
468 ln
-sf mplayer
.1 $(MANDIR
)/$$i/man1
/mencoder
.1 ; \
472 @if
test ! -d
$(DATADIR
) ; then mkdir
-p
$(DATADIR
) ; fi
473 @if
test ! -d
$(DATADIR
)/font
; then mkdir
-p
$(DATADIR
)/font
; fi
474 @if
test ! -f
$(DATADIR
)/font
/font.desc
; then \
475 echo
"*** Download font at http://www.mplayerhq.hu/homepage/dload.html" ; \
476 echo
"*** for OSD/Subtitles support and extract to $(DATADIR)/font/" ; \
479 @if
test ! -d
$(DATADIR
)/Skin
; then mkdir
-p
$(DATADIR
)/Skin
; fi
480 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/homepage/dload.html"
481 @echo
"*** for GUI, and extract to $(DATADIR)/Skin/"
482 @if
test ! -d
$(prefix)/share
/pixmaps
; then mkdir
-p
$(prefix)/share
/pixmaps
; fi
483 $(INSTALL
) -m
644 Gui
/mplayer
/pixmaps
/mplayer-desktop.xpm
$(prefix)/share
/pixmaps
/mplayer-desktop.xpm
484 @if
test ! -d
$(prefix)/share
/applications
; then mkdir
-p
$(prefix)/share
/applications
; fi
485 $(INSTALL
) -m
644 etc
/mplayer.desktop
$(prefix)/share
/applications
/mplayer.desktop
487 @if
test ! -d
$(CONFDIR
) ; then mkdir
-p
$(CONFDIR
) ; fi
488 @if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
489 ifeq ($(DVDKIT_SHARED
),yes
)
490 ifeq ($(DVDKIT2
),yes
)
491 if
test ! -d
$(LIBDIR
) ; then mkdir
-p
$(LIBDIR
) ; fi
492 $(INSTALL
) -m
755 $(INSTALLSTRIP
) libmpdvdkit2
/libmpdvdkit.so
$(LIBDIR
)/libmpdvdkit.so
495 if
test ! -d
$(LIBDIR
) ; then mkdir
-p
$(LIBDIR
) ; fi
496 $(INSTALL
) -m
755 $(INSTALLSTRIP
) libmpdvdkit
/libmpdvdkit.so
$(LIBDIR
)/libmpdvdkit.so
502 -rm -f
$(BINDIR
)/$(PRG
) $(BINDIR
)/gmplayer
$(MANDIR
)/man1
/mplayer
.1
503 -rm -f
$(BINDIR
)/$(PRG_MENCODER
) $(MANDIR
)/man1
/mencoder
.1
504 -rm -f
$(prefix)/share
/pixmaps
/mplayer-desktop.xpm
505 -rm -f
$(prefix)/share
/applications
/mplayer.desktop
506 -rm -f
$(LIBDIR
)/libmpdvdkit.so
507 for l in
$(MAN_LANG
); do \
508 if
test "i$$l" != "en"; then \
509 -rm -f
$(MANDIR
)/$$l/man1
/mplayer
.1 $(MANDIR
)/$$l/man1
/mencoder
.1 \
510 -rm -f
$(MANDIR
)/$$l/man1
/gmplayer
.1 \
516 @echo
"Uninstall completed"
519 -rm -f
*.o
*~
$(OBJS
) codecs.conf.h
521 distclean: doxygen_clean
522 -rm -f
*~
$(PRG
) $(PRG_MENCODER
) $(PRG_CFG
) $(OBJS
)
523 -rm -f
*.o
*.a .depend configure.log codecs.conf.h help_mp.h
524 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
532 .
/version.sh
`$(CC) -dumpversion`
533 $(CC
) -MM
$(CFLAGS
) -DCODECS2HTML mplayer.c mencoder.c
$(SRCS_MPLAYER
) $(SRCS_MENCODER
) 1>.depend
534 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
536 # ./configure must be run if it changed in CVS
538 @echo
"############################################################"
539 @echo
"####### Please run ./configure again - it's changed! #######"
540 @echo
"############################################################"
541 ifeq ($(wildcard .developer
),)
545 # do not rebuild after cvs commits if .developer file is present!
547 # rebuild at every config.h/config.mak change:
549 .
/version.sh
`$(CC) -dumpversion`
550 ifeq ($(wildcard .developer
),)
556 doxygen DOCS
/tech
/Doxyfile
559 -rm -rf DOCS
/tech
/doxygen
561 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
562 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
563 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
565 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
567 iconv
-f
`cat $(HELP_FILE).charset` -t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
570 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
571 @echo
"Adding untranslated messages to help_mp.h"
572 @echo
'// untranslated messages from the English master file:' >> help_mp.h
573 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
576 # rebuild at every CVS update or config/makefile change:
577 ifeq ($(wildcard .developer
),)
578 ifneq ($(wildcard CVS
/Entries
),)
579 version.h
: CVS
/Entries
581 version.h
: config.h config.mak Makefile
585 # include dependencies to get make to recurse into lib dirs,
586 # if the user desires such behavior
588 ifneq ($(wildcard .libdeps
),)
593 # include dependency files if they exist
595 ifneq ($(wildcard .depend
),)