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
71 PLUGINS_TARGETS := a52/a52 \
73 a52_system/a52_system \
83 chroma/chroma_i420_rgb \
84 chroma/chroma_i420_rgb_mmx \
85 chroma/chroma_i420_yuy2 \
86 chroma/chroma_i420_yuy2_mmx \
87 chroma/chroma_i422_yuy2 \
88 chroma/chroma_i422_yuy2_mmx \
89 chroma/chroma_i420_ymga \
90 chroma/chroma_i420_ymga_mmx \
104 filter/filter_clone \
106 filter/filter_deinterlace \
107 filter/filter_distort \
108 filter/filter_invert \
109 filter/filter_transform \
111 filter/filter_clone \
127 lpcm_adec/lpcm_adec \
132 memcpy/memcpymmxext \
134 memcpy/memcpyaltivec \
139 motion/motionmmxext \
141 motion/motionaltivec \
142 mpeg_system/mpeg_audio \
143 mpeg_system/mpeg_es \
144 mpeg_system/mpeg_ps \
145 mpeg_system/mpeg_ts \
146 mpeg_system/mpeg_ts_dvbpsi \
147 mpeg_adec/mpeg_adec \
148 mpeg_vdec/mpeg_vdec \
154 satellite/satellite \
172 INTERFACE := interface intf_eject
174 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
175 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
176 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
177 MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras
179 LIBVLC_OBJ := $(LIBVLC:%=src/%.o) \
180 $(INTERFACE:%=src/interface/%.o) \
181 $(PLAYLIST:%=src/playlist/%.o) \
182 $(INPUT:%=src/input/%.o) \
183 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
184 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
185 $(MISC:%=src/misc/%.o)
187 VLC_OBJ := $(VLC:%=src/%.o)
189 C_OBJ := $(VLC_OBJ) $(LIBVLC_OBJ)
194 ifeq ($(NEED_GETOPT),1)
195 LIBVLC_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
198 ifeq ($(NEED_SYMBOLS),1)
199 LIBVLC_OBJ += src/misc/symbols.o
203 CPP_OBJ := src/misc/beos_specific.o
206 ifneq (,$(findstring darwin,$(SYS)))
207 LIBVLC_OBJ += src/misc/darwin_specific.o
210 ifneq (,$(findstring mingw32,$(SYS)))
211 LIBVLC_OBJ += src/misc/win32_specific.o
212 RESOURCE_OBJ := share/vlc_win32_rc.o
215 LIBVLC_OBJ += $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ)
216 VLC_OBJ += $(RESOURCE_OBJ)
221 H_OBJ := src/misc/modules_builtin.h
224 # Other lists of files
226 C_DEP := $(C_OBJ:%.o=.dep/%.d)
227 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
230 # Translate plugin names
233 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
236 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
242 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
244 # All symbols must be exported
247 ###############################################################################
249 ###############################################################################
254 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po mozilla/libvlcplugin.so
257 @echo "**** No configuration found, please run ./configure"
260 # $(MAKE) $(MAKECMDGOALS)
265 @echo CFLAGS: $(CFLAGS)
266 @echo LDFLAGS: $(LDFLAGS)
267 @echo plugins_CFLAGS: $(plugins_CFLAGS)
268 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
269 @echo builtins_CFLAGS: $(builtins_CFLAGS)
270 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
271 @echo C_OBJ: $(C_OBJ)
272 @echo CPP_OBJ: $(CPP_OBJ)
273 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
274 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
279 clean: plugins-clean po-clean vlc-clean mozilla-clean
280 rm -f src/*/*.o extras/*/*.o
281 rm -f lib/*.so* lib/*.a
282 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
283 rm -Rf extras/MacOSX/build
286 -cd po && $(MAKE) clean
289 for dir in $(PLUGINS_DIR) ; do \
290 ( cd plugins/$${dir} \
291 && $(MAKE) -f ../../Makefile.modules clean ) ; done
292 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
295 rm -f $(C_OBJ) $(CPP_OBJ)
296 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
300 -cd mozilla && $(MAKE) clean
303 -cd po && $(MAKE) maintainer-clean
304 rm -f **/*.o **/*~ *.log
305 rm -f Makefile.opts Makefile.config
306 rm -f include/defs.h include/modules_builtin.h
307 rm -f src/misc/modules_builtin.h
308 rm -f config*status config*cache config*log conftest*
309 rm -f gmon.out core build-stamp
314 # Install/uninstall rules
316 install: vlc-install plugins-install libvlc-install po-install mozilla-install
318 uninstall: vlc-uninstall plugins-uninstall libvlc-install po-uninstall mozilla-uninstall
321 mkdir -p $(DESTDIR)$(bindir)
322 $(INSTALL) vlc $(DESTDIR)$(bindir)
324 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
326 mkdir -p $(DESTDIR)$(datadir)/vlc
327 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
328 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
329 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
332 rm -f $(DESTDIR)$(bindir)/vlc
334 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
336 rm -f $(DESTDIR)$(datadir)/vlc/*.psf
337 rm -f $(DESTDIR)$(datadir)/vlc/*.png
338 rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
341 mkdir -p $(DESTDIR)$(libdir)/vlc
343 $(INSTALL) $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
347 rm -f $(DESTDIR)$(libdir)/vlc/*.so
350 mkdir -p $(DESTDIR)$(bindir)
351 $(INSTALL) vlc-config $(DESTDIR)$(bindir)
352 mkdir -p $(DESTDIR)$(includedir)/vlc
353 $(INSTALL) -m 644 include/vlc/*.h $(DESTDIR)$(includedir)/vlc
354 mkdir -p $(DESTDIR)$(libdir)
355 $(INSTALL) -m 644 lib/libvlc.a $(DESTDIR)$(libdir)
358 rm -f $(DESTDIR)$(bindir)/vlc-config
359 rm -Rf $(DESTDIR)$(includedir)/vlc
360 rm -f $(DESTDIR)$(libdir)/libvlc.a
364 -cd mozilla && $(MAKE) install
369 -cd mozilla && $(MAKE) uninstall
373 -cd po && $(MAKE) install
376 -cd po && $(MAKE) uninstall
379 # Package generation rules
382 # Check that tmp isn't in the way
383 @if test -e tmp; then \
384 echo "Error: please remove ./tmp, it is in the way"; false; \
386 echo "OK."; mkdir tmp; \
388 # Copy directory structure in tmp
389 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
390 do mkdir -p tmp/vlc/$$i ; \
393 find debian -mindepth 1 -maxdepth 1 -type d | \
394 while read i ; do rm -Rf tmp/vlc/$$i ; done
395 # Copy .c .h .in .cpp .m and .glade files
396 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
397 do cp $$i tmp/vlc/$$i ; done
398 # Grmbl... special case...
399 for i in API BUGS DESIGN TODO ; \
400 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
401 # Copy plugin Makefiles
402 find plugins -type f -name Makefile | while read i ; \
403 do cp $$i tmp/vlc/$$i ; done
404 # Copy extra programs and documentation
405 cp -a extras/* tmp/vlc/extras
406 cp -a doc/* tmp/vlc/doc
407 find tmp/vlc/extras tmp/vlc/doc \
408 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
409 while read i ; do rm -Rf $$i ; done
411 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
412 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
414 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
415 ABOUT-NLS BUGS MODULES vlc.spec \
416 Makefile Makefile.*.in Makefile.dep Makefile.modules \
417 configure configure.in install-sh install-win32 macosx-dmg \
418 config.sub config.guess aclocal.m4 mkinstalldirs \
420 # Copy Debian control files
421 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
422 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
423 for file in control changelog rules ; do \
424 cp debian/$$file tmp/vlc/debian/ ; done
425 # Copy ipkg control files
426 for file in control rules patch ; do \
427 cp ipkg/$$file tmp/vlc/ipkg/ ; done
428 # Copy fonts and icons
429 for file in share/*vlc* share/*psf; do \
430 cp $$file tmp/vlc/share ; done
433 mv tmp/vlc tmp/$$F; (cd tmp ; \
434 cd $$F && $(MAKE) distclean && cd .. ; \
435 tar czf ../$$F.tar.gz $$F);
440 # XXX: this rule is probably only useful to you if you have exactly
441 # the same setup as me. Contact sam@zoy.org if you need to use it.
443 # Check that tmp isn't in the way
444 @if test -e tmp; then \
445 echo "Error: please remove ./tmp, it is in the way"; false; \
447 echo "OK."; mkdir tmp; \
449 # Create installation script
450 cp install-win32 tmp/nsi
451 # Copy relevant files
454 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
455 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
456 do cp $$file tmp/$${file}.txt ; \
457 unix2dos tmp/$${file}.txt ; done
459 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
460 # don't include these two
461 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
463 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
466 for file in default8x16.psf default8x9.psf ; \
467 do cp share/$$file tmp/share/ ; done
469 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
474 # Check that tmp isn't in the way
475 @if test -e tmp; then \
476 echo "Error: please remove ./tmp, it is in the way"; false; \
478 echo "OK."; mkdir tmp; \
482 mkdir -p tmp/vlc/share
483 # Copy relevant files
486 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
487 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
488 for file in default8x16.psf default8x9.psf ; \
489 do cp share/$$file tmp/vlc/share/ ; done
490 mkdir tmp/vlc/plugins
491 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
492 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
494 mv tmp/vlc tmp/vlc-${VERSION}
495 (cd tmp ; find vlc-${VERSION} | \
496 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
497 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
502 # Check that tmp isn't in the way
503 @if test -e tmp; then \
504 echo "Error: please remove ./tmp, it is in the way"; false; \
506 echo "OK."; mkdir tmp; \
509 # Copy relevant files
511 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
514 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
520 # Gtk/Gnome/* aliases and OS X application
522 gnome-vlc gvlc kvlc qvlc: vlc
523 rm -f $@ && ln -s vlc $@
527 ifneq (,$(findstring darwin,$(SYS)))
529 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
530 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
531 $(INSTALL) -d vlc.app/Contents/MacOS/share
532 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
533 $(INSTALL) vlc vlc.app/Contents/MacOS/
535 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
537 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
543 # Generic rules (see below)
545 src/misc/modules_builtin.h: Makefile.opts Makefile Makefile.config
546 @echo "make[$(MAKELEVEL)]: Creating \`$@'"
547 @rm -f $@ && cp $@.in $@
549 @for i in $(BUILTINS) ; do \
550 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
551 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
552 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
556 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
557 @echo " do \\" >> $@ ;
558 @echo " { \\" >> $@ ;
560 @for i in $(BUILTINS) ; do \
561 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
564 @echo " } while( 0 );" >> $@ ;
568 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
570 $(CPP_DEP): %.dpp: FORCE
571 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
573 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
574 $(C_OBJ): %.o: $(H_OBJ)
575 $(C_OBJ): %.o: .dep/%.d
577 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
579 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
580 $(CPP_OBJ): %.o: $(H_OBJ)
581 $(CPP_OBJ): %.o: .dep/%.dpp
582 $(CPP_OBJ): %.o: %.cpp
583 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
585 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
586 $(M_OBJ): %.o: $(H_OBJ)
587 $(M_OBJ): %.o: .dep/%.dm
589 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
591 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
592 ifneq (,(findstring mingw32,$(SYS)))
593 $(RESOURCE_OBJ): %.o: %.rc
594 $(WINDRES) -i $< -o $@
598 # Main application target
600 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
601 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
603 xres -o $@ ./share/vlc_beos.rsrc
607 # here are the rules for a dynamic link of libvlc:
608 #vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
609 # $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
612 # Main library target
614 lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ) $(BUILTIN_OBJ)
616 ar rc $@ $(LIBVLC_OBJ)
618 rm -Rf lib/tmp && mkdir -p lib/tmp
619 cd lib/tmp && for i in $(BUILTINS) ; do ar x ../../plugins/$$i.a ; done
625 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
626 # $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
632 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
633 $(PLUGIN_OBJ): $(H_OBJ) FORCE
634 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
637 # Built-in modules target
639 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
640 $(BUILTIN_OBJ): $(H_OBJ) FORCE
641 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
644 # Mozilla plugin target
646 mozilla/libvlcplugin.so: FORCE
648 @cd mozilla && $(MAKE) builtins_LDFLAGS="$(builtins_LDFLAGS)"