1 ###############################################################################
2 # vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
3 ###############################################################################
5 ifeq ($(shell [ ! -r Makefile.opts ] && echo 1),)
9 ###############################################################################
11 ###############################################################################
14 # All possible plugin directories, needed for make clean
65 PLUGINS_TARGETS := a52/a52 \
76 chroma/chroma_i420_rgb \
77 chroma/chroma_i420_rgb_mmx \
78 chroma/chroma_i420_yuy2 \
79 chroma/chroma_i420_yuy2_mmx \
80 chroma/chroma_i422_yuy2 \
81 chroma/chroma_i422_yuy2_mmx \
82 chroma/chroma_i420_ymga \
83 chroma/chroma_i420_ymga_mmx \
96 filter/filter_deinterlace \
97 filter/filter_transform \
98 filter/filter_invert \
99 filter/filter_distort \
116 lpcm_adec/lpcm_adec \
121 memcpy/memcpymmxext \
123 memcpy/memcpyaltivec \
128 motion/motionmmxext \
130 motion/motionaltivec \
131 mpeg_system/mpeg_es \
132 mpeg_system/mpeg_ps \
133 mpeg_system/mpeg_ts \
134 mpeg_adec/mpeg_adec \
135 mpeg_vdec/mpeg_vdec \
141 satellite/satellite \
156 INTERFACE := main interface intf_msg intf_playlist intf_eject
157 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
158 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
159 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
160 MISC := mtime modules configuration netutils iso_lang
162 C_OBJ := $(INTERFACE:%=src/interface/%.o) \
163 $(INPUT:%=src/input/%.o) \
164 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
165 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
166 $(MISC:%=src/misc/%.o)
171 ifeq ($(NEED_GETOPT),1)
172 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
175 ifeq ($(NEED_SYMBOLS),1)
176 C_OBJ += src/misc/symbols.o
180 CPP_OBJ := src/misc/beos_specific.o
183 ifneq (,$(findstring darwin,$(SYS)))
184 C_OBJ += src/misc/darwin_specific.o
187 ifneq (,$(findstring mingw32,$(SYS)))
188 C_OBJ += src/misc/win32_specific.o
189 RESOURCE_OBJ := share/vlc_win32_rc.o
192 VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ)
197 H_OBJ := src/misc/modules_builtin.h
200 # Other lists of files
202 C_DEP := $(C_OBJ:%.o=.dep/%.d)
203 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
206 # Translate plugin names
209 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
212 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
218 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
220 # All symbols must be exported
223 ###############################################################################
225 ###############################################################################
230 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
233 @echo "**** No configuration found, please run ./configure"
236 # $(MAKE) $(MAKECMDGOALS)
241 @echo CFLAGS: $(CFLAGS)
242 @echo LDFLAGS: $(LDFLAGS)
243 @echo plugins_CFLAGS: $(plugins_CFLAGS)
244 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
245 @echo builtins_CFLAGS: $(builtins_CFLAGS)
246 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
247 @echo C_OBJ: $(C_OBJ)
248 @echo CPP_OBJ: $(CPP_OBJ)
249 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
250 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
255 clean: plugins-clean po-clean vlc-clean
256 rm -f src/*/*.o extras/*/*.o
257 rm -f lib/*.so* lib/*.a
258 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
259 rm -rf extras/MacOSX/build
262 -cd po && $(MAKE) clean
265 for dir in $(PLUGINS_DIR) ; do \
266 ( cd plugins/$${dir} \
267 && $(MAKE) -f ../../Makefile.modules clean ) ; done
268 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
271 rm -f $(C_OBJ) $(CPP_OBJ)
272 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
276 -cd po && $(MAKE) maintainer-clean
277 rm -f **/*.o **/*~ *.log
279 rm -f include/defs.h include/modules_builtin.h
280 rm -f src/misc/modules_builtin.h
281 rm -f config*status config*cache config*log conftest*
282 rm -f gmon.out core build-stamp
287 # Install/uninstall rules
289 install: vlc-install plugins-install po-install
291 uninstall: vlc-uninstall plugins-uninstall po-uninstall
294 mkdir -p $(DESTDIR)$(bindir)
295 $(INSTALL) vlc $(DESTDIR)$(bindir)
297 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
299 mkdir -p $(DESTDIR)$(datadir)/videolan
300 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
301 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
302 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
305 rm -f $(DESTDIR)$(bindir)/vlc
307 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
309 rm -f $(DESTDIR)$(datadir)/videolan/*.psf
310 rm -f $(DESTDIR)$(datadir)/videolan/*.png
311 rm -f $(DESTDIR)$(datadir)/videolan/*.xpm
314 mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
316 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/videolan/vlc
320 rm -f $(DESTDIR)$(libdir)/videolan/vlc/*.so
323 -cd po && $(MAKE) install
326 -cd po && $(MAKE) uninstall
329 # Package generation rules
332 # Check that tmp isn't in the way
333 @if test -e tmp; then \
334 echo "Error: please remove ./tmp, it is in the way"; false; \
336 echo "OK."; mkdir tmp; \
338 # Copy directory structure in tmp
339 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
340 do mkdir -p tmp/vlc/$$i ; \
343 find debian -mindepth 1 -maxdepth 1 -type d | \
344 while read i ; do rm -Rf tmp/vlc/$$i ; done
345 # Copy .c .h .in .cpp and .glade files
346 find include src plugins -type f -name '*.[bcdhigrst]*' | while read i ; \
347 do cp $$i tmp/vlc/$$i ; done
348 # Grmbl... special case...
349 for i in API BUGS DESIGN TODO ; \
350 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
351 # Copy plugin Makefiles
352 find plugins -type f -name Makefile | while read i ; \
353 do cp $$i tmp/vlc/$$i ; done
354 # Copy extra programs and documentation
355 cp -a extras/* tmp/vlc/extras
356 cp -a doc/* tmp/vlc/doc
357 find tmp/vlc/extras tmp/vlc/doc \
358 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
359 while read i ; do rm -Rf $$i ; done
361 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
362 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
364 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
365 ABOUT-NLS BUGS MODULES vlc.spec \
366 Makefile Makefile.opts.in Makefile.dep Makefile.modules \
367 configure configure.in install-sh install-win32 macosx-dmg \
368 config.sub config.guess aclocal.m4 mkinstalldirs \
370 # Copy Debian control files
371 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
372 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
373 for file in control changelog rules ; do \
374 cp debian/$$file tmp/vlc/debian/ ; done
375 # Copy ipkg control files
376 for file in control rules patch ; do \
377 cp ipkg/$$file tmp/vlc/ipkg/ ; done
378 # Copy fonts and icons
379 for file in share/*vlc* share/*psf; do \
380 cp $$file tmp/vlc/share ; done
383 mv tmp/vlc tmp/$$F; (cd tmp ; tar czf ../$$F.tar.gz $$F); \
388 # XXX: this rule is probably only useful to you if you have exactly
389 # the same setup as me. Contact sam@zoy.org if you need to use it.
391 # Check that tmp isn't in the way
392 @if test -e tmp; then \
393 echo "Error: please remove ./tmp, it is in the way"; false; \
395 echo "OK."; mkdir tmp; \
397 # Create installation script
398 cp install-win32 tmp/nsi
399 # Copy relevant files
402 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
403 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
404 do cp $$file tmp/$${file}.txt ; \
405 unix2dos tmp/$${file}.txt ; done
407 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
408 # don't include these two
409 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
411 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
414 for file in default8x16.psf default8x9.psf ; \
415 do cp share/$$file tmp/share/ ; done
417 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
422 # Check that tmp isn't in the way
423 @if test -e tmp; then \
424 echo "Error: please remove ./tmp, it is in the way"; false; \
426 echo "OK."; mkdir tmp; \
430 mkdir -p tmp/vlc/share
431 # Copy relevant files
434 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
435 for file in default8x16.psf default8x9.psf ; \
436 do cp share/$$file tmp/vlc/share/ ; done
437 mkdir tmp/vlc/plugins
438 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
439 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
441 mv tmp/vlc tmp/vlc-${VERSION}
442 (cd tmp ; find vlc-${VERSION} | \
443 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
444 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
449 # Check that tmp isn't in the way
450 @if test -e tmp; then \
451 echo "Error: please remove ./tmp, it is in the way"; false; \
453 echo "OK."; mkdir tmp; \
456 # Copy relevant files
458 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/
461 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
467 # Gtk/Gnome/* aliases and OS X application
469 gnome-vlc gvlc kvlc qvlc: vlc
470 rm -f $@ && ln -s vlc $@
474 ifneq (,$(findstring darwin,$(SYS)))
476 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t'
477 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
478 $(INSTALL) -d vlc.app/Contents/MacOS/share
479 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
480 $(INSTALL) vlc vlc.app/Contents/MacOS/
482 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
484 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
490 # Generic rules (see below)
492 $(H_OBJ): Makefile.opts Makefile.dep Makefile
493 # @echo "regenerating $@"
494 @rm -f $@ && cp $@.in $@
496 @for i in $(BUILTINS) ; do \
497 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
498 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
499 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
503 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
504 @echo " do \\" >> $@ ;
505 @echo " { \\" >> $@ ;
507 @for i in $(BUILTINS) ; do \
508 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
511 @echo " } while( 0 );" >> $@ ;
515 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
517 $(CPP_DEP): %.dpp: FORCE
518 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
520 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
521 $(C_OBJ): %.o: $(H_OBJ)
522 $(C_OBJ): %.o: .dep/%.d
524 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
526 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
527 $(CPP_OBJ): %.o: $(H_OBJ)
528 $(CPP_OBJ): %.o: .dep/%.dpp
529 $(CPP_OBJ): %.o: %.cpp
530 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
532 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
533 ifneq (,(findstring mingw32,$(SYS)))
534 $(RESOURCE_OBJ): %.o: %.rc
535 $(WINDRES) -i $< -o $@
539 # Main application target
541 vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) $(BUILTIN_OBJ)
542 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
544 xres -o $@ ./share/vlc_beos.rsrc
551 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
553 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
556 # Built-in modules target
558 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
559 $(BUILTIN_OBJ): FORCE
560 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)