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 PRG_MENCODER
= mencoder
13 # Do not strip the binaries at installation
14 ifeq ($(STRIPBINARIES
),yes
)
18 # These subdirectories require installation due to binaries within them.
20 SUBDIRS
+= libdha vidix
21 DO_MAKE
= @ for i in
$(SUBDIRS
); do
$(MAKE
) -C
$$i $@
; done
24 SRCS_COMMON
= cpudetect.c codec-cfg.c spudec.c playtree.c playtreeparser.c asxparser.c vobsub.c subreader.c sub_cc.c find_sub.c m_config.c m_option.c parser-cfg.c m_struct.c
25 SRCS_MENCODER
= mencoder.c mp_msg-mencoder.c
$(SRCS_COMMON
) libao2
/afmt.c divx4_vbr.c libvo
/aclib.c libvo
/osd.c libvo
/sub.c libvo
/font_load.c libvo
/font_load_ft.c xvid_vbr.c parser-mecmd.c
26 SRCS_MPLAYER
= mplayer.c mp_msg.c
$(SRCS_COMMON
) mixer.c parser-mpcmd.c
28 ifeq ($(UNRARLIB
),yes
)
29 SRCS_COMMON
+= unrarlib.c
32 OBJS_MENCODER
= $(SRCS_MENCODER
:.c
=.o
)
33 OBJS_MPLAYER
= $(SRCS_MPLAYER
:.c
=.o
)
35 VO_LIBS
= $(AA_LIB
) $(X_LIB
) $(SDL_LIB
) $(GGI_LIB
) $(MP1E_LIB
) $(MLIB_LIB
) $(SVGA_LIB
) $(DIRECTFB_LIB
) $(CACA_LIB
)
36 AO_LIBS
= $(ARTS_LIB
) $(ESD_LIB
) $(NAS_LIB
) $(SGIAUDIO_LIB
)
37 CODEC_LIBS
= $(AV_LIB
) $(FAME_LIB
) $(MAD_LIB
) $(VORBIS_LIB
) $(THEORA_LIB
) $(FAAD_LIB
) $(LIBLZO_LIB
) $(DECORE_LIB
) $(XVID_LIB
) $(PNG_LIB
) $(Z_LIB
) $(JPEG_LIB
) $(ALSA_LIB
) $(XMMS_LIB
) $(MATROSKA_LIB
)
38 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a mp3lib
/libMP3.a liba52
/liba52.a libmpeg2
/libmpeg2.a
$(W32_LIB
) $(DS_LIB
) libaf
/libaf.a libmpdemux
/libmpdemux.a input
/libinput.a postproc
/libswscale.a osdep
/libosdep.a
$(DVDREAD_LIB
) $(CODEC_LIBS
) $(FREETYPE_LIB
) $(TERMCAP_LIB
) $(CDPARANOIA_LIB
) $(MPLAYER_NETWORK_LIB
) $(WIN32_LIB
) $(GIF_LIB
) $(MACOSX_FRAMEWORKS
) $(SMBSUPPORT_LIB
) $(FRIBIDI_LIB
) $(FONTCONFIG_LIB
) $(ENCA_LIB
)
40 CFLAGS
= $(OPTFLAGS
) -Ilibmpdemux
-Iloader
-Ilibvo
$(FREETYPE_INC
) $(EXTRA_INC
) $(CDPARANOIA_INC
) $(SDL_INC
) $(X11_INC
) $(FRIBIDI_INC
) $(DVB_INC
) $(XVID_INC
) $(FONTCONFIG_INC
) # -Wall
42 PARTS
= libmpdemux libmpcodecs mp3lib liba52 libmpeg2 libavcodec libavformat libao2 drivers osdep postproc input libvo libaf
43 ifeq ($(INTERNAL_FAAD
),yes
)
44 COMMON_LIBS
+= libfaad2
/libfaad2.a
64 PARTS
+= loader loader
/dshow loader
/dmo
71 ifeq ($(MENCODER
),yes
)
72 ALL_PRG
+= $(PRG_MENCODER
)
75 COMMON_DEPS
= $(W32_DEP
) $(DS_DEP
) $(MP1E_DEP
) $(AV_DEP
) libmpdemux
/libmpdemux.a libmpcodecs
/libmpcodecs.a libao2
/libao2.a liba52
/liba52.a mp3lib
/libMP3.a libmpeg2
/libmpeg2.a osdep
/libosdep.a postproc
/libswscale.a input
/libinput.a libvo
/libvo.a libaf
/libaf.a
77 ifeq ($(INTERNAL_FAAD
),yes
)
78 COMMON_DEPS
+= libfaad2
/libfaad2.a
81 COMMON_DEPS
+= libdha
/libdha.so vidix
/libvidix.a
84 COMMON_DEPS
+= libfame
/libfame.a
87 ifeq ($(DVDKIT_SHARED
),yes
)
88 COMMON_DEPS
+= libmpdvdkit2
/libmpdvdkit.so
90 COMMON_DEPS
+= libmpdvdkit2
/libmpdvdkit.a
94 ifeq ($(SHARED_PP
),yes
)
95 COMMON_DEPS
+= libavcodec
/libpostproc
/libpostproc.so
96 COMMON_LIBS
+= libavcodec
/libpostproc
/libpostproc.so
100 COMMON_DEPS
+= Gui
/libgui.a
101 GUI_LIBS
= Gui
/libgui.a
106 # .PHONY: $(COMMON_DEPS)
108 all: version.h
$(ALL_PRG
)
111 $(CC
) -c
$(CFLAGS
) -o
$@
$<
116 libmpdvdkit2
/libmpdvdkit.a
:
117 $(MAKE
) -C libmpdvdkit2
119 libmpdvdkit2
/libmpdvdkit.so
:
120 $(MAKE
) -C libmpdvdkit2 libmpdvdkit.so
128 libmpdemux
/libmpdemux.a
:
129 $(MAKE
) -C libmpdemux
131 libmpcodecs
/libmpcodecs.a
:
132 $(MAKE
) -C libmpcodecs
134 loader
/dshow
/libDS_Filter.a
:
135 $(MAKE
) -C loader
/dshow
137 loader
/dmo
/libDMO_Filter.a
:
138 $(MAKE
) -C loader
/dmo
140 libavcodec
/libavcodec.a
:
141 $(MAKE
) -C libavcodec LIBPREF
=lib LIBSUF
=.a
143 libavformat
/libavformat.a
:
144 $(MAKE
) -C libavformat LIBPREF
=lib LIBSUF
=.a
176 postproc
/libswscale.a
:
185 libavcodec
/libpostproc
/libpostproc.so
:
186 $(MAKE
) -C libavcodec
/libpostproc
188 MPLAYER_DEP
= $(OBJS_MPLAYER
) $(COMMON_DEPS
)
190 ifeq ($(LIBMENU
),yes
)
191 MPLAYER_DEP
+= libmenu
/libmenu.a
192 MENU_LIBS
= libmenu
/libmenu.a
198 MENCODER_DEP
= $(OBJS_MENCODER
) $(COMMON_DEPS
)
201 VIDIX_LIBS
= vidix
/libvidix.a
206 ifeq ($(TARGET_WIN32
),yes
)
207 OBJS_MPLAYER
+= mplayer-rc.o
210 $(PRG
): $(MPLAYER_DEP
)
211 .
/darwinfixlib.sh
$(MPLAYER_DEP
)
212 ifeq ($(TARGET_WIN32
),yes
)
213 windres
-o mplayer-rc.o mplayer.rc
215 $(CC
) $(CFLAGS
) -o
$(PRG
) $(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
) $(ARCH_LIB
) $(I18NLIBS
) -lm
217 mplayer.exe.spec.c
: libmpcodecs
/libmpcodecs.a
218 winebuild
-fPIC
-o mplayer.exe.spec.c
-exe mplayer.exe
-mcui \
219 libmpcodecs
/ad_qtaudio.o libmpcodecs
/vd_qtvideo.o \
220 -L
/usr
/local
/lib
/wine
-lkernel32
222 mplayer.exe.so
: $(MPLAYER_DEP
) mplayer.exe.spec.c
223 $(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
-lm
225 mplayer_wine.so
: $(MPLAYER_DEP
)
226 .
/darwinfixlib.sh
$(MPLAYER_DEP
)
227 $(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
) -lm
229 ifeq ($(MENCODER
),yes
)
230 $(PRG_MENCODER
): $(MENCODER_DEP
)
231 .
/darwinfixlib.sh
$(MENCODER_DEP
) libmpcodecs
/libmpencoders.a
232 $(CC
) $(CFLAGS
) -o
$(PRG_MENCODER
) $(OBJS_MENCODER
) libmpcodecs
/libmpencoders.a
$(ENCORE_LIB
) $(COMMON_LIBS
) $(EXTRA_LIB
) $(MLIB_LIB
) $(LIRC_LIB
) $(LIRCC_LIB
) $(ARCH_LIB
) $(I18NLIBS
) -lm
235 codecs.conf.h
: $(PRG_CFG
) etc
/codecs.conf
236 .
/$(PRG_CFG
) .
/etc
/codecs.conf
> $@
238 codec-cfg.o
: codecs.conf.h
240 # Every mplayer dependency depends on version.h, to force building version.h
241 # first (in serial mode) before any other of the dependencies for a parallel make
242 # run. This is necessary, because the make rule for version.h removes objects
243 # in a recursive "make distclean" and we must wait for this "make distclean" to
244 # finish before we can start building new object files.
245 $(MPLAYER_DEP
): version.h
246 $(MENCODER_DEP
): version.h
248 $(PRG_CFG
): version.h codec-cfg.c codec-cfg.h
249 $(CC
) $(CFLAGS
) -g codec-cfg.c mp_msg.c
-o
$(PRG_CFG
) -DCODECS2HTML
$(EXTRA_LIB
) $(I18NLIBS
)
255 if
test ! -d
$(BINDIR
) ; then mkdir
-p
$(BINDIR
) ; fi
256 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG
) $(BINDIR
)/$(PRG
)
258 -ln
-sf
$(PRG
) $(BINDIR
)/gmplayer
260 if
test ! -d
$(MANDIR
)/man1
; then mkdir
-p
$(MANDIR
)/man1
; fi
261 for i in
$(LANGUAGES
); do \
262 if
test "$$i" = en
; then \
263 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/mplayer
.1 ; \
265 mkdir
-p
$(MANDIR
)/$$i/man1
; \
266 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/mplayer
.1 ; \
269 ifeq ($(MENCODER
),yes
)
270 $(INSTALL
) -m
755 $(INSTALLSTRIP
) $(PRG_MENCODER
) $(BINDIR
)/$(PRG_MENCODER
)
271 for i in
$(LANGUAGES
); do \
272 if
test "$$i" = en
; then \
273 ln
-sf mplayer
.1 $(MANDIR
)/man1
/mencoder
.1 ; \
275 ln
-sf mplayer
.1 $(MANDIR
)/$$i/man1
/mencoder
.1 ; \
279 @if
test ! -d
$(DATADIR
) ; then mkdir
-p
$(DATADIR
) ; fi
280 @if
test ! -d
$(DATADIR
)/font
; then mkdir
-p
$(DATADIR
)/font
; fi
281 @if
test ! -f
$(DATADIR
)/font
/font.desc
; then \
282 echo
"*** Download font at http://www.mplayerhq.hu/homepage/dload.html" ; \
283 echo
"*** for OSD/Subtitles support and extract to $(DATADIR)/font/" ; \
286 @if
test ! -d
$(DATADIR
)/Skin
; then mkdir
-p
$(DATADIR
)/Skin
; fi
287 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/homepage/dload.html"
288 @echo
"*** for GUI, and extract to $(DATADIR)/Skin/"
290 @if
test ! -d
$(CONFDIR
) ; then mkdir
-p
$(CONFDIR
) ; fi
291 @if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
292 ifeq ($(DVDKIT_SHARED
),yes
)
293 ifeq ($(DVDKIT2
),yes
)
294 if
test ! -d
$(LIBDIR
) ; then mkdir
-p
$(LIBDIR
) ; fi
295 $(INSTALL
) -m
755 $(INSTALLSTRIP
) libmpdvdkit2
/libmpdvdkit.so
$(LIBDIR
)/libmpdvdkit.so
298 if
test ! -d
$(LIBDIR
) ; then mkdir
-p
$(LIBDIR
) ; fi
299 $(INSTALL
) -m
755 $(INSTALLSTRIP
) libmpdvdkit
/libmpdvdkit.so
$(LIBDIR
)/libmpdvdkit.so
305 -rm -f
$(BINDIR
)/$(PRG
) $(BINDIR
)/gmplayer
$(MANDIR
)/man1
/mplayer
.1
306 -rm -f
$(BINDIR
)/$(PRG_MENCODER
) $(MANDIR
)/man1
/mencoder
.1
307 @echo
"Uninstall completed"
310 -rm -f
*.o
*~
$(OBJS
) codecs.conf.h
313 -rm -f
*~
$(PRG
) $(PRG_MENCODER
) $(PRG_CFG
) $(OBJS
)
314 -rm -f
*.o
*.a .depend configure.log codecs.conf.h
315 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
316 -$(MAKE
) -C libavcodec
distclean LIBPREF
=lib LIBSUF
=.a
317 -$(MAKE
) -C libavformat
distclean LIBPREF
=lib LIBSUF
=.a
325 .
/version.sh
`$(CC) -dumpversion`
326 $(CC
) -MM
$(CFLAGS
) -DCODECS2HTML mplayer.c mencoder.c
$(SRCS_MPLAYER
) $(SRCS_MENCODER
) 1>.depend
327 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
329 # ./configure must be run if it changed in CVS
331 @echo
"############################################################"
332 @echo
"####### Please run ./configure again - it's changed! #######"
333 @echo
"############################################################"
334 ifeq ($(wildcard .developer
),)
338 # do not rebuild after cvs commits if .developer file is present!
340 # rebuild at every config.h/config.mak change:
342 .
/version.sh
`$(CC) -dumpversion`
343 ifeq ($(wildcard .developer
),)
348 # rebuild at every CVS update or config/makefile change:
349 ifeq ($(wildcard .developer
),)
350 ifneq ($(wildcard CVS
/Entries
),)
351 version.h
: CVS
/Entries
353 version.h
: config.h config.mak Makefile
357 # include dependencies to get make to recurse into lib dirs,
358 # if the user desires such behavior
360 ifneq ($(wildcard .libdeps
),)
365 # include dependency files if they exist
367 ifneq ($(wildcard .depend
),)