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
9 CFLAGS
= $(OPTFLAGS
) -I.
11 CFLAGS-
$(CONFIG_LIBAVUTIL
) += -I.
/libavutil
12 CFLAGS-
$(CONFIG_LIBAVCODEC
) += -I.
/libavcodec
13 CFLAGS
+= $(CFLAGS-yes
)
17 # Do not strip the binaries at installation
18 ifeq ($(STRIPBINARIES
),yes
)
22 SRCS_COMMON
= asxparser.c \
38 SRCS_COMMON-
$(UNRARLIB
) += unrarlib.c
40 SRCS_MPLAYER
= mplayer.c \
48 SRCS_MENCODER
= mencoder.c \
54 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a \
56 libmpdemux
/libmpdemux.a \
58 libswscale
/libswscale.a \
61 LIBS_MPLAYER
= libvo
/libvo.a \
65 LIBS_MENCODER
= libmpcodecs
/libmpencoders.a \
66 libmpdemux
/libmpmux.a \
68 OBJS_MPLAYER
= $(SRCS_MPLAYER
:.c
=.o
)
69 OBJS_MENCODER
= $(SRCS_MENCODER
:.c
=.o
)
71 # Having this in libosdep.a is not enough.
72 OBJS_MPLAYER-
$(TARGET_WIN32
) += osdep
/mplayer-rc.o
74 MPLAYER_DEPS
= $(OBJS_MPLAYER
) $(LIBS_MPLAYER
) $(COMMON_LIBS
)
75 MENCODER_DEPS
= $(OBJS_MENCODER
) $(LIBS_MENCODER
) $(COMMON_LIBS
)
91 COMMON_LIBS-
$(CONFIG_LIBAVFORMAT
) += libavformat
/libavformat.a
92 PARTS-
$(CONFIG_LIBAVFORMAT
) += libavformat
93 COMMON_LIBS-
$(CONFIG_LIBAVCODEC
) += libavcodec
/libavcodec.a
94 PARTS-
$(CONFIG_LIBAVCODEC
) += libavcodec
95 COMMON_LIBS-
$(CONFIG_LIBAVUTIL
) += libavutil
/libavutil.a
96 PARTS-
$(CONFIG_LIBAVUTIL
) += libavutil
97 COMMON_LIBS-
$(CONFIG_LIBPOSTPROC
) += libpostproc
/libpostproc.a
98 PARTS-
$(CONFIG_LIBPOSTPROC
) += libpostproc
99 COMMON_LIBS-
$(WIN32DLL
) += loader
/libloader.a
100 PARTS-
$(WIN32DLL
) += loader
101 COMMON_LIBS-
$(MP3LIB
) += mp3lib
/libMP3.a
102 PARTS-
$(MP3LIB
) += mp3lib
103 COMMON_LIBS-
$(LIBA52
) += liba52
/liba52.a
104 PARTS-
$(LIBA52
) += liba52
105 COMMON_LIBS-
$(LIBMPEG2
) += libmpeg2
/libmpeg2.a
106 PARTS-
$(LIBMPEG2
) += libmpeg2
107 COMMON_LIBS-
$(FAAD_INTERNAL
) += libfaad2
/libfaad2.a
108 PARTS-
$(FAAD_INTERNAL
) += libfaad2
109 COMMON_LIBS-
$(TREMOR_INTERNAL
) += tremor
/libvorbisidec.a
110 PARTS-
$(TREMOR_INTERNAL
) += tremor
111 LIBS_MPLAYER-
$(VIDIX
) += vidix
/libvidix.a
112 PARTS-
$(VIDIX
) += libdha vidix
113 COMMON_LIBS-
$(DVDREAD_INTERNAL
) += dvdread
/libdvdread.a
114 PARTS-
$(DVDREAD_INTERNAL
) += dvdread
115 COMMON_LIBS-
$(DVDCSS_INTERNAL
) += libdvdcss
/libdvdcss.a
116 PARTS-
$(DVDCSS_INTERNAL
) += libdvdcss
117 COMMON_LIBS-
$(CONFIG_ASS
) += libass
/libass.a
118 PARTS-
$(CONFIG_ASS
) += libass
119 LIBS_MPLAYER-
$(GUI
) += Gui
/libgui.a
121 LIBS_MPLAYER-
$(LIBMENU
) += libmenu
/libmenu.a
122 PARTS-
$(LIBMENU
) += libmenu
124 COMMON_LDFLAGS
+= $(EXTRA_LIB
)\
127 LDFLAGS_MPLAYER
= $(EXTRALIBS_MPLAYER
) \
130 LDFLAGS_MENCODER
= $(EXTRALIBS_MENCODER
) \
133 ALL_PRG-
$(MPLAYER
) += mplayer
$(EXESUF
)
134 ALL_PRG-
$(MENCODER
) += mencoder
$(EXESUF
)
136 SRCS_COMMON
+= $(SRCS_COMMON-yes
)
137 COMMON_LIBS
+= $(COMMON_LIBS-yes
)
138 LIBS_MPLAYER
+= $(LIBS_MPLAYER-yes
)
139 OBJS_MPLAYER
+= $(OBJS_MPLAYER-yes
)
140 PARTS
+= $(PARTS-yes
)
141 ALL_PRG
+= $(ALL_PRG-yes
)
143 COMMON_LIBS
+= osdep
/libosdep.a
151 dvdread
/libdvdread.a
:
154 libdvdcss
/libdvdcss.a
:
163 libmpdemux
/libmpdemux.a
:
164 $(MAKE
) -C libmpdemux libmpdemux.a
166 libmpdemux
/libmpmux.a
:
167 $(MAKE
) -C libmpdemux libmpmux.a
172 libmpcodecs
/libmpcodecs.a
:
173 $(MAKE
) -C libmpcodecs
175 libavutil
/libavutil.a
:
176 $(MAKE
) -C libavutil LIBPREF
=lib LIBSUF
=.a
178 libavcodec
/libavcodec.a
:
179 $(MAKE
) -C libavcodec LIBPREF
=lib LIBSUF
=.a
181 libpostproc
/libpostproc.a
:
182 $(MAKE
) -C libpostproc LIBPREF
=lib LIBSUF
=.a
184 libavformat
/libavformat.a
:
185 $(MAKE
) -C libavformat LIBPREF
=lib LIBSUF
=.a
187 libswscale
/libswscale.a
:
188 $(MAKE
) -C libswscale LIBPREF
=lib LIBSUF
=.a
194 $(MAKE
) -C libvo libvo.a
197 $(MAKE
) -C libvo libosd.a
211 tremor
/libvorbisidec.a
:
217 vidix
/libvidix.a
: libdha
/libdha.so
227 $(MAKE
) -C osdep mplayer-rc.o
235 mplayer
$(EXESUF
): $(MPLAYER_DEPS
)
236 $(CC
) -o
$@
$^
$(LDFLAGS_MPLAYER
)
238 mencoder
$(EXESUF
): $(MENCODER_DEPS
)
239 $(CC
) -o
$@
$^
$(LDFLAGS_MENCODER
)
241 codec-cfg
$(EXESUF
): codec-cfg.c codec-cfg.h help_mp.h
242 $(HOST_CC
) -I.
-DCODECS2HTML
$< -o
$@
244 codecs.conf.h
: codec-cfg
$(EXESUF
) etc
/codecs.conf
245 .
/codec-cfg
$(EXESUF
) .
/etc
/codecs.conf
> $@
247 codec-cfg.o
: codecs.conf.h
249 codecs2html
$(EXESUF
): mp_msg.o
250 $(CC
) -DCODECS2HTML codec-cfg.c
$^
-o
$@
254 $(MAKE
) -C libdha
install
255 mkdir
-p
$(LIBDIR
)/mplayer
/vidix
256 -install -m
755 $(INSTALLSTRIP
) -p vidix
/drivers
/*.so
$(LIBDIR
)/mplayer
/vidix
258 $(INSTALL
) -d
$(BINDIR
)
259 $(INSTALL
) -m
755 $(INSTALLSTRIP
) mplayer
$(EXESUF
) $(BINDIR
)
260 $(INSTALL
) -d
$(MANDIR
)/man1
261 for i in
$(MAN_LANG
); do \
262 if
test "$$i" = en
; then \
263 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/ ; \
265 $(INSTALL
) -d
$(MANDIR
)/$$i/man1
; \
266 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/ ; \
269 ifeq ($(MENCODER
),yes
)
270 $(INSTALL
) -m
755 $(INSTALLSTRIP
) mencoder
$(EXESUF
) $(BINDIR
)
271 for i in
$(MAN_LANG
); do \
272 if
test "$$i" = en
; then \
273 cd
$(MANDIR
)/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
275 cd
$(MANDIR
)/$$i/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
279 $(INSTALL
) -d
$(DATADIR
)
280 $(INSTALL
) -d
$(DATADIR
)/font
282 -ln
-sf mplayer
$(EXESUF
) $(BINDIR
)/gmplayer
$(EXESUF
)
283 $(INSTALL
) -d
$(DATADIR
)/skins
284 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/dload.html"
285 @echo
"*** for GUI, and extract to $(DATADIR)/skins/"
286 $(INSTALL
) -d
$(prefix)/share
/pixmaps
287 $(INSTALL
) -m
644 etc
/mplayer.xpm
$(prefix)/share
/pixmaps
/
288 $(INSTALL
) -d
$(prefix)/share
/applications
289 $(INSTALL
) -m
644 etc
/mplayer.desktop
$(prefix)/share
/applications
/
291 $(INSTALL
) -d
$(CONFDIR
)
292 if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
295 -rm -f
$(BINDIR
)/mplayer
$(EXESUF
) $(BINDIR
)/gmplayer
$(EXESUF
)
296 -rm -f
$(BINDIR
)/mencoder
$(EXESUF
)
297 -rm -f
$(MANDIR
)/man1
/mencoder
.1 $(MANDIR
)/man1
/mplayer
.1
298 -rm -f
$(prefix)/share
/pixmaps
/mplayer.xpm
299 -rm -f
$(prefix)/share
/applications
/mplayer.desktop
300 for l in
$(MAN_LANG
); do \
301 if
test "$$l" != "en"; then \
302 rm -f
$(MANDIR
)/$$l/man1
/mplayer
.1 \
303 $(MANDIR
)/$$l/man1
/mencoder
.1 \
304 $(MANDIR
)/$$l/man1
/gmplayer
.1 ; \
307 $(MAKE
) -C libdha
uninstall
308 rm -f
$(LIBDIR
)/mplayer
/vidix
/*.so
309 -rmdir
-p
$(LIBDIR
)/mplayer
/vidix
315 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a clean; done
317 distclean: dirclean doxygen_clean
318 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
319 -rm -f
*~ mplayer
$(EXESUF
) mencoder
$(EXESUF
) \
320 codec-cfg
$(EXESUF
) codecs2html
$(EXESUF
) codecs.conf.h \
321 .depend configure.log config.mak config.h help_mp.h version.h
326 dep depend
: help_mp.h version.h
327 $(CC
) -MM
$(CFLAGS
) -DCODECS2HTML mplayer.c mencoder.c
$(SRCS_MPLAYER
) $(SRCS_MENCODER
) 1>.depend
328 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
330 # ./configure must be rerun if it changed
332 @echo
"############################################################"
333 @echo
"####### Please run ./configure again - it's changed! #######"
334 @echo
"############################################################"
336 # rebuild at every config.h/config.mak/Makefile change:
337 version.h
: config.h config.mak Makefile
338 .
/version.sh
`$(CC) -dumpversion`
341 doxygen DOCS
/tech
/Doxyfile
344 -rm -rf DOCS
/tech
/doxygen
346 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
347 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
348 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
350 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
352 iconv
-f UTF-8
-t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
355 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
356 @echo
"Adding untranslated messages to help_mp.h"
357 @echo
'// untranslated messages from the English master file:' >> help_mp.h
358 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
361 # explicit dependencies to force version.h to be built even if .depend is missing
362 mplayer.o mencoder.o vobsub.o
: version.h
364 # temporary measure to make sure help_mp.h is built. we desperately need correct deps!
365 $(MPLAYER_DEPS
) $(MENCODER_DEPS
): help_mp.h
368 # the following lines provide _partial_ dependency information
369 # for the 'library' directories under main dir, in order to cause
370 # the build process to recursively descend into them if something
371 # has changed. ideally this will be replaced with a single
372 # nonrecursive makefile for the whole project.
374 # Now all directories are recursed by default because these rules do not
375 # consider dependencies on files in other directories, while the recursively
376 # invoked Makefiles do. Conditional recursion only to the directories with
377 # changed files can be enabled by creating a file named ".norecurse" and
378 # optionally giving it a timestamp in the past. Directories whose .a files
379 # are newer than the timestamp and newer than other files in the directory
380 # will not be recursed.
383 libvo
/libvo.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
384 libvo
/libosd.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
385 libao2
/libao2.a
: .norecurse
$(wildcard libao2
/*.
[ch
])
386 osdep
/libosdep.a
: .norecurse
$(wildcard osdep
/*.
[ch
])
387 input
/libinput.a
: .norecurse
$(wildcard input
/*.
[ch
])
389 libmenu
/libmenu.a
: .norecurse
$(wildcard libmenu
/*.
[ch
])
390 libaf
/libaf.a
: .norecurse
$(wildcard libaf
/*.
[ch
])
391 dvdread
/libdvdread.a
: .norecurse
$(wildcard dvdread
/*.
[ch
])
392 libdvdcss
/libdvdcss.a
: .norecurse
$(wildcard libdvdcss
/*.
[ch
])
394 libmpdemux
/libmpdemux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
395 libmpdemux
/libmpmux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
396 stream
/stream.a
: .norecurse
$(wildcard stream
/*.
[ch
] stream
/*/*.
[ch
])
397 libmpcodecs
/libmpcodecs.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
]) $(wildcard libmpcodecs
/native
/*.
[ch
])
398 libmpcodecs
/libmpencoders.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
])
400 libavutil
/libavutil.a
: .norecurse
$(wildcard libavutil
/*.
[ch
])
401 libavcodec
/libavcodec.a
: .norecurse
$(wildcard libavcodec
/*.
[ch
] libavcodec
/*/*.
[chS
])
402 libavformat
/libavformat.a
: .norecurse
$(wildcard libavformat
/*.
[ch
])
403 libswscale
/libswscale.a
: .norecurse
$(wildcard libswscale
/*.
[ch
])
405 libmpeg2
/libmpeg2.a
: .norecurse
$(wildcard libmpeg2
/*.
[ch
])
406 liba52
/liba52.a
: .norecurse
$(wildcard liba52
/*.
[ch
])
407 mp3lib
/libMP3.a
: .norecurse
$(wildcard mp3lib
/*.
[ch
])
408 libfaad2
/libfaad2.a
: .norecurse
$(wildcard libfaad2
/*.
[ch
] libfaad2
/*/*.
[ch
])
410 loader
/libloader.a
: .norecurse
$(wildcard loader
/*.
[chSs
])
411 libdha
/libdha.so
: .norecurse
$(wildcard libdha
/*.
[ch
])
412 vidix
/libvidix.a
: .norecurse
$(wildcard vidix
/*.
[ch
])
413 Gui
/libgui.a
: .norecurse
$(wildcard Gui
/*.
[ch
] Gui
/*/*.
[ch
] Gui
/*/*/*.
[ch
])
415 libass
/libass.a
: .norecurse
$(wildcard libass
/*.
[ch
])
417 ifneq ($(wildcard .depend
),)