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_playlist.o \
40 src/interface/intf_channels.o \
41 src/interface/intf_urldecode.o \
43 INPUT = src/input/input.o \
44 src/input/input_ext-dec.o \
45 src/input/input_ext-intf.o \
46 src/input/input_dec.o \
47 src/input/input_programs.o \
48 src/input/input_netlist.o \
49 src/input/input_clock.o \
50 src/input/mpeg_system.o
52 AUDIO_OUTPUT = src/audio_output/audio_output.o \
53 src/audio_output/aout_ext-dec.o \
54 src/audio_output/aout_u8.o \
55 src/audio_output/aout_s8.o \
56 src/audio_output/aout_u16.o \
57 src/audio_output/aout_s16.o \
58 src/audio_output/aout_spdif.o
60 VIDEO_OUTPUT = src/video_output/video_output.o \
61 src/video_output/video_text.o \
62 src/video_output/video_spu.o \
63 src/video_output/video_yuv.o
65 AC3_DECODER = src/ac3_decoder/ac3_decoder_thread.o \
66 src/ac3_decoder/ac3_decoder.o \
67 src/ac3_decoder/ac3_parse.o \
68 src/ac3_decoder/ac3_exponent.o \
69 src/ac3_decoder/ac3_bit_allocate.o \
70 src/ac3_decoder/ac3_mantissa.o \
71 src/ac3_decoder/ac3_rematrix.o \
72 src/ac3_decoder/ac3_imdct.o \
73 src/ac3_decoder/ac3_imdct_c.o \
74 src/ac3_decoder/ac3_srfft.o \
75 src/ac3_decoder/ac3_downmix.o \
76 src/ac3_decoder/ac3_downmix_c.o
78 AC3_SPDIF = src/ac3_spdif/ac3_spdif.o \
79 src/ac3_spdif/ac3_iec958.o
81 LPCM_DECODER = src/lpcm_decoder/lpcm_decoder_thread.o \
82 src/lpcm_decoder/lpcm_decoder.o
84 AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
85 src/audio_decoder/adec_generic.o \
86 src/audio_decoder/adec_layer1.o \
87 src/audio_decoder/adec_layer2.o \
88 src/audio_decoder/adec_math.o
90 SPU_DECODER = src/spu_decoder/spu_decoder.o
92 #GEN_DECODER = src/generic_decoder/generic_decoder.o
94 VIDEO_PARSER = src/video_parser/video_parser.o \
95 src/video_parser/vpar_headers.o \
96 src/video_parser/vpar_blocks.o \
97 src/video_parser/vpar_synchro.o \
98 src/video_parser/video_fifo.o
100 VIDEO_DECODER = src/video_decoder/video_decoder.o
102 MISC = src/misc/mtime.o \
107 C_OBJ = $(INTERFACE) \
125 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
129 CPP_OBJ = src/misc/beos_specific.o
132 ifneq (,$(findstring darwin,$(SYS)))
133 C_OBJ += src/misc/darwin_specific.o
139 H_OBJ = include/modules_builtin.h
142 # Other lists of files
144 C_DEP := $(C_OBJ:%.o=.dep/%.d)
145 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
148 # Translate plugin names
151 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@lib/\1.so@' -e 's@^ .*@@' ; done)
154 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@lib/\1.a@' -e 's@^ .*@@' ; done)
157 # All symbols must be exported
160 ###############################################################################
162 ###############################################################################
167 all: vlc ${ALIASES} plugins vlc.app
170 for dir in $(PLUGINS_DIR) ; do \
171 ( cd plugins/$${dir} && $(MAKE) clean ) ; done
172 rm -f plugins/*/*.o plugins/*/*.moc plugins/*/*.bak
173 rm -f $(C_OBJ) $(CPP_OBJ)
174 rm -f src/*/*.o extras/*/*.o
175 rm -f lib/*.so lib/*.a vlc gnome-vlc gvlc kvlc qvlc
179 rm -f **/*.o **/*~ *.log
181 rm -f include/defs.h include/config.h include/modules_builtin.h
182 rm -f config*status config*cache config*log
183 rm -f gmon.out core build-stamp
188 mkdir -p $(DESTDIR)$(bindir)
189 $(INSTALL) vlc $(DESTDIR)$(bindir)
191 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
193 mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
195 $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
197 mkdir -p $(DESTDIR)$(datadir)/videolan
198 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
199 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
200 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
204 @echo CFLAGS: $(CFLAGS)
205 @echo DCFLAGS: $(DCFLAGS)
206 @echo LCFLAGS: $(LCFLAGS)
207 @echo C_OBJ: $(C_OBJ)
208 @echo CPP_OBJ: $(CPP_OBJ)
209 @echo objects: $(objects)
210 @echo cppobjects: $(cppobjects)
211 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
212 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
215 # ugliest of all, but I have no time to do it -- sam
216 snapshot: Makefile.opts
217 rm -Rf /tmp/vlc-${PROGRAM_VERSION}* /tmp/vlc-${PROGRAM_VERSION}nocss*
218 # copy archive in /tmp
219 find -type d | grep -v CVS | grep -v '\.dep' | while read i ; \
220 do mkdir -p /tmp/vlc-${PROGRAM_VERSION}/$$i ; \
222 find debian -mindepth 1 -maxdepth 1 -type d | \
223 while read i ; do rm -Rf /tmp/vlc-${PROGRAM_VERSION}/$$i ; done
224 # .c .h .in .cpp .glade
225 find include src plugins -type f -name '*.[chig]*' | while read i ; \
226 do cp $$i /tmp/vlc-${PROGRAM_VERSION}/$$i ; done
228 find . plugins -type f -name Makefile | while read i ; \
229 do cp $$i /tmp/vlc-${PROGRAM_VERSION}/$$i ; done
231 cp -a extras/* /tmp/vlc-${PROGRAM_VERSION}/extras
232 cp -a doc/* /tmp/vlc-${PROGRAM_VERSION}/doc
233 find /tmp/vlc-${PROGRAM_VERSION}/extras \
234 /tmp/vlc-${PROGRAM_VERSION}/doc \
235 -type d -name CVS | while read i ; \
239 cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO todo.pl \
240 Makefile.opts.in Makefile.dep Makefile.modules \
241 configure configure.in install-sh config.sub config.guess \
242 /tmp/vlc-${PROGRAM_VERSION}/
243 for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
244 changelog changelog-css rules rules-css vlc.dirs vlc.desktop \
245 gvlc.desktop gnome-vlc.desktop vlc.menu ; do \
246 cp debian/$$file /tmp/vlc-${PROGRAM_VERSION}/debian/ ; \
248 for file in default8x16.psf default8x9.psf vlc_beos.rsrc vlc.icns ; do \
249 cp share/$$file /tmp/vlc-${PROGRAM_VERSION}/share/ ; done
250 for icon in vlc gvlc qvlc gnome-vlc kvlc ; do \
251 cp share/$$icon.xpm share/$$icon.png \
252 /tmp/vlc-${PROGRAM_VERSION}/share/ ; done
254 # build css-enabled archives
255 (cd /tmp ; tar cf vlc-${PROGRAM_VERSION}.tar vlc-${PROGRAM_VERSION} ; \
256 bzip2 -f -9 < vlc-${PROGRAM_VERSION}.tar \
257 > vlc-${PROGRAM_VERSION}.tar.bz2 ; \
258 gzip -f -9 vlc-${PROGRAM_VERSION}.tar )
259 mv /tmp/vlc-${PROGRAM_VERSION}.tar.gz \
260 /tmp/vlc-${PROGRAM_VERSION}.tar.bz2 ..
263 rm -Rf /tmp/vlc-${PROGRAM_VERSION}*
267 ifneq (,$(findstring darwin,$(SYS)))
269 mkdir -p vlc.app/Contents/Resources
270 mkdir -p vlc.app/Contents/MacOS/lib
271 mkdir -p vlc.app/Contents/MacOS/share
272 $(INSTALL) -m 644 extras/MacOSX_app/Contents/Info.plist vlc.app/Contents/
273 $(INSTALL) -m 644 extras/MacOSX_app/Contents/PkgInfo vlc.app/Contents/
274 $(INSTALL) vlc vlc.app/Contents/MacOS/
275 $(INSTALL) share/vlc.icns vlc.app/Contents/Resources/
277 $(INSTALL) $(PLUGINS:%=lib/%.so) vlc.app/Contents/MacOS/lib
279 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
285 # GTK/Gnome aliases - don't add too many aliases which could bloat
288 gnome-vlc gvlc kvlc qvlc: vlc
289 rm -f $@ && ln -s vlc $@
292 # Generic rules (see below)
295 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
297 $(CPP_DEP): %.dpp: FORCE
298 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
300 $(H_OBJ): Makefile.opts Makefile.dep Makefile
301 rm -f $@ && cp $@.in $@
303 for i in $(BUILTINS) ; do \
304 echo "int module_"$$i"_InitModule( module_t* );" >> $@ ; \
305 echo "int module_"$$i"_ActivateModule( module_t* );" >> $@ ; \
306 echo "int module_"$$i"_DeactivateModule( module_t* );" >> $@ ; \
310 printf "#define ALLOCATE_ALL_BUILTINS() do { " >> $@ ;
312 for i in $(BUILTINS) ; do \
313 printf "ALLOCATE_BUILTIN("$$i"); " >> $@ ; \
316 echo "} while( 0 );" >> $@ ;
319 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
320 $(C_OBJ): %.o: .dep/%.d
322 ifneq (,$(findstring darwin,$(SYS)))
323 #this is uglier of all
324 @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
326 $(CC) $(CFLAGS) -c -o $@ $<
329 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
330 $(CPP_OBJ): %.o: .dep/%.dpp
331 $(CPP_OBJ): %.o: %.cpp
332 $(CC) $(CFLAGS) -c -o $@ $<
335 # Main application target
337 vlc: Makefile.opts Makefile.dep Makefile $(H_OBJ) $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ)
338 $(CC) $(CFLAGS) -o $@ $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ) $(LCFLAGS)
341 ln -s ../vlc ./lib/_APP_
342 xres -o $@ ./share/vlc_beos.rsrc
349 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
351 cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)
354 # Built-in modules target
356 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
357 $(BUILTIN_OBJ): FORCE
358 cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)