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 COMMON_LDFLAGS
+= $(EXTRA_LIB
)\
12 LDFLAGS_MPLAYER
= $(EXTRALIBS_MPLAYER
) \
15 LDFLAGS_MENCODER
= $(EXTRALIBS_MENCODER
) \
18 SRCS_COMMON
= asxparser.c \
36 SRCS_COMMON-
$(UNRARLIB
) += unrarlib.c
38 SRCS_MPLAYER
= mplayer.c \
47 SRCS_MENCODER
= mencoder.c \
52 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a \
54 libmpdemux
/libmpdemux.a \
56 libswscale
/libswscale.a \
59 COMMON_LIBS-
$(LIBAVFORMAT_A
) += libavformat
/libavformat.a
60 COMMON_LIBS-
$(LIBAVCODEC_A
) += libavcodec
/libavcodec.a
61 COMMON_LIBS-
$(LIBAVUTIL_A
) += libavutil
/libavutil.a
62 COMMON_LIBS-
$(LIBPOSTPROC_A
) += libpostproc
/libpostproc.a
63 COMMON_LIBS-
$(WIN32DLL
) += loader
/libloader.a
64 COMMON_LIBS-
$(MP3LIB
) += mp3lib
/libmp3.a
65 COMMON_LIBS-
$(LIBA52
) += liba52
/liba52.a
66 COMMON_LIBS-
$(LIBMPEG2
) += libmpeg2
/libmpeg2.a
67 COMMON_LIBS-
$(FAAD_INTERNAL
) += libfaad2
/libfaad2.a
68 COMMON_LIBS-
$(TREMOR_INTERNAL
) += tremor
/libvorbisidec.a
69 COMMON_LIBS-
$(DVDREAD_INTERNAL
) += dvdread
/libdvdread.a
70 COMMON_LIBS-
$(DVDCSS_INTERNAL
) += libdvdcss
/libdvdcss.a
71 COMMON_LIBS-
$(ASS
) += libass
/libass.a
73 LIBS_MPLAYER
= libvo
/libvo.a \
77 LIBS_MPLAYER-
$(VIDIX
) += vidix
/libvidix.a
78 LIBS_MPLAYER-
$(GUI
) += gui
/libgui.a
79 LIBS_MPLAYER-
$(LIBMENU
) += libmenu
/libmenu.a
81 LIBS_MENCODER
= libmpcodecs
/libmpencoders.a \
82 libmpdemux
/libmpmux.a \
84 # Having this in libosdep.a is not enough.
85 OBJS_MPLAYER-
$(TARGET_WIN32
) += osdep
/mplayer-rc.o
87 ALL_PRG-
$(MPLAYER
) += mplayer
$(EXESUF
)
88 ALL_PRG-
$(MENCODER
) += mencoder
$(EXESUF
)
90 COMMON_LIBS
+= $(COMMON_LIBS-yes
)
91 LIBS_MPLAYER
+= $(LIBS_MPLAYER-yes
)
92 OBJS_MPLAYER
+= $(OBJS_MPLAYER-yes
)
94 ALL_PRG
+= $(ALL_PRG-yes
)
96 COMMON_LIBS
+= osdep
/libosdep.a
98 MPLAYER_DEPS
= $(OBJS_MPLAYER
) $(OBJS_COMMON
) $(LIBS_MPLAYER
) $(COMMON_LIBS
)
99 MENCODER_DEPS
= $(OBJS_MENCODER
) $(OBJS_COMMON
) $(LIBS_MENCODER
) $(COMMON_LIBS
)
101 INSTALL_TARGETS-
$(MPLAYER
) += install-mplayer install-mplayer-man
102 INSTALL_TARGETS-
$(MENCODER
) += install-mencoder install-mplayer-man
103 INSTALL_TARGETS-
$(GUI
) += install-gui
104 INSTALL_TARGETS
+= $(INSTALL_TARGETS-yes
)
135 dep depend
:: help_mp.h version.h codecs.conf.h
136 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
140 CFLAGS
:= $(subst -I..
,-I.
,$(CFLAGS
))
145 dvdread
/libdvdread.a
:
148 libdvdcss
/libdvdcss.a
:
157 libmpdemux
/libmpdemux.a
:
158 $(MAKE
) -C libmpdemux libmpdemux.a
160 libmpdemux
/libmpmux.a
:
161 $(MAKE
) -C libmpdemux libmpmux.a
166 libmpcodecs
/libmpcodecs.a
:
167 $(MAKE
) -C libmpcodecs
169 libavutil
/libavutil.a
:
172 libavcodec
/libavcodec.a
:
173 $(MAKE
) -C libavcodec
175 libpostproc
/libpostproc.a
:
176 $(MAKE
) -C libpostproc
178 libavformat
/libavformat.a
:
179 $(MAKE
) -C libavformat
181 libswscale
/libswscale.a
:
182 $(MAKE
) -C libswscale
188 $(MAKE
) -C libvo libvo.a
191 $(MAKE
) -C libvo libosd.a
205 tremor
/libvorbisidec.a
:
217 osdep
/mplayer-rc.o
: version.h
218 $(MAKE
) -C osdep mplayer-rc.o
226 mplayer
$(EXESUF
): $(MPLAYER_DEPS
)
227 $(CC
) -o
$@
$^
$(LDFLAGS_MPLAYER
)
229 mencoder
$(EXESUF
): $(MENCODER_DEPS
)
230 $(CC
) -o
$@
$^
$(LDFLAGS_MENCODER
)
232 codec-cfg
$(EXESUF
): codec-cfg.c codec-cfg.h help_mp.h
233 $(HOST_CC
) -I.
-DCODECS2HTML
$< -o
$@
235 codecs.conf.h
: codec-cfg
$(EXESUF
) etc
/codecs.conf
236 .
/codec-cfg
$(EXESUF
) .
/etc
/codecs.conf
> $@
238 codec-cfg.o
: codecs.conf.h
240 codecs2html
$(EXESUF
): mp_msg.o
241 $(CC
) -DCODECS2HTML codec-cfg.c
$^
-o
$@
243 codec-cfg-test
$(EXESUF
): codecs.conf.h codec-cfg.h mp_msg.o osdep
/getch2.o
244 $(CC
) -I.
-DTESTING codec-cfg.c mp_msg.o osdep
/getch2.o
-ltermcap
-o
$@
246 install: install-dirs
$(INSTALL_TARGETS
)
249 $(INSTALL
) -d
$(BINDIR
)
250 $(INSTALL
) -d
$(DATADIR
)
251 $(INSTALL
) -d
$(MANDIR
)/man1
252 $(INSTALL
) -d
$(CONFDIR
)
253 if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
255 install-mplayer
: mplayer
$(EXESUF
)
256 $(INSTALL
) -m
755 $(INSTALLSTRIP
) mplayer
$(EXESUF
) $(BINDIR
)
259 for i in
$(MAN_LANG
); do \
260 if
test "$$i" = en
; then \
261 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/ ; \
263 $(INSTALL
) -d
$(MANDIR
)/$$i/man1
; \
264 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/ ; \
268 install-mencoder
: mencoder
$(EXESUF
)
269 $(INSTALL
) -m
755 $(INSTALLSTRIP
) mencoder
$(EXESUF
) $(BINDIR
)
270 for i in
$(MAN_LANG
); do \
271 if
test "$$i" = en
; then \
272 cd
$(MANDIR
)/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
274 cd
$(MANDIR
)/$$i/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
279 -ln
-sf mplayer
$(EXESUF
) $(BINDIR
)/gmplayer
$(EXESUF
)
280 $(INSTALL
) -d
$(DATADIR
)/skins
281 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/design7/dload.html"
282 @echo
"*** for GUI, and extract to $(DATADIR)/skins/"
283 $(INSTALL
) -d
$(prefix)/share
/pixmaps
284 $(INSTALL
) -m
644 etc
/mplayer.xpm
$(prefix)/share
/pixmaps
/
285 $(INSTALL
) -d
$(prefix)/share
/applications
286 $(INSTALL
) -m
644 etc
/mplayer.desktop
$(prefix)/share
/applications
/
289 -rm -f
$(BINDIR
)/mplayer
$(EXESUF
) $(BINDIR
)/gmplayer
$(EXESUF
)
290 -rm -f
$(BINDIR
)/mencoder
$(EXESUF
)
291 -rm -f
$(MANDIR
)/man1
/mencoder
.1 $(MANDIR
)/man1
/mplayer
.1
292 -rm -f
$(prefix)/share
/pixmaps
/mplayer.xpm
293 -rm -f
$(prefix)/share
/applications
/mplayer.desktop
294 for l in
$(MAN_LANG
); do \
295 if
test "$$l" != "en"; then \
296 rm -f
$(MANDIR
)/$$l/man1
/mplayer
.1 \
297 $(MANDIR
)/$$l/man1
/mencoder
.1 \
298 $(MANDIR
)/$$l/man1
/gmplayer
.1 ; \
303 -rm -f mplayer
$(EXESUF
) mencoder
$(EXESUF
) codec-cfg
$(EXESUF
) \
304 codecs2html
$(EXESUF
) codec-cfg-test
$(EXESUF
) cpuinfo
$(EXESUF
) \
305 codecs.conf.h help_mp.h version.h
306 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a clean; done
308 distclean:: doxygen_clean
309 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
310 $(MAKE
) -C TOOLS
distclean
311 -rm -f configure.log config.mak config.h
316 # ./configure must be rerun if it changed
317 config.mak
: configure
318 @echo
"############################################################"
319 @echo
"####### Please run ./configure again - it's changed! #######"
320 @echo
"############################################################"
322 # rebuild at every config.h/config.mak/Makefile change:
323 version.h
: config.h config.mak Makefile
324 .
/version.sh
`$(CC) -dumpversion`
327 doxygen DOCS
/tech
/Doxyfile
330 -rm -rf DOCS
/tech
/doxygen
332 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
333 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
334 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
336 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
338 iconv
-f UTF-8
-t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
341 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
342 @echo
"Adding untranslated messages to help_mp.h"
343 @echo
'// untranslated messages from the English master file:' >> help_mp.h
344 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
347 # explicit dependencies to force version.h to be built even if .depend is missing
348 mplayer.o mencoder.o vobsub.o
: version.h
350 # temporary measure to make sure help_mp.h is built. we desperately need correct deps!
351 $(MPLAYER_DEPS
) $(MENCODER_DEPS
): help_mp.h
354 # the following lines provide _partial_ dependency information
355 # for the 'library' directories under main dir, in order to cause
356 # the build process to recursively descend into them if something
357 # has changed. ideally this will be replaced with a single
358 # nonrecursive makefile for the whole project.
360 # Now all directories are recursed by default because these rules do not
361 # consider dependencies on files in other directories, while the recursively
362 # invoked Makefiles do. Conditional recursion only to the directories with
363 # changed files can be enabled by creating a file named ".norecurse" and
364 # optionally giving it a timestamp in the past. Directories whose .a files
365 # are newer than the timestamp and newer than other files in the directory
366 # will not be recursed.
369 libvo
/libvo.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
370 libvo
/libosd.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
371 libao2
/libao2.a
: .norecurse
$(wildcard libao2
/*.
[ch
])
372 osdep
/libosdep.a
: .norecurse
$(wildcard osdep
/*.
[ch
])
373 input
/libinput.a
: .norecurse
$(wildcard input
/*.
[ch
])
375 libmenu
/libmenu.a
: .norecurse
$(wildcard libmenu
/*.
[ch
])
376 libaf
/libaf.a
: .norecurse
$(wildcard libaf
/*.
[ch
])
377 dvdread
/libdvdread.a
: .norecurse
$(wildcard dvdread
/*.
[ch
])
378 libdvdcss
/libdvdcss.a
: .norecurse
$(wildcard libdvdcss
/*.
[ch
])
380 libmpdemux
/libmpdemux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
381 libmpdemux
/libmpmux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
382 stream
/stream.a
: .norecurse
$(wildcard stream
/*.
[ch
] stream
/*/*.
[ch
])
383 libmpcodecs
/libmpcodecs.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
]) $(wildcard libmpcodecs
/native
/*.
[ch
])
384 libmpcodecs
/libmpencoders.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
])
386 libavutil
/libavutil.a
: .norecurse
$(wildcard libavutil
/*.
[ch
])
387 libavcodec
/libavcodec.a
: .norecurse
$(wildcard libavcodec
/*.
[ch
] libavcodec
/*/*.
[chS
])
388 libavformat
/libavformat.a
: .norecurse
$(wildcard libavformat
/*.
[ch
])
389 libswscale
/libswscale.a
: .norecurse
$(wildcard libswscale
/*.
[ch
])
391 libmpeg2
/libmpeg2.a
: .norecurse
$(wildcard libmpeg2
/*.
[ch
])
392 liba52
/liba52.a
: .norecurse
$(wildcard liba52
/*.
[ch
])
393 mp3lib
/libmp3.a
: .norecurse
$(wildcard mp3lib
/*.
[ch
])
394 libfaad2
/libfaad2.a
: .norecurse
$(wildcard libfaad2
/*.
[ch
] libfaad2
/*/*.
[ch
])
396 loader
/libloader.a
: .norecurse
$(wildcard loader
/*.
[chSs
])
397 vidix
/libvidix.a
: .norecurse
$(wildcard vidix
/*.
[ch
])
398 gui
/libgui.a
: .norecurse
$(wildcard gui
/*.
[ch
] gui
/*/*.
[ch
] gui
/*/*/*.
[ch
])
400 libass
/libass.a
: .norecurse
$(wildcard libass
/*.
[ch
])
402 .PHONY
: all install* uninstall strip doxygen doxygen_clean