1 ###############################################################################
2 # vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
3 ###############################################################################
5 ifeq ($(shell [ ! -r Makefile.opts ] && echo 1),)
8 ifeq ($(shell [ ! -r Makefile.config ] && echo 1),)
9 include Makefile.config
12 ###############################################################################
14 ###############################################################################
17 # All possible plugin directories, needed for make clean
75 PLUGINS_TARGETS := a52/a52 \
77 a52_system/a52_system \
87 chroma/chroma_i420_rgb \
88 chroma/chroma_i420_rgb_mmx \
89 chroma/chroma_i420_yuy2 \
90 chroma/chroma_i420_yuy2_mmx \
91 chroma/chroma_i422_yuy2 \
92 chroma/chroma_i422_yuy2_mmx \
93 chroma/chroma_i420_ymga \
94 chroma/chroma_i420_ymga_mmx \
111 filter/filter_clone \
113 filter/filter_deinterlace \
114 filter/filter_distort \
115 filter/filter_invert \
116 filter/filter_transform \
118 filter/filter_clone \
134 lpcm_adec/lpcm_adec \
139 memcpy/memcpymmxext \
141 memcpy/memcpyaltivec \
146 motion/motionmmxext \
148 motion/motionaltivec \
149 mpeg_system/mpeg_audio \
150 mpeg_system/mpeg_es \
151 mpeg_system/mpeg_ps \
152 mpeg_system/mpeg_ts \
153 mpeg_system/mpeg_ts_dvbpsi \
154 mpeg_adec/mpeg_adec \
155 mpeg_vdec/mpeg_vdec \
162 satellite/satellite \
180 INTERFACE := interface intf_eject
182 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system input_info
183 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
184 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
185 MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras
187 LIBVLC_OBJ := $(LIBVLC:%=src/%.o) \
188 $(INTERFACE:%=src/interface/%.o) \
189 $(PLAYLIST:%=src/playlist/%.o) \
190 $(INPUT:%=src/input/%.o) \
191 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
192 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
193 $(MISC:%=src/misc/%.o)
195 VLC_OBJ := $(VLC:%=src/%.o)
197 C_OBJ := $(VLC_OBJ) $(LIBVLC_OBJ)
202 ifeq ($(NEED_GETOPT),1)
203 LIBVLC_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
206 ifeq ($(NEED_SYMBOLS),1)
207 LIBVLC_OBJ += src/misc/symbols.o
211 CPP_OBJ := src/misc/beos_specific.o
214 ifneq (,$(findstring darwin,$(SYS)))
215 LIBVLC_OBJ += src/misc/darwin_specific.o
218 ifneq (,$(findstring mingw32,$(SYS)))
219 LIBVLC_OBJ += src/misc/win32_specific.o
220 RESOURCE_OBJ := share/vlc_win32_rc.o
223 LIBVLC_OBJ += $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ)
224 VLC_OBJ += $(RESOURCE_OBJ)
229 H_OBJ := src/misc/modules_builtin.h
232 # Other lists of files
234 C_DEP := $(C_OBJ:%.o=.dep/%.d)
235 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
238 # Translate plugin names
241 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
244 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
250 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
252 # All symbols must be exported
255 ###############################################################################
257 ###############################################################################
262 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po mozilla/libvlcplugin.so
265 @echo "**** No configuration found, please run ./configure"
268 # $(MAKE) $(MAKECMDGOALS)
273 @echo CFLAGS: $(CFLAGS)
274 @echo LDFLAGS: $(LDFLAGS)
275 @echo plugins_CFLAGS: $(plugins_CFLAGS)
276 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
277 @echo builtins_CFLAGS: $(builtins_CFLAGS)
278 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
279 @echo C_OBJ: $(C_OBJ)
280 @echo CPP_OBJ: $(CPP_OBJ)
281 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
282 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
287 clean: plugins-clean po-clean vlc-clean mozilla-clean
288 rm -f src/*/*.o extras/*/*.o
289 rm -f lib/*.so* lib/*.a
290 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
291 rm -Rf extras/MacOSX/build
294 -cd po && $(MAKE) clean
297 for dir in $(PLUGINS_DIR) ; do \
298 ( cd plugins/$${dir} \
299 && $(MAKE) -f ../../Makefile.modules clean ) ; done
300 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
303 rm -f $(C_OBJ) $(CPP_OBJ)
304 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
308 -cd mozilla && $(MAKE) clean
311 -cd po && $(MAKE) maintainer-clean
312 rm -f **/*.o **/*~ *.log
313 rm -f Makefile.opts Makefile.config
314 rm -f include/defs.h include/modules_builtin.h
315 rm -f src/misc/modules_builtin.h
316 rm -f config*status config*cache config*log conftest*
317 rm -f gmon.out core build-stamp
322 # Install/uninstall rules
324 install: vlc-install plugins-install libvlc-install po-install mozilla-install
326 uninstall: vlc-uninstall plugins-uninstall libvlc-install po-uninstall mozilla-uninstall
329 mkdir -p $(DESTDIR)$(bindir)
330 $(INSTALL) vlc $(DESTDIR)$(bindir)
332 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
334 mkdir -p $(DESTDIR)$(datadir)/vlc
335 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
336 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
337 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
340 rm -f $(DESTDIR)$(bindir)/vlc
342 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
344 rm -f $(DESTDIR)$(datadir)/vlc/*.psf
345 rm -f $(DESTDIR)$(datadir)/vlc/*.png
346 rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
349 mkdir -p $(DESTDIR)$(libdir)/vlc
351 $(INSTALL) $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
355 rm -f $(DESTDIR)$(libdir)/vlc/*.so
358 mkdir -p $(DESTDIR)$(libdir)/vlc
360 $(INSTALL) $(BUILTINS:%=plugins/%.a) $(DESTDIR)$(libdir)/vlc
364 rm -f $(DESTDIR)$(libdir)/vlc/*.a
367 mkdir -p $(DESTDIR)$(bindir)
368 $(INSTALL) vlc-config $(DESTDIR)$(bindir)
369 mkdir -p $(DESTDIR)$(includedir)/vlc
370 $(INSTALL) -m 644 include/vlc/*.h $(DESTDIR)$(includedir)/vlc
371 mkdir -p $(DESTDIR)$(libdir)
372 $(INSTALL) -m 644 lib/libvlc.a $(DESTDIR)$(libdir)
375 rm -f $(DESTDIR)$(bindir)/vlc-config
376 rm -Rf $(DESTDIR)$(includedir)/vlc
377 rm -f $(DESTDIR)$(libdir)/libvlc.a
381 -cd mozilla && $(MAKE) install
386 -cd mozilla && $(MAKE) uninstall
390 -cd po && $(MAKE) install
393 -cd po && $(MAKE) uninstall
396 # Package generation rules
399 # Check that tmp isn't in the way
400 @if test -e tmp; then \
401 echo "Error: please remove ./tmp, it is in the way"; false; \
403 echo "OK."; mkdir tmp; \
405 # Copy directory structure in tmp
406 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
407 do mkdir -p tmp/vlc/$$i ; \
410 find debian -mindepth 1 -maxdepth 1 -type d | \
411 while read i ; do rm -Rf tmp/vlc/$$i ; done
412 # Copy .c .h .in .cpp .m and .glade files
413 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
414 do cp $$i tmp/vlc/$$i ; done
415 # Grmbl... special case...
416 for i in API BUGS DESIGN TODO ; \
417 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
418 # Copy plugin Makefiles
419 find plugins -type f -name Makefile | while read i ; \
420 do cp $$i tmp/vlc/$$i ; done
421 # Copy extra programs and documentation
422 cp -a extras/* tmp/vlc/extras
423 cp -a doc/* tmp/vlc/doc
424 find tmp/vlc/extras tmp/vlc/doc \
425 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
426 while read i ; do rm -Rf $$i ; done
428 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
429 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
431 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
432 ABOUT-NLS BUGS MODULES vlc.spec \
433 Makefile Makefile.*.in Makefile.dep Makefile.modules \
434 configure configure.in install-sh install-win32 macosx-dmg \
435 config.sub config.guess aclocal.m4 mkinstalldirs \
437 # Copy Debian control files
438 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
439 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
440 for file in control changelog rules ; do \
441 cp debian/$$file tmp/vlc/debian/ ; done
442 # Copy ipkg control files
443 for file in control rules patch ; do \
444 cp ipkg/$$file tmp/vlc/ipkg/ ; done
445 # Copy fonts and icons
446 for file in share/*vlc* share/*psf; do \
447 cp $$file tmp/vlc/share ; done
450 mv tmp/vlc tmp/$$F; (cd tmp ; \
451 cd $$F && $(MAKE) distclean && cd .. ; \
452 tar czf ../$$F.tar.gz $$F);
457 # XXX: this rule is probably only useful to you if you have exactly
458 # the same setup as me. Contact sam@zoy.org if you need to use it.
460 # Check that tmp isn't in the way
461 @if test -e tmp; then \
462 echo "Error: please remove ./tmp, it is in the way"; false; \
464 echo "OK."; mkdir tmp; \
466 # Create installation script
467 cp install-win32 tmp/nsi
468 # Copy relevant files
471 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
472 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
473 do cp $$file tmp/$${file}.txt ; \
474 unix2dos tmp/$${file}.txt ; done
476 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
477 # don't include these two
478 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
480 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
483 for file in default8x16.psf default8x9.psf ; \
484 do cp share/$$file tmp/share/ ; done
486 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
491 # Check that tmp isn't in the way
492 @if test -e tmp; then \
493 echo "Error: please remove ./tmp, it is in the way"; false; \
495 echo "OK."; mkdir tmp; \
499 mkdir -p tmp/vlc/share
500 # Copy relevant files
503 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
504 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
505 for file in default8x16.psf default8x9.psf ; \
506 do cp share/$$file tmp/vlc/share/ ; done
507 mkdir tmp/vlc/plugins
508 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
509 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
511 mv tmp/vlc tmp/vlc-${VERSION}
512 (cd tmp ; find vlc-${VERSION} | \
513 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
514 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
519 # Check that tmp isn't in the way
520 @if test -e tmp; then \
521 echo "Error: please remove ./tmp, it is in the way"; false; \
523 echo "OK."; mkdir tmp; \
526 # Copy relevant files
528 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
531 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
537 # Gtk/Gnome/* aliases and OS X application
539 gnome-vlc gvlc kvlc qvlc: vlc
540 rm -f $@ && ln -s vlc $@
544 ifneq (,$(findstring darwin,$(SYS)))
546 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
547 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
548 $(INSTALL) -d vlc.app/Contents/MacOS/share
549 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
550 $(INSTALL) vlc vlc.app/Contents/MacOS/
552 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
554 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
560 # Generic rules (see below)
562 src/misc/modules_builtin.h: Makefile.opts Makefile Makefile.config
563 @echo "make[$(MAKELEVEL)]: Creating \`$@'"
564 @rm -f $@ && cp $@.in $@
566 @for i in $(BUILTINS) ; do \
567 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
568 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
569 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
573 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
574 @echo " do \\" >> $@ ;
575 @echo " { \\" >> $@ ;
577 @for i in $(BUILTINS) ; do \
578 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
581 @echo " } while( 0 );" >> $@ ;
585 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
587 $(CPP_DEP): %.dpp: FORCE
588 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
590 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
591 $(C_OBJ): %.o: $(H_OBJ)
592 $(C_OBJ): %.o: .dep/%.d
594 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
596 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
597 $(CPP_OBJ): %.o: $(H_OBJ)
598 $(CPP_OBJ): %.o: .dep/%.dpp
599 $(CPP_OBJ): %.o: %.cpp
600 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
602 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
603 $(M_OBJ): %.o: $(H_OBJ)
604 $(M_OBJ): %.o: .dep/%.dm
606 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
608 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
609 ifneq (,(findstring mingw32,$(SYS)))
610 $(RESOURCE_OBJ): %.o: %.rc
611 $(WINDRES) -i $< -o $@
615 # Main application target
617 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
618 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
620 xres -o $@ ./share/vlc_beos.rsrc
624 # here are the rules for a dynamic link of libvlc:
625 #vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
626 # $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
629 # Main library target
631 lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ) $(BUILTIN_OBJ)
633 ar rc $@ $(LIBVLC_OBJ)
635 rm -Rf lib/tmp && mkdir -p lib/tmp
636 cd lib/tmp && for i in $(BUILTINS) ; do ar x ../../plugins/$$i.a ; done
642 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
643 # $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
649 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
650 $(PLUGIN_OBJ): $(H_OBJ) FORCE
651 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
654 # Built-in modules target
656 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
657 $(BUILTIN_OBJ): $(H_OBJ) FORCE
658 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
661 # Mozilla plugin target
663 mozilla/libvlcplugin.so: FORCE
665 @cd mozilla && $(MAKE) builtins_LDFLAGS="$(builtins_LDFLAGS)"