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 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 gtk/gnome gtk/gtk \
27 downmix/downmix downmix/downmixsse downmix/downmix3dn \
28 idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext \
29 imdct/imdct imdct/imdct3dn imdct/imdctsse \
30 macosx/macosx mga/mga \
31 motion/motion motion/motionmmx motion/motionmmxext \
32 mpeg/es mpeg/ps mpeg/ts null/null qt/qt sdl/sdl \
33 text/ncurses text/rc x11/x11 x11/xvideo yuv/yuv yuv/yuvmmx
38 INTERFACE = src/interface/main.o \
39 src/interface/interface.o \
40 src/interface/intf_msg.o \
41 src/interface/intf_playlist.o \
42 src/interface/intf_channels.o \
43 src/interface/intf_urldecode.o \
45 INPUT = src/input/input.o \
46 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 \
52 src/input/mpeg_system.o
54 AUDIO_OUTPUT = src/audio_output/audio_output.o \
55 src/audio_output/aout_ext-dec.o \
56 src/audio_output/aout_u8.o \
57 src/audio_output/aout_s8.o \
58 src/audio_output/aout_u16.o \
59 src/audio_output/aout_s16.o \
60 src/audio_output/aout_spdif.o
62 VIDEO_OUTPUT = src/video_output/video_output.o \
63 src/video_output/video_text.o \
64 src/video_output/video_spu.o \
65 src/video_output/video_yuv.o
67 AC3_DECODER = src/ac3_decoder/ac3_decoder_thread.o \
68 src/ac3_decoder/ac3_decoder.o \
69 src/ac3_decoder/ac3_parse.o \
70 src/ac3_decoder/ac3_exponent.o \
71 src/ac3_decoder/ac3_bit_allocate.o \
72 src/ac3_decoder/ac3_mantissa.o \
73 src/ac3_decoder/ac3_rematrix.o \
74 src/ac3_decoder/ac3_imdct.o
76 AC3_SPDIF = src/ac3_spdif/ac3_spdif.o \
77 src/ac3_spdif/ac3_iec958.o
79 LPCM_DECODER = src/lpcm_decoder/lpcm_decoder_thread.o \
80 src/lpcm_decoder/lpcm_decoder.o
82 AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
83 src/audio_decoder/adec_generic.o \
84 src/audio_decoder/adec_layer1.o \
85 src/audio_decoder/adec_layer2.o \
86 src/audio_decoder/adec_math.o
88 SPU_DECODER = src/spu_decoder/spu_decoder.o
90 #GEN_DECODER = src/generic_decoder/generic_decoder.o
92 VIDEO_PARSER = src/video_parser/video_parser.o \
93 src/video_parser/vpar_headers.o \
94 src/video_parser/vpar_blocks.o \
95 src/video_parser/vpar_synchro.o \
96 src/video_parser/video_fifo.o
98 VIDEO_DECODER = src/video_decoder/video_decoder.o
100 MISC = src/misc/mtime.o \
105 C_OBJ = $(INTERFACE) \
123 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
127 CPP_OBJ = src/misc/beos_specific.o
130 ifneq (,$(findstring darwin,$(SYS)))
131 C_OBJ += src/misc/darwin_specific.o
137 H_OBJ = include/modules_builtin.h
140 # Other lists of files
142 C_DEP := $(C_OBJ:%.o=.dep/%.d)
143 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
146 # Translate plugin names
149 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@lib/\1.so@' -e 's@^ .*@@' ; done)
152 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@lib/\1.a@' -e 's@^ .*@@' ; done)
155 # All symbols must be exported
158 ###############################################################################
160 ###############################################################################
165 all: vlc ${ALIASES} plugins vlc.app
168 for dir in $(PLUGINS_DIR) ; do \
169 ( cd plugins/$${dir} && $(MAKE) clean ) ; done
170 rm -f plugins/*/*.o plugins/*/*.moc plugins/*/*.bak
171 rm -f $(C_OBJ) $(CPP_OBJ)
172 rm -f src/*/*.o extras/*/*.o
173 rm -f lib/*.so lib/*.a vlc gnome-vlc gvlc kvlc qvlc
177 rm -f **/*.o **/*~ *.log
179 rm -f include/defs.h include/config.h include/modules_builtin.h
180 rm -f config*status config*cache config*log
181 rm -f gmon.out core build-stamp
186 mkdir -p $(DESTDIR)$(bindir)
187 $(INSTALL) vlc $(DESTDIR)$(bindir)
189 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
191 mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
193 $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
195 mkdir -p $(DESTDIR)$(datadir)/videolan
196 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
197 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
198 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
202 @echo CFLAGS: $(CFLAGS)
203 @echo DCFLAGS: $(DCFLAGS)
204 @echo LCFLAGS: $(LCFLAGS)
205 @echo C_OBJ: $(C_OBJ)
206 @echo CPP_OBJ: $(CPP_OBJ)
207 @echo objects: $(objects)
208 @echo cppobjects: $(cppobjects)
209 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
210 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
213 # ugliest of all, but I have no time to do it -- sam
214 snapshot: Makefile.opts
215 rm -Rf /tmp/vlc-${PROGRAM_VERSION}* /tmp/vlc-${PROGRAM_VERSION}nocss*
216 # copy archive in /tmp
217 find -type d | grep -v CVS | grep -v '\.dep' | while read i ; \
218 do mkdir -p /tmp/vlc-${PROGRAM_VERSION}/$$i ; \
220 find debian -mindepth 1 -maxdepth 1 -type d | \
221 while read i ; do rm -Rf /tmp/vlc-${PROGRAM_VERSION}/$$i ; done
222 # .c .h .in .cpp .glade
223 find include src plugins -type f -name '*.[chig]*' | while read i ; \
224 do cp $$i /tmp/vlc-${PROGRAM_VERSION}/$$i ; done
226 find . plugins -type f -name Makefile | while read i ; \
227 do cp $$i /tmp/vlc-${PROGRAM_VERSION}/$$i ; done
229 cp -a extras/* /tmp/vlc-${PROGRAM_VERSION}/extras
230 cp -a doc/* /tmp/vlc-${PROGRAM_VERSION}/doc
231 find /tmp/vlc-${PROGRAM_VERSION}/extras \
232 /tmp/vlc-${PROGRAM_VERSION}/doc \
233 -type d -name CVS | while read i ; \
237 cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO todo.pl \
238 Makefile.opts.in Makefile.dep Makefile.modules \
239 configure configure.in install-sh config.sub config.guess \
240 /tmp/vlc-${PROGRAM_VERSION}/
241 for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
242 changelog changelog-css rules rules-css vlc.dirs vlc.desktop \
243 gvlc.desktop gnome-vlc.desktop vlc.menu ; do \
244 cp debian/$$file /tmp/vlc-${PROGRAM_VERSION}/debian/ ; \
246 for file in default8x16.psf default8x9.psf vlc_beos.rsrc vlc.icns ; do \
247 cp share/$$file /tmp/vlc-${PROGRAM_VERSION}/share/ ; done
248 for icon in vlc gvlc qvlc gnome-vlc kvlc ; do \
249 cp share/$$icon.xpm share/$$icon.png \
250 /tmp/vlc-${PROGRAM_VERSION}/share/ ; done
252 # build css-enabled archives
253 (cd /tmp ; tar cf vlc-${PROGRAM_VERSION}.tar vlc-${PROGRAM_VERSION} ; \
254 bzip2 -f -9 < vlc-${PROGRAM_VERSION}.tar \
255 > vlc-${PROGRAM_VERSION}.tar.bz2 ; \
256 gzip -f -9 vlc-${PROGRAM_VERSION}.tar )
257 mv /tmp/vlc-${PROGRAM_VERSION}.tar.gz \
258 /tmp/vlc-${PROGRAM_VERSION}.tar.bz2 ..
261 rm -Rf /tmp/vlc-${PROGRAM_VERSION}*
265 ifneq (,$(findstring darwin,$(SYS)))
267 mkdir -p vlc.app/Contents/Resources
268 mkdir -p vlc.app/Contents/MacOS/lib
269 mkdir -p vlc.app/Contents/MacOS/share
270 $(INSTALL) -m 644 extras/MacOSX_app/Contents/Info.plist vlc.app/Contents/
271 $(INSTALL) -m 644 extras/MacOSX_app/Contents/PkgInfo vlc.app/Contents/
272 $(INSTALL) vlc vlc.app/Contents/MacOS/
273 $(INSTALL) share/vlc.icns vlc.app/Contents/Resources/
275 $(INSTALL) $(PLUGINS:%=lib/%.so) vlc.app/Contents/MacOS/lib
277 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
283 # GTK/Gnome aliases - don't add too many aliases which could bloat
286 gnome-vlc gvlc kvlc qvlc: vlc
287 rm -f $@ && ln -s vlc $@
290 # Generic rules (see below)
293 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
295 $(CPP_DEP): %.dpp: FORCE
296 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
298 $(H_OBJ): Makefile.opts Makefile.dep Makefile
299 rm -f $@ && cp $@.in $@
301 for i in $(BUILTINS) ; do \
302 echo "int module_"$$i"_InitModule( module_t* );" >> $@ ; \
303 echo "int module_"$$i"_ActivateModule( module_t* );" >> $@ ; \
304 echo "int module_"$$i"_DeactivateModule( module_t* );" >> $@ ; \
308 printf "#define ALLOCATE_ALL_BUILTINS() do { " >> $@ ;
310 for i in $(BUILTINS) ; do \
311 printf "ALLOCATE_BUILTIN("$$i"); " >> $@ ; \
314 echo "} while( 0 );" >> $@ ;
317 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
318 $(C_OBJ): %.o: .dep/%.d
320 $(CC) $(CFLAGS) -c -o $@ $<
322 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
323 $(CPP_OBJ): %.o: .dep/%.dpp
324 $(CPP_OBJ): %.o: %.cpp
325 $(CC) $(CFLAGS) -c -o $@ $<
328 # Main application target
330 vlc: Makefile.opts Makefile.dep Makefile $(H_OBJ) $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ)
331 $(CC) $(CFLAGS) -o $@ $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ) $(LCFLAGS)
334 ln -s ../vlc ./lib/_APP_
335 xres -o $@ ./share/vlc_beos.rsrc
342 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
344 cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)
347 # Built-in modules target
349 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
350 $(BUILTIN_OBJ): FORCE
351 cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)