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 SRCS_COMMON
= asxparser.c \
34 SRCS_COMMON-
$(UNRARLIB
) += unrarlib.c
36 SRCS_MPLAYER
= mplayer.c \
45 SRCS_MENCODER
= mencoder.c \
51 COMMON_LIBS
= libmpcodecs
/libmpcodecs.a \
53 libmpdemux
/libmpdemux.a \
55 libswscale
/libswscale.a \
58 LIBS_MPLAYER
= libvo
/libvo.a \
62 LIBS_MENCODER
= libmpcodecs
/libmpencoders.a \
63 libmpdemux
/libmpmux.a \
65 OBJS_MPLAYER
= $(SRCS_MPLAYER
:.c
=.o
)
66 OBJS_MENCODER
= $(SRCS_MENCODER
:.c
=.o
)
68 # Having this in libosdep.a is not enough.
69 OBJS_MPLAYER-
$(TARGET_WIN32
) += osdep
/mplayer-rc.o
71 MPLAYER_DEPS
= $(OBJS_MPLAYER
) $(LIBS_MPLAYER
) $(COMMON_LIBS
)
72 MENCODER_DEPS
= $(OBJS_MENCODER
) $(LIBS_MENCODER
) $(COMMON_LIBS
)
88 COMMON_LIBS-
$(CONFIG_LIBAVFORMAT
) += libavformat
/libavformat.a
89 PARTS-
$(CONFIG_LIBAVFORMAT
) += libavformat
90 COMMON_LIBS-
$(CONFIG_LIBAVCODEC
) += libavcodec
/libavcodec.a
91 PARTS-
$(CONFIG_LIBAVCODEC
) += libavcodec
92 COMMON_LIBS-
$(CONFIG_LIBAVUTIL
) += libavutil
/libavutil.a
93 PARTS-
$(CONFIG_LIBAVUTIL
) += libavutil
94 COMMON_LIBS-
$(CONFIG_LIBPOSTPROC
) += libpostproc
/libpostproc.a
95 PARTS-
$(CONFIG_LIBPOSTPROC
) += libpostproc
96 COMMON_LIBS-
$(WIN32DLL
) += loader
/libloader.a
97 PARTS-
$(WIN32DLL
) += loader
98 COMMON_LIBS-
$(MP3LIB
) += mp3lib
/libMP3.a
99 PARTS-
$(MP3LIB
) += mp3lib
100 COMMON_LIBS-
$(LIBA52
) += liba52
/liba52.a
101 PARTS-
$(LIBA52
) += liba52
102 COMMON_LIBS-
$(LIBMPEG2
) += libmpeg2
/libmpeg2.a
103 PARTS-
$(LIBMPEG2
) += libmpeg2
104 COMMON_LIBS-
$(FAAD_INTERNAL
) += libfaad2
/libfaad2.a
105 PARTS-
$(FAAD_INTERNAL
) += libfaad2
106 COMMON_LIBS-
$(TREMOR_INTERNAL
) += tremor
/libvorbisidec.a
107 PARTS-
$(TREMOR_INTERNAL
) += tremor
108 LIBS_MPLAYER-
$(VIDIX
) += vidix
/libvidix.a
109 PARTS-
$(VIDIX
) += libdha vidix
110 COMMON_LIBS-
$(DVDREAD_INTERNAL
) += dvdread
/libdvdread.a
111 PARTS-
$(DVDREAD_INTERNAL
) += dvdread
112 COMMON_LIBS-
$(DVDCSS_INTERNAL
) += libdvdcss
/libdvdcss.a
113 PARTS-
$(DVDCSS_INTERNAL
) += libdvdcss
114 COMMON_LIBS-
$(CONFIG_ASS
) += libass
/libass.a
115 PARTS-
$(CONFIG_ASS
) += libass
116 LIBS_MPLAYER-
$(GUI
) += Gui
/libgui.a
118 LIBS_MPLAYER-
$(LIBMENU
) += libmenu
/libmenu.a
119 PARTS-
$(LIBMENU
) += libmenu
121 COMMON_LDFLAGS
+= $(EXTRA_LIB
)\
124 LDFLAGS_MPLAYER
= $(EXTRALIBS_MPLAYER
) \
127 LDFLAGS_MENCODER
= $(EXTRALIBS_MENCODER
) \
130 ALL_PRG-
$(MPLAYER
) += mplayer
$(EXESUF
)
131 ALL_PRG-
$(MENCODER
) += mencoder
$(EXESUF
)
133 SRCS_COMMON
+= $(SRCS_COMMON-yes
)
134 COMMON_LIBS
+= $(COMMON_LIBS-yes
)
135 LIBS_MPLAYER
+= $(LIBS_MPLAYER-yes
)
136 OBJS_MPLAYER
+= $(OBJS_MPLAYER-yes
)
137 PARTS
+= $(PARTS-yes
)
138 ALL_PRG
+= $(ALL_PRG-yes
)
140 COMMON_LIBS
+= osdep
/libosdep.a
148 dvdread
/libdvdread.a
:
151 libdvdcss
/libdvdcss.a
:
160 libmpdemux
/libmpdemux.a
:
161 $(MAKE
) -C libmpdemux libmpdemux.a
163 libmpdemux
/libmpmux.a
:
164 $(MAKE
) -C libmpdemux libmpmux.a
169 libmpcodecs
/libmpcodecs.a
:
170 $(MAKE
) -C libmpcodecs
172 libavutil
/libavutil.a
:
173 $(MAKE
) -C libavutil LIBPREF
=lib LIBSUF
=.a
175 libavcodec
/libavcodec.a
:
176 $(MAKE
) -C libavcodec LIBPREF
=lib LIBSUF
=.a
178 libpostproc
/libpostproc.a
:
179 $(MAKE
) -C libpostproc LIBPREF
=lib LIBSUF
=.a
181 libavformat
/libavformat.a
:
182 $(MAKE
) -C libavformat LIBPREF
=lib LIBSUF
=.a
184 libswscale
/libswscale.a
:
185 $(MAKE
) -C libswscale LIBPREF
=lib LIBSUF
=.a
191 $(MAKE
) -C libvo libvo.a
194 $(MAKE
) -C libvo libosd.a
208 tremor
/libvorbisidec.a
:
214 vidix
/libvidix.a
: libdha
/libdha.so
224 $(MAKE
) -C osdep mplayer-rc.o
232 mplayer
$(EXESUF
): $(MPLAYER_DEPS
)
233 $(CC
) -o
$@
$^
$(LDFLAGS_MPLAYER
)
235 mencoder
$(EXESUF
): $(MENCODER_DEPS
)
236 $(CC
) -o
$@
$^
$(LDFLAGS_MENCODER
)
238 codec-cfg
$(EXESUF
): codec-cfg.c codec-cfg.h help_mp.h
239 $(HOST_CC
) -I.
-DCODECS2HTML
$< -o
$@
241 codecs.conf.h
: codec-cfg
$(EXESUF
) etc
/codecs.conf
242 .
/codec-cfg
$(EXESUF
) .
/etc
/codecs.conf
> $@
244 codec-cfg.o
: codecs.conf.h
246 codecs2html
$(EXESUF
): mp_msg.o
247 $(CC
) -DCODECS2HTML codec-cfg.c
$^
-o
$@
249 INSTALL_TARGETS-
$(MPLAYER
) += install-mplayer install-mplayer-man
250 INSTALL_TARGETS-
$(MENCODER
) += install-mencoder install-mplayer-man
251 INSTALL_TARGETS-
$(GUI
) += install-gui
252 INSTALL_TARGETS-
$(VIDIX
) += install-vidix
253 INSTALL_TARGETS
+= $(INSTALL_TARGETS-yes
)
255 install: install-dirs
$(INSTALL_TARGETS
)
258 $(INSTALL
) -d
$(BINDIR
)
259 $(INSTALL
) -d
$(DATADIR
)
260 $(INSTALL
) -d
$(MANDIR
)/man1
261 $(INSTALL
) -d
$(CONFDIR
)
262 if
test -f
$(CONFDIR
)/codecs.conf
; then mv
-f
$(CONFDIR
)/codecs.conf
$(CONFDIR
)/codecs.conf.old
; fi
264 install-mplayer
: mplayer
$(EXESUF
)
265 $(INSTALL
) -m
755 $(INSTALLSTRIP
) mplayer
$(EXESUF
) $(BINDIR
)
268 for i in
$(MAN_LANG
); do \
269 if
test "$$i" = en
; then \
270 $(INSTALL
) -c
-m
644 DOCS
/man
/en
/mplayer
.1 $(MANDIR
)/man1
/ ; \
272 $(INSTALL
) -d
$(MANDIR
)/$$i/man1
; \
273 $(INSTALL
) -c
-m
644 DOCS
/man
/$$i/mplayer
.1 $(MANDIR
)/$$i/man1
/ ; \
277 install-mencoder
: mencoder
$(EXESUF
)
278 $(INSTALL
) -m
755 $(INSTALLSTRIP
) mencoder
$(EXESUF
) $(BINDIR
)
279 for i in
$(MAN_LANG
); do \
280 if
test "$$i" = en
; then \
281 cd
$(MANDIR
)/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
283 cd
$(MANDIR
)/$$i/man1
&& ln
-sf mplayer
.1 mencoder
.1 ; \
288 -ln
-sf mplayer
$(EXESUF
) $(BINDIR
)/gmplayer
$(EXESUF
)
289 $(INSTALL
) -d
$(DATADIR
)/skins
290 @echo
"*** Download skin(s) at http://www.mplayerhq.hu/design7/dload.html"
291 @echo
"*** for GUI, and extract to $(DATADIR)/skins/"
292 $(INSTALL
) -d
$(prefix)/share
/pixmaps
293 $(INSTALL
) -m
644 etc
/mplayer.xpm
$(prefix)/share
/pixmaps
/
294 $(INSTALL
) -d
$(prefix)/share
/applications
295 $(INSTALL
) -m
644 etc
/mplayer.desktop
$(prefix)/share
/applications
/
298 $(MAKE
) -C libdha
install
299 mkdir
-p
$(LIBDIR
)/mplayer
/vidix
300 $(INSTALL
) -m
755 $(INSTALLSTRIP
) -p vidix
/drivers
/*.so
$(LIBDIR
)/mplayer
/vidix
303 -rm -f
$(BINDIR
)/mplayer
$(EXESUF
) $(BINDIR
)/gmplayer
$(EXESUF
)
304 -rm -f
$(BINDIR
)/mencoder
$(EXESUF
)
305 -rm -f
$(MANDIR
)/man1
/mencoder
.1 $(MANDIR
)/man1
/mplayer
.1
306 -rm -f
$(prefix)/share
/pixmaps
/mplayer.xpm
307 -rm -f
$(prefix)/share
/applications
/mplayer.desktop
308 for l in
$(MAN_LANG
); do \
309 if
test "$$l" != "en"; then \
310 rm -f
$(MANDIR
)/$$l/man1
/mplayer
.1 \
311 $(MANDIR
)/$$l/man1
/mencoder
.1 \
312 $(MANDIR
)/$$l/man1
/gmplayer
.1 ; \
315 $(MAKE
) -C libdha
uninstall
316 rm -f
$(LIBDIR
)/mplayer
/vidix
/*.so
317 -rmdir
-p
$(LIBDIR
)/mplayer
/vidix
323 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a clean; done
325 distclean: dirclean doxygen_clean
326 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a distclean; done
327 -rm -f
*~ mplayer
$(EXESUF
) mencoder
$(EXESUF
) \
328 codec-cfg
$(EXESUF
) codecs2html
$(EXESUF
) codecs.conf.h \
329 .depend configure.log config.mak config.h help_mp.h version.h
334 dep depend
: help_mp.h version.h
335 $(CC
) -MM
$(CFLAGS
) -DCODECS2HTML mplayer.c mencoder.c
$(SRCS_MPLAYER
) $(SRCS_MENCODER
) 1>.depend
336 @for a in
$(PARTS
); do
$(MAKE
) -C
$$a dep
; done
338 # ./configure must be rerun if it changed
340 @echo
"############################################################"
341 @echo
"####### Please run ./configure again - it's changed! #######"
342 @echo
"############################################################"
344 # rebuild at every config.h/config.mak/Makefile change:
345 version.h
: config.h config.mak Makefile
346 .
/version.sh
`$(CC) -dumpversion`
349 doxygen DOCS
/tech
/Doxyfile
352 -rm -rf DOCS
/tech
/doxygen
354 help_mp.h
: help
/help_mp-en.h
$(HELP_FILE
)
355 @echo
'// WARNING! This is a generated file. Do NOT edit.' > help_mp.h
356 @echo
'// See the help/ subdir for the editable files.' >> help_mp.h
358 @echo
'#include "$(HELP_FILE)"' >> help_mp.h
360 iconv
-f UTF-8
-t
$(CHARSET
) "$(HELP_FILE)" >> help_mp.h
363 ifneq ($(HELP_FILE
),help
/help_mp-en.h
)
364 @echo
"Adding untranslated messages to help_mp.h"
365 @echo
'// untranslated messages from the English master file:' >> help_mp.h
366 @help
/help_diff.sh
$(HELP_FILE
) < help
/help_mp-en.h
>> help_mp.h
369 # explicit dependencies to force version.h to be built even if .depend is missing
370 mplayer.o mencoder.o vobsub.o
: version.h
372 # temporary measure to make sure help_mp.h is built. we desperately need correct deps!
373 $(MPLAYER_DEPS
) $(MENCODER_DEPS
): help_mp.h
376 # the following lines provide _partial_ dependency information
377 # for the 'library' directories under main dir, in order to cause
378 # the build process to recursively descend into them if something
379 # has changed. ideally this will be replaced with a single
380 # nonrecursive makefile for the whole project.
382 # Now all directories are recursed by default because these rules do not
383 # consider dependencies on files in other directories, while the recursively
384 # invoked Makefiles do. Conditional recursion only to the directories with
385 # changed files can be enabled by creating a file named ".norecurse" and
386 # optionally giving it a timestamp in the past. Directories whose .a files
387 # are newer than the timestamp and newer than other files in the directory
388 # will not be recursed.
391 libvo
/libvo.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
392 libvo
/libosd.a
: .norecurse
$(wildcard libvo
/*.
[ch
])
393 libao2
/libao2.a
: .norecurse
$(wildcard libao2
/*.
[ch
])
394 osdep
/libosdep.a
: .norecurse
$(wildcard osdep
/*.
[ch
])
395 input
/libinput.a
: .norecurse
$(wildcard input
/*.
[ch
])
397 libmenu
/libmenu.a
: .norecurse
$(wildcard libmenu
/*.
[ch
])
398 libaf
/libaf.a
: .norecurse
$(wildcard libaf
/*.
[ch
])
399 dvdread
/libdvdread.a
: .norecurse
$(wildcard dvdread
/*.
[ch
])
400 libdvdcss
/libdvdcss.a
: .norecurse
$(wildcard libdvdcss
/*.
[ch
])
402 libmpdemux
/libmpdemux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
403 libmpdemux
/libmpmux.a
: .norecurse
$(wildcard libmpdemux
/*.
[ch
])
404 stream
/stream.a
: .norecurse
$(wildcard stream
/*.
[ch
] stream
/*/*.
[ch
])
405 libmpcodecs
/libmpcodecs.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
]) $(wildcard libmpcodecs
/native
/*.
[ch
])
406 libmpcodecs
/libmpencoders.a
: .norecurse
$(wildcard libmpcodecs
/*.
[ch
])
408 libavutil
/libavutil.a
: .norecurse
$(wildcard libavutil
/*.
[ch
])
409 libavcodec
/libavcodec.a
: .norecurse
$(wildcard libavcodec
/*.
[ch
] libavcodec
/*/*.
[chS
])
410 libavformat
/libavformat.a
: .norecurse
$(wildcard libavformat
/*.
[ch
])
411 libswscale
/libswscale.a
: .norecurse
$(wildcard libswscale
/*.
[ch
])
413 libmpeg2
/libmpeg2.a
: .norecurse
$(wildcard libmpeg2
/*.
[ch
])
414 liba52
/liba52.a
: .norecurse
$(wildcard liba52
/*.
[ch
])
415 mp3lib
/libMP3.a
: .norecurse
$(wildcard mp3lib
/*.
[ch
])
416 libfaad2
/libfaad2.a
: .norecurse
$(wildcard libfaad2
/*.
[ch
] libfaad2
/*/*.
[ch
])
418 loader
/libloader.a
: .norecurse
$(wildcard loader
/*.
[chSs
])
419 libdha
/libdha.so
: .norecurse
$(wildcard libdha
/*.
[ch
])
420 vidix
/libvidix.a
: .norecurse
$(wildcard vidix
/*.
[ch
])
421 Gui
/libgui.a
: .norecurse
$(wildcard Gui
/*.
[ch
] Gui
/*/*.
[ch
] Gui
/*/*/*.
[ch
])
423 libass
/libass.a
: .norecurse
$(wildcard libass
/*.
[ch
])
427 .PHONY
: all install* uninstall dirclean
clean distclean strip dep depend
428 .PHONY
: doxygen doxygen_clean