1 ###############################################################################
2 # vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
3 ###############################################################################
7 ###############################################################################
9 ###############################################################################
12 # All possible plugin directories, needed for make clean
14 PLUGINS_DIR := alsa beos darwin dsp dummy \
15 dvd esd fb ggi glide gnome gtk \
23 # All possible plugin objects
25 PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin dsp/dsp dummy/dummy \
26 dvd/dvd esd/esd fb/fb ggi/ggi glide/glide gnome/gnome gtk/gtk \
27 idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext \
28 macosx/macosx mga/mga \
29 motion/motion motion/motionmmx motion/motionmmxext \
30 mpeg/es mpeg/ps mpeg/ts null/null qt/qt sdl/sdl \
31 text/ncurses text/rc x11/x11 x11/xvideo yuv/yuv yuv/yuvmmx
36 INTERFACE = src/interface/main.o \
37 src/interface/interface.o \
38 src/interface/intf_msg.o \
39 src/interface/intf_cmd.o \
40 src/interface/intf_ctrl.o \
41 src/interface/intf_playlist.o \
42 src/interface/intf_channels.o \
43 src/interface/intf_console.o \
44 src/interface/intf_urldecode.o \
46 INPUT = src/input/input_ext-dec.o \
47 src/input/input_ext-intf.o \
48 src/input/input_dec.o \
49 src/input/input_programs.o \
50 src/input/input_netlist.o \
51 src/input/input_clock.o \
53 src/input/mpeg_system.o
55 AUDIO_OUTPUT = src/audio_output/audio_output.o \
56 src/audio_output/aout_fifo.o \
57 src/audio_output/aout_u8.o \
58 src/audio_output/aout_s8.o \
59 src/audio_output/aout_u16.o \
60 src/audio_output/aout_s16.o \
61 src/audio_output/aout_spdif.o
63 VIDEO_OUTPUT = src/video_output/video_output.o \
64 src/video_output/video_text.o \
65 src/video_output/video_spu.o \
66 src/video_output/video_yuv.o
68 AC3_DECODER = src/ac3_decoder/ac3_decoder_thread.o \
69 src/ac3_decoder/ac3_decoder.o \
70 src/ac3_decoder/ac3_parse.o \
71 src/ac3_decoder/ac3_exponent.o \
72 src/ac3_decoder/ac3_bit_allocate.o \
73 src/ac3_decoder/ac3_mantissa.o \
74 src/ac3_decoder/ac3_rematrix.o \
75 src/ac3_decoder/ac3_imdct.o \
76 src/ac3_decoder/ac3_downmix.o \
77 src/ac3_decoder/ac3_downmix_c.o
79 AC3_SPDIF = src/ac3_spdif/ac3_spdif.o \
80 src/ac3_spdif/ac3_iec958.o
82 LPCM_DECODER = src/lpcm_decoder/lpcm_decoder_thread.o \
83 src/lpcm_decoder/lpcm_decoder.o
85 AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
86 src/audio_decoder/adec_generic.o \
87 src/audio_decoder/adec_layer1.o \
88 src/audio_decoder/adec_layer2.o \
89 src/audio_decoder/adec_math.o
91 SPU_DECODER = src/spu_decoder/spu_decoder.o
93 #GEN_DECODER = src/generic_decoder/generic_decoder.o
95 VIDEO_PARSER = src/video_parser/video_parser.o \
96 src/video_parser/vpar_headers.o \
97 src/video_parser/vpar_blocks.o \
98 src/video_parser/vpar_synchro.o \
99 src/video_parser/video_fifo.o
101 VIDEO_DECODER = src/video_decoder/video_decoder.o
103 MISC = src/misc/mtime.o \
105 src/misc/rsc_files.o \
109 C_OBJ = $(INTERFACE) \
127 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
131 CPP_OBJ = src/misc/beos_specific.o
134 ifneq (,$(findstring darwin,$(SYS)))
135 C_OBJ += src/misc/darwin_specific.o
141 H_OBJ = include/modules_builtin.h
144 # Other lists of files
146 C_DEP := $(C_OBJ:%.o=.dep/%.d)
147 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
150 # Translate plugin names
153 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@lib/\1.so@' -e 's@^ .*@@' ; done)
156 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@lib/\1.a@' -e 's@^ .*@@' ; done)
159 # All symbols must be exported
162 ###############################################################################
164 ###############################################################################
169 all: vlc ${ALIASES} plugins vlc.app
172 for dir in $(PLUGINS_DIR) ; do \
173 ( cd plugins/$${dir} && $(MAKE) clean ) ; done
174 rm -f plugins/*/*.o plugins/*/*.moc plugins/*/*.bak
175 rm -f $(C_OBJ) $(CPP_OBJ)
176 rm -f src/*/*.o extras/*/*.o
177 rm -f lib/*.so lib/*.a vlc gnome-vlc gvlc kvlc qvlc
181 rm -f **/*.o **/*~ *.log
183 rm -f include/defs.h include/config.h include/modules_builtin.h
184 rm -f config*status config*cache config*log
185 rm -f gmon.out core build-stamp
190 mkdir -p $(DESTDIR)$(bindir)
191 $(INSTALL) vlc $(DESTDIR)$(bindir)
193 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
195 mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
197 $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
199 mkdir -p $(DESTDIR)$(datadir)/videolan
200 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
201 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
202 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
206 @echo CFLAGS: $(CFLAGS)
207 @echo DCFLAGS: $(DCFLAGS)
208 @echo LCFLAGS: $(LCFLAGS)
209 @echo C_OBJ: $(C_OBJ)
210 @echo CPP_OBJ: $(CPP_OBJ)
211 @echo objects: $(objects)
212 @echo cppobjects: $(cppobjects)
213 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
214 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
217 # ugliest of all, but I have no time to do it -- sam
218 snapshot: Makefile.opts
219 rm -Rf /tmp/vlc-${PROGRAM_VERSION}* /tmp/vlc-${PROGRAM_VERSION}nocss*
220 # copy archive in /tmp
221 find -type d | grep -v CVS | grep -v '\.dep' | while read i ; \
222 do mkdir -p /tmp/vlc-${PROGRAM_VERSION}/$$i ; \
224 find debian -mindepth 1 -maxdepth 1 -type d | \
225 while read i ; do rm -Rf /tmp/vlc-${PROGRAM_VERSION}/$$i ; done
226 # .c .h .in .cpp .glade
227 find include src plugins -type f -name '*.[chig]*' | while read i ; \
228 do cp $$i /tmp/vlc-${PROGRAM_VERSION}/$$i ; done
230 find . plugins -type f -name Makefile | while read i ; \
231 do cp $$i /tmp/vlc-${PROGRAM_VERSION}/$$i ; done
233 cp -a extras/* /tmp/vlc-${PROGRAM_VERSION}/extras
234 cp -a doc/* /tmp/vlc-${PROGRAM_VERSION}/doc
235 find /tmp/vlc-${PROGRAM_VERSION}/extras \
236 /tmp/vlc-${PROGRAM_VERSION}/doc \
237 -type d -name CVS | while read i ; \
241 cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO todo.pl \
242 Makefile.opts.in Makefile.dep Makefile.modules \
243 configure configure.in install-sh config.sub config.guess \
244 /tmp/vlc-${PROGRAM_VERSION}/
245 for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
246 changelog changelog-css rules rules-css vlc.dirs vlc.desktop \
247 gvlc.desktop gnome-vlc.desktop vlc.menu ; do \
248 cp debian/$$file /tmp/vlc-${PROGRAM_VERSION}/debian/ ; \
250 for file in default8x16.psf default8x9.psf vlc_beos.rsrc vlc.icns ; do \
251 cp share/$$file /tmp/vlc-${PROGRAM_VERSION}/share/ ; done
252 for icon in vlc gvlc qvlc gnome-vlc kvlc ; do \
253 cp share/$$icon.xpm share/$$icon.png \
254 /tmp/vlc-${PROGRAM_VERSION}/share/ ; done
256 # build css-enabled archives
257 (cd /tmp ; tar cf vlc-${PROGRAM_VERSION}.tar vlc-${PROGRAM_VERSION} ; \
258 bzip2 -f -9 < vlc-${PROGRAM_VERSION}.tar \
259 > vlc-${PROGRAM_VERSION}.tar.bz2 ; \
260 gzip -f -9 vlc-${PROGRAM_VERSION}.tar )
261 mv /tmp/vlc-${PROGRAM_VERSION}.tar.gz \
262 /tmp/vlc-${PROGRAM_VERSION}.tar.bz2 ..
265 rm -Rf /tmp/vlc-${PROGRAM_VERSION}*
269 ifneq (,$(findstring darwin,$(SYS)))
271 mkdir -p vlc.app/Contents/Resources
272 mkdir -p vlc.app/Contents/MacOS/lib
273 mkdir -p vlc.app/Contents/MacOS/share
274 $(INSTALL) -m 644 extras/MacOSX_app/Contents/Info.plist vlc.app/Contents/
275 $(INSTALL) -m 644 extras/MacOSX_app/Contents/PkgInfo vlc.app/Contents/
276 $(INSTALL) vlc vlc.app/Contents/MacOS/
277 $(INSTALL) share/vlc.icns vlc.app/Contents/Resources/
279 $(INSTALL) $(PLUGINS:%=lib/%.so) vlc.app/Contents/MacOS/lib
281 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
287 # GTK/Gnome aliases - don't add too many aliases which could bloat
290 gnome-vlc gvlc kvlc qvlc: vlc
291 rm -f $@ && ln -s vlc $@
294 # Generic rules (see below)
297 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
299 $(CPP_DEP): %.dpp: FORCE
300 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
302 $(H_OBJ): Makefile.opts Makefile.dep Makefile
303 rm -f $@ && cp $@.in $@
305 for i in $(BUILTINS) ; do \
306 echo "int module_"$$i"_InitModule( module_t* );" >> $@ ; \
307 echo "int module_"$$i"_ActivateModule( module_t* );" >> $@ ; \
308 echo "int module_"$$i"_DeactivateModule( module_t* );" >> $@ ; \
312 printf "#define ALLOCATE_ALL_BUILTINS() do { " >> $@ ;
314 for i in $(BUILTINS) ; do \
315 printf "ALLOCATE_BUILTIN("$$i"); " >> $@ ; \
318 echo "} while( 0 );" >> $@ ;
321 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
322 $(C_OBJ): %.o: .dep/%.d
324 ifneq (,$(findstring darwin,$(SYS)))
325 #this is uglier of all
326 @if test "src/ac3_decoder/ac3_imdct.c" = "$<"; then $(CC) `echo $(CFLAGS) | sed -e 's/-O3/-O/'` -c -o $@ $<; echo "(CC) `echo $(CFLAGS) | sed -e 's/-O3/-O/'` -c -o $@ $<"; else $(CC) $(CFLAGS) -c -o $@ $<; echo "$(CC) $(CFLAGS) -c -o $@ $<"; fi
328 $(CC) $(CFLAGS) -c -o $@ $<
331 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
332 $(CPP_OBJ): %.o: .dep/%.dpp
333 $(CPP_OBJ): %.o: %.cpp
334 $(CC) $(CFLAGS) -c -o $@ $<
337 # Main application target
339 vlc: Makefile.opts Makefile.dep Makefile $(H_OBJ) $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ)
340 $(CC) $(CFLAGS) -o $@ $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ) $(LCFLAGS)
343 ln -s ../vlc ./lib/_APP_
344 xres -o $@ ./share/vlc_beos.rsrc
351 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
353 cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)
356 # Built-in modules target
358 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
359 $(BUILTIN_OBJ): FORCE
360 cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)