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 \
37 SRCS_COMMON-
$(UNRAR_EXEC
) += unrar_exec.c
39 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
) -O
-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 TAGS
tags
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
318 ( find
-name
'*.[chS]' -print ) | xargs etags
-a
322 ( find
-name
'*.[chS]' -print ) | xargs ctags
-a
;
324 # ./configure must be rerun if it changed
325 config.mak
: configure
326 @echo
"############################################################"
327 @echo
"####### Please run ./configure again - it's changed! #######"
328 @echo
"############################################################"
330 # rebuild at every config.h/config.mak/Makefile change:
331 version.h
: config.h config.mak Makefile
332 .
/version.sh
`$(CC) -dumpversion`
335 doxygen DOCS
/tech
/Doxyfile
338 -rm -rf DOCS
/tech
/doxygen
340 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
341 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
342 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
344 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
346 iconv
-f UTF-8
-t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
349 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
350 @echo
"Adding untranslated messages to help_mp.h"
351 @echo
'// untranslated messages from the English master file:' >> help_mp.h
352 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
355 # explicit dependencies to force version.h to be built even if .depend is missing
356 mplayer.o mencoder.o vobsub.o
: version.h
358 # temporary measure to make sure help_mp.h is built. we desperately need correct deps!
359 $(MPLAYER_DEPS
) $(MENCODER_DEPS
): help_mp.h
362 # the following lines provide _partial_ dependency information
363 # for the 'library' directories under main dir, in order to cause
364 # the build process to recursively descend into them if something
365 # has changed. ideally this will be replaced with a single
366 # nonrecursive makefile for the whole project.
368 # Now all directories are recursed by default because these rules do not
369 # consider dependencies on files in other directories, while the recursively
370 # invoked Makefiles do. Conditional recursion only to the directories with
371 # changed files can be enabled by creating a file named ".norecurse" and
372 # optionally giving it a timestamp in the past. Directories whose .a files
373 # are newer than the timestamp and newer than other files in the directory
374 # will not be recursed.
377 libvo
/libvo.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
378 libvo
/libosd.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
379 libao2
/libao2.a
: .norecurse
$(wildcard libao2
/*.
[ch
])
380 osdep
/libosdep.a
: .norecurse
$(wildcard osdep
/*.
[ch
])
381 input
/libinput.a
: .norecurse
$(wildcard input
/*.
[ch
])
383 libmenu
/libmenu.a
: .norecurse
$(wildcard libmenu
/*.
[ch
])
384 libaf
/libaf.a
: .norecurse
$(wildcard libaf
/*.
[ch
])
385 dvdread
/libdvdread.a
: .norecurse
$(wildcard dvdread
/*.
[ch
])
386 libdvdcss
/libdvdcss.a
: .norecurse
$(wildcard libdvdcss
/*.
[ch
])
388 libmpdemux
/libmpdemux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
389 libmpdemux
/libmpmux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
390 stream
/stream.a
: .norecurse
$(wildcard stream
/*.
[ch
] stream
/*/*.
[ch
])
391 libmpcodecs
/libmpcodecs.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
]) $(wildcard libmpcodecs
/native
/*.
[ch
])
392 libmpcodecs
/libmpencoders.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
])
394 libavutil
/libavutil.a
: .norecurse
$(wildcard libavutil
/*.
[ch
])
395 libavcodec
/libavcodec.a
: .norecurse
$(wildcard libavcodec
/*.
[ch
] libavcodec
/*/*.
[chS
])
396 libavformat
/libavformat.a
: .norecurse
$(wildcard libavformat
/*.
[ch
])
397 libswscale
/libswscale.a
: .norecurse
$(wildcard libswscale
/*.
[ch
])
399 libmpeg2
/libmpeg2.a
: .norecurse
$(wildcard libmpeg2
/*.
[ch
])
400 liba52
/liba52.a
: .norecurse
$(wildcard liba52
/*.
[ch
])
401 mp3lib
/libmp3.a
: .norecurse
$(wildcard mp3lib
/*.
[ch
])
402 libfaad2
/libfaad2.a
: .norecurse
$(wildcard libfaad2
/*.
[ch
] libfaad2
/*/*.
[ch
])
404 loader
/libloader.a
: .norecurse
$(wildcard loader
/*.
[chSs
])
405 vidix
/libvidix.a
: .norecurse
$(wildcard vidix
/*.
[ch
])
406 gui
/libgui.a
: .norecurse
$(wildcard gui
/*.
[ch
] gui
/*/*.
[ch
] gui
/*/*/*.
[ch
])
408 libass
/libass.a
: .norecurse
$(wildcard libass
/*.
[ch
])
410 .PHONY
: all install* uninstall strip doxygen doxygen_clean TAGS
tags