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-
$(UNRARLIB
) += unrarlib.c
38 SRCS_COMMON-
$(UNRAR_EXEC
) += unrar_exec.c
40 SRCS_MPLAYER
= mplayer.c \
48 SRCS_MENCODER
= mencoder.c \
53 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a \
55 libmpdemux
/libmpdemux.a \
57 libswscale
/libswscale.a \
60 COMMON_LIBS-
$(LIBAVFORMAT_A
) += libavformat
/libavformat.a
61 COMMON_LIBS-
$(LIBAVCODEC_A
) += libavcodec
/libavcodec.a
62 COMMON_LIBS-
$(LIBAVUTIL_A
) += libavutil
/libavutil.a
63 COMMON_LIBS-
$(LIBPOSTPROC_A
) += libpostproc
/libpostproc.a
64 COMMON_LIBS-
$(WIN32DLL
) += loader
/libloader.a
65 COMMON_LIBS-
$(MP3LIB
) += mp3lib
/libmp3.a
66 COMMON_LIBS-
$(LIBA52
) += liba52
/liba52.a
67 COMMON_LIBS-
$(LIBMPEG2
) += libmpeg2
/libmpeg2.a
68 COMMON_LIBS-
$(FAAD_INTERNAL
) += libfaad2
/libfaad2.a
69 COMMON_LIBS-
$(TREMOR_INTERNAL
) += tremor
/libvorbisidec.a
70 COMMON_LIBS-
$(DVDREAD_INTERNAL
) += dvdread
/libdvdread.a
71 COMMON_LIBS-
$(DVDCSS_INTERNAL
) += libdvdcss
/libdvdcss.a
72 COMMON_LIBS-
$(ASS
) += libass
/libass.a
74 LIBS_MPLAYER
= libvo
/libvo.a \
78 LIBS_MPLAYER-
$(VIDIX
) += vidix
/libvidix.a
79 LIBS_MPLAYER-
$(GUI
) += gui
/libgui.a
80 LIBS_MPLAYER-
$(LIBMENU
) += libmenu
/libmenu.a
82 LIBS_MENCODER
= libmpcodecs
/libmpencoders.a \
83 libmpdemux
/libmpmux.a \
85 # Having this in libosdep.a is not enough.
86 OBJS_MPLAYER-
$(TARGET_WIN32
) += osdep
/mplayer-rc.o
88 ALL_PRG-
$(MPLAYER
) += mplayer
$(EXESUF
)
89 ALL_PRG-
$(MENCODER
) += mencoder
$(EXESUF
)
91 COMMON_LIBS
+= $(COMMON_LIBS-yes
)
92 LIBS_MPLAYER
+= $(LIBS_MPLAYER-yes
)
93 OBJS_MPLAYER
+= $(OBJS_MPLAYER-yes
)
95 ALL_PRG
+= $(ALL_PRG-yes
)
97 COMMON_LIBS
+= osdep
/libosdep.a
99 MPLAYER_DEPS
= $(OBJS_MPLAYER
) $(OBJS_COMMON
) $(LIBS_MPLAYER
) $(COMMON_LIBS
)
100 MENCODER_DEPS
= $(OBJS_MENCODER
) $(OBJS_COMMON
) $(LIBS_MENCODER
) $(COMMON_LIBS
)
102 INSTALL_TARGETS-
$(MPLAYER
) += install-mplayer install-mplayer-man
103 INSTALL_TARGETS-
$(MENCODER
) += install-mencoder install-mplayer-man
104 INSTALL_TARGETS-
$(GUI
) += install-gui
105 INSTALL_TARGETS
+= $(INSTALL_TARGETS-yes
)
136 dep depend
:: help_mp.h version.h codecs.conf.h
137 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
141 CFLAGS
:= $(subst -I..
,-I.
,$(CFLAGS
))
146 dvdread
/libdvdread.a
:
149 libdvdcss
/libdvdcss.a
:
158 libmpdemux
/libmpdemux.a
:
159 $(MAKE
) -C libmpdemux libmpdemux.a
161 libmpdemux
/libmpmux.a
:
162 $(MAKE
) -C libmpdemux libmpmux.a
167 libmpcodecs
/libmpcodecs.a
:
168 $(MAKE
) -C libmpcodecs
170 libavutil
/libavutil.a
:
173 libavcodec
/libavcodec.a
:
174 $(MAKE
) -C libavcodec
176 libpostproc
/libpostproc.a
:
177 $(MAKE
) -C libpostproc
179 libavformat
/libavformat.a
:
180 $(MAKE
) -C libavformat
182 libswscale
/libswscale.a
:
183 $(MAKE
) -C libswscale
189 $(MAKE
) -C libvo libvo.a
192 $(MAKE
) -C libvo libosd.a
206 tremor
/libvorbisidec.a
:
218 osdep
/mplayer-rc.o
: version.h
219 $(MAKE
) -C osdep mplayer-rc.o
227 mplayer
$(EXESUF
): $(MPLAYER_DEPS
)
228 $(CC
) -o
$@
$^
$(LDFLAGS_MPLAYER
)
230 mencoder
$(EXESUF
): $(MENCODER_DEPS
)
231 $(CC
) -o
$@
$^
$(LDFLAGS_MENCODER
)
233 codec-cfg
$(EXESUF
): codec-cfg.c codec-cfg.h help_mp.h
234 $(HOST_CC
) -I.
-DCODECS2HTML
$< -o
$@
236 codecs.conf.h
: codec-cfg
$(EXESUF
) etc
/codecs.conf
237 .
/codec-cfg
$(EXESUF
) .
/etc
/codecs.conf
> $@
239 codec-cfg.o
: codecs.conf.h
241 codecs2html
$(EXESUF
): mp_msg.o
242 $(CC
) -DCODECS2HTML codec-cfg.c
$^
-o
$@
244 codec-cfg-test
$(EXESUF
): codecs.conf.h codec-cfg.h mp_msg.o osdep
/getch2.o
245 $(CC
) -I.
-DTESTING codec-cfg.c mp_msg.o osdep
/getch2.o
-ltermcap
-o
$@
247 install: install-dirs
$(INSTALL_TARGETS
)
250 $(INSTALL
) -d
$(BINDIR
)
251 $(INSTALL
) -d
$(DATADIR
)
252 $(INSTALL
) -d
$(MANDIR
)/man1
253 $(INSTALL
) -d
$(CONFDIR
)
254 if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
256 install-mplayer
: mplayer
$(EXESUF
)
257 $(INSTALL
) -m
755 $(INSTALLSTRIP
) mplayer
$(EXESUF
) $(BINDIR
)
260 for i in
$(MAN_LANG
); do \
261 if
test "$$i" = en
; then \
262 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/ ; \
264 $(INSTALL
) -d
$(MANDIR
)/$$i/man1
; \
265 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/ ; \
269 install-mencoder
: mencoder
$(EXESUF
)
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 ; \
280 -ln
-sf mplayer
$(EXESUF
) $(BINDIR
)/gmplayer
$(EXESUF
)
281 $(INSTALL
) -d
$(DATADIR
)/skins
282 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/design7/dload.html"
283 @echo
"*** for GUI, and extract to $(DATADIR)/skins/"
284 $(INSTALL
) -d
$(prefix)/share
/pixmaps
285 $(INSTALL
) -m
644 etc
/mplayer.xpm
$(prefix)/share
/pixmaps
/
286 $(INSTALL
) -d
$(prefix)/share
/applications
287 $(INSTALL
) -m
644 etc
/mplayer.desktop
$(prefix)/share
/applications
/
290 -rm -f
$(BINDIR
)/mplayer
$(EXESUF
) $(BINDIR
)/gmplayer
$(EXESUF
)
291 -rm -f
$(BINDIR
)/mencoder
$(EXESUF
)
292 -rm -f
$(MANDIR
)/man1
/mencoder
.1 $(MANDIR
)/man1
/mplayer
.1
293 -rm -f
$(prefix)/share
/pixmaps
/mplayer.xpm
294 -rm -f
$(prefix)/share
/applications
/mplayer.desktop
295 for l in
$(MAN_LANG
); do \
296 if
test "$$l" != "en"; then \
297 rm -f
$(MANDIR
)/$$l/man1
/mplayer
.1 \
298 $(MANDIR
)/$$l/man1
/mencoder
.1 \
299 $(MANDIR
)/$$l/man1
/gmplayer
.1 ; \
304 -rm -f mplayer
$(EXESUF
) mencoder
$(EXESUF
) codec-cfg
$(EXESUF
) \
305 codecs2html
$(EXESUF
) codec-cfg-test
$(EXESUF
) cpuinfo
$(EXESUF
) \
306 codecs.conf.h help_mp.h version.h
307 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a clean; done
309 distclean:: doxygen_clean
310 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
311 $(MAKE
) -C TOOLS
distclean
312 -rm -f configure.log config.mak config.h
317 # ./configure must be rerun if it changed
318 config.mak
: configure
319 @echo
"############################################################"
320 @echo
"####### Please run ./configure again - it's changed! #######"
321 @echo
"############################################################"
323 # rebuild at every config.h/config.mak/Makefile change:
324 version.h
: config.h config.mak Makefile
325 .
/version.sh
`$(CC) -dumpversion`
328 doxygen DOCS
/tech
/Doxyfile
331 -rm -rf DOCS
/tech
/doxygen
333 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
334 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
335 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
337 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
339 iconv
-f UTF-8
-t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
342 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
343 @echo
"Adding untranslated messages to help_mp.h"
344 @echo
'// untranslated messages from the English master file:' >> help_mp.h
345 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
348 # explicit dependencies to force version.h to be built even if .depend is missing
349 mplayer.o mencoder.o vobsub.o
: version.h
351 # temporary measure to make sure help_mp.h is built. we desperately need correct deps!
352 $(MPLAYER_DEPS
) $(MENCODER_DEPS
): help_mp.h
355 # the following lines provide _partial_ dependency information
356 # for the 'library' directories under main dir, in order to cause
357 # the build process to recursively descend into them if something
358 # has changed. ideally this will be replaced with a single
359 # nonrecursive makefile for the whole project.
361 # Now all directories are recursed by default because these rules do not
362 # consider dependencies on files in other directories, while the recursively
363 # invoked Makefiles do. Conditional recursion only to the directories with
364 # changed files can be enabled by creating a file named ".norecurse" and
365 # optionally giving it a timestamp in the past. Directories whose .a files
366 # are newer than the timestamp and newer than other files in the directory
367 # will not be recursed.
370 libvo
/libvo.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
371 libvo
/libosd.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
372 libao2
/libao2.a
: .norecurse
$(wildcard libao2
/*.
[ch
])
373 osdep
/libosdep.a
: .norecurse
$(wildcard osdep
/*.
[ch
])
374 input
/libinput.a
: .norecurse
$(wildcard input
/*.
[ch
])
376 libmenu
/libmenu.a
: .norecurse
$(wildcard libmenu
/*.
[ch
])
377 libaf
/libaf.a
: .norecurse
$(wildcard libaf
/*.
[ch
])
378 dvdread
/libdvdread.a
: .norecurse
$(wildcard dvdread
/*.
[ch
])
379 libdvdcss
/libdvdcss.a
: .norecurse
$(wildcard libdvdcss
/*.
[ch
])
381 libmpdemux
/libmpdemux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
382 libmpdemux
/libmpmux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
383 stream
/stream.a
: .norecurse
$(wildcard stream
/*.
[ch
] stream
/*/*.
[ch
])
384 libmpcodecs
/libmpcodecs.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
]) $(wildcard libmpcodecs
/native
/*.
[ch
])
385 libmpcodecs
/libmpencoders.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
])
387 libavutil
/libavutil.a
: .norecurse
$(wildcard libavutil
/*.
[ch
])
388 libavcodec
/libavcodec.a
: .norecurse
$(wildcard libavcodec
/*.
[ch
] libavcodec
/*/*.
[chS
])
389 libavformat
/libavformat.a
: .norecurse
$(wildcard libavformat
/*.
[ch
])
390 libswscale
/libswscale.a
: .norecurse
$(wildcard libswscale
/*.
[ch
])
392 libmpeg2
/libmpeg2.a
: .norecurse
$(wildcard libmpeg2
/*.
[ch
])
393 liba52
/liba52.a
: .norecurse
$(wildcard liba52
/*.
[ch
])
394 mp3lib
/libmp3.a
: .norecurse
$(wildcard mp3lib
/*.
[ch
])
395 libfaad2
/libfaad2.a
: .norecurse
$(wildcard libfaad2
/*.
[ch
] libfaad2
/*/*.
[ch
])
397 loader
/libloader.a
: .norecurse
$(wildcard loader
/*.
[chSs
])
398 vidix
/libvidix.a
: .norecurse
$(wildcard vidix
/*.
[ch
])
399 gui
/libgui.a
: .norecurse
$(wildcard gui
/*.
[ch
] gui
/*/*.
[ch
] gui
/*/*/*.
[ch
])
401 libass
/libass.a
: .norecurse
$(wildcard libass
/*.
[ch
])
403 .PHONY
: all install* uninstall strip doxygen doxygen_clean