fix typo
[mplayer/glamo.git] / Makefile
blobc628cd0f20a526fdc0a987c2dc0f38d0c0cdc706
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
5 # * DVD support
7 include config.mak
9 CFLAGS = $(OPTFLAGS) -I.
11 CFLAGS-$(CONFIG_LIBAVUTIL) += -I./libavutil
12 CFLAGS-$(CONFIG_LIBAVCODEC) += -I./libavcodec
13 CFLAGS += $(CFLAGS-yes)
15 #CFLAGS += -Wall
17 # Do not strip the binaries at installation
18 ifeq ($(STRIPBINARIES),yes)
19 INSTALLSTRIP = -s
20 endif
22 SRCS_COMMON = asxparser.c \
23 codec-cfg.c \
24 cpudetect.c \
25 edl.c \
26 find_sub.c \
27 m_config.c \
28 m_option.c \
29 m_struct.c \
30 parser-cfg.c \
31 playtree.c \
32 playtreeparser.c \
33 spudec.c \
34 sub_cc.c \
35 subreader.c \
36 vobsub.c \
38 SRCS_COMMON-$(UNRARLIB) += unrarlib.c
40 SRCS_MPLAYER = mplayer.c \
41 m_property.c \
42 mp_msg.c \
43 $(SRCS_COMMON) \
44 mixer.c \
45 parser-mpcmd.c \
46 subopt-helper.c \
48 SRCS_MENCODER = mencoder.c \
49 mp_msg-mencoder.c \
50 $(SRCS_COMMON) \
51 parser-mecmd.c \
52 xvid_vbr.c \
54 COMMON_LIBS = libmpcodecs/libmpcodecs.a \
55 libaf/libaf.a \
56 libmpdemux/libmpdemux.a \
57 stream/stream.a \
58 libswscale/libswscale.a \
59 libvo/libosd.a \
61 LIBS_MPLAYER = libvo/libvo.a \
62 libao2/libao2.a \
63 input/libinput.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)
77 PARTS = libmpdemux \
78 stream \
79 libmpcodecs \
80 libavutil \
81 libavcodec \
82 libpostproc \
83 libavformat \
84 libswscale \
85 libao2 \
86 osdep \
87 input \
88 libvo \
89 libaf \
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
120 PARTS-$(GUI) += Gui
121 LIBS_MPLAYER-$(LIBMENU) += libmenu/libmenu.a
122 PARTS-$(LIBMENU) += libmenu
124 COMMON_LDFLAGS += $(EXTRA_LIB)\
125 $(EXTRALIBS) \
127 LDFLAGS_MPLAYER = $(EXTRALIBS_MPLAYER) \
128 $(COMMON_LDFLAGS) \
130 LDFLAGS_MENCODER = $(EXTRALIBS_MENCODER) \
131 $(COMMON_LDFLAGS) \
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
146 all: $(ALL_PRG)
148 libaf/libaf.a:
149 $(MAKE) -C libaf
151 dvdread/libdvdread.a:
152 $(MAKE) -C dvdread
154 libdvdcss/libdvdcss.a:
155 $(MAKE) -C libdvdcss
157 loader/libloader.a:
158 $(MAKE) -C loader
160 libass/libass.a:
161 $(MAKE) -C libass
163 libmpdemux/libmpdemux.a:
164 $(MAKE) -C libmpdemux libmpdemux.a
166 libmpdemux/libmpmux.a:
167 $(MAKE) -C libmpdemux libmpmux.a
169 stream/stream.a:
170 $(MAKE) -C stream
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
190 libmpeg2/libmpeg2.a:
191 $(MAKE) -C libmpeg2
193 libvo/libvo.a:
194 $(MAKE) -C libvo libvo.a
196 libvo/libosd.a:
197 $(MAKE) -C libvo libosd.a
199 libao2/libao2.a:
200 $(MAKE) -C libao2
202 liba52/liba52.a:
203 $(MAKE) -C liba52
205 libfaad2/libfaad2.a:
206 $(MAKE) -C libfaad2
208 mp3lib/libMP3.a:
209 $(MAKE) -C mp3lib
211 tremor/libvorbisidec.a:
212 $(MAKE) -C tremor
214 libdha/libdha.so:
215 $(MAKE) -C libdha
217 vidix/libvidix.a: libdha/libdha.so
218 $(MAKE) -C vidix
220 Gui/libgui.a:
221 $(MAKE) -C Gui
223 osdep/libosdep.a:
224 $(MAKE) -C osdep
226 osdep/mplayer-rc.o:
227 $(MAKE) -C osdep mplayer-rc.o
229 input/libinput.a:
230 $(MAKE) -C input
232 libmenu/libmenu.a:
233 $(MAKE) -C libmenu
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 $@
252 install: $(ALL_PRG)
253 ifeq ($(VIDIX),yes)
254 $(MAKE) -C libdha install
255 mkdir -p $(LIBDIR)/mplayer/vidix
256 -install -m 755 $(INSTALLSTRIP) -p vidix/drivers/*.so $(LIBDIR)/mplayer/vidix
257 endif
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/ ; \
264 else \
265 $(INSTALL) -d $(MANDIR)/$$i/man1 ; \
266 $(INSTALL) -c -m 644 DOCS/man/$$i/mplayer.1 $(MANDIR)/$$i/man1/ ; \
267 fi ; \
268 done
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 ; \
274 else \
275 cd $(MANDIR)/$$i/man1 && ln -sf mplayer.1 mencoder.1 ; \
276 fi ; \
277 done
278 endif
279 $(INSTALL) -d $(DATADIR)
280 $(INSTALL) -d $(DATADIR)/font
281 ifeq ($(GUI),yes)
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/
290 endif
291 $(INSTALL) -d $(CONFDIR)
292 if test -f $(CONFDIR)/codecs.conf ; then mv -f $(CONFDIR)/codecs.conf $(CONFDIR)/codecs.conf.old ; fi
294 uninstall:
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 ; \
305 fi ; \
306 done
307 $(MAKE) -C libdha uninstall
308 rm -f $(LIBDIR)/mplayer/vidix/*.so
309 -rmdir -p $(LIBDIR)/mplayer/vidix
311 dirclean:
312 -rm -f *.o *.a *~
314 clean: dirclean
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
323 strip:
324 strip -s $(ALL_PRG)
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
331 config.h: configure
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`
340 doxygen:
341 doxygen DOCS/tech/Doxyfile
343 doxygen_clean:
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
349 ifeq ($(CHARSET),)
350 @echo '#include "$(HELP_FILE)"' >> help_mp.h
351 else
352 iconv -f UTF-8 -t $(CHARSET) "$(HELP_FILE)" >> help_mp.h
353 endif
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
359 endif
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.
381 .norecurse:
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),)
418 include .depend
419 endif