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 po-install mozilla-install
318 uninstall: vlc-uninstall plugins-uninstall 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) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
347 rm -f $(DESTDIR)$(libdir)/vlc/*.so
351 -cd mozilla && $(MAKE) install
356 -cd mozilla && $(MAKE) uninstall
360 -cd po && $(MAKE) install
363 -cd po && $(MAKE) uninstall
366 # Package generation rules
369 # Check that tmp isn't in the way
370 @if test -e tmp; then \
371 echo "Error: please remove ./tmp, it is in the way"; false; \
373 echo "OK."; mkdir tmp; \
375 # Copy directory structure in tmp
376 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
377 do mkdir -p tmp/vlc/$$i ; \
380 find debian -mindepth 1 -maxdepth 1 -type d | \
381 while read i ; do rm -Rf tmp/vlc/$$i ; done
382 # Copy .c .h .in .cpp .m and .glade files
383 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
384 do cp $$i tmp/vlc/$$i ; done
385 # Grmbl... special case...
386 for i in API BUGS DESIGN TODO ; \
387 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
388 # Copy plugin Makefiles
389 find plugins -type f -name Makefile | while read i ; \
390 do cp $$i tmp/vlc/$$i ; done
391 # Copy extra programs and documentation
392 cp -a extras/* tmp/vlc/extras
393 cp -a doc/* tmp/vlc/doc
394 find tmp/vlc/extras tmp/vlc/doc \
395 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
396 while read i ; do rm -Rf $$i ; done
398 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
399 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
401 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
402 ABOUT-NLS BUGS MODULES vlc.spec \
403 Makefile Makefile.*.in Makefile.dep Makefile.modules \
404 configure configure.in install-sh install-win32 macosx-dmg \
405 config.sub config.guess aclocal.m4 mkinstalldirs \
407 # Copy Debian control files
408 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
409 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
410 for file in control changelog rules ; do \
411 cp debian/$$file tmp/vlc/debian/ ; done
412 # Copy ipkg control files
413 for file in control rules patch ; do \
414 cp ipkg/$$file tmp/vlc/ipkg/ ; done
415 # Copy fonts and icons
416 for file in share/*vlc* share/*psf; do \
417 cp $$file tmp/vlc/share ; done
420 mv tmp/vlc tmp/$$F; (cd tmp ; \
421 cd $$F && $(MAKE) distclean && cd .. ; \
422 tar czf ../$$F.tar.gz $$F);
427 # XXX: this rule is probably only useful to you if you have exactly
428 # the same setup as me. Contact sam@zoy.org if you need to use it.
430 # Check that tmp isn't in the way
431 @if test -e tmp; then \
432 echo "Error: please remove ./tmp, it is in the way"; false; \
434 echo "OK."; mkdir tmp; \
436 # Create installation script
437 cp install-win32 tmp/nsi
438 # Copy relevant files
441 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
442 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
443 do cp $$file tmp/$${file}.txt ; \
444 unix2dos tmp/$${file}.txt ; done
446 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
447 # don't include these two
448 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
450 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
453 for file in default8x16.psf default8x9.psf ; \
454 do cp share/$$file tmp/share/ ; done
456 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
461 # Check that tmp isn't in the way
462 @if test -e tmp; then \
463 echo "Error: please remove ./tmp, it is in the way"; false; \
465 echo "OK."; mkdir tmp; \
469 mkdir -p tmp/vlc/share
470 # Copy relevant files
473 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
474 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
475 for file in default8x16.psf default8x9.psf ; \
476 do cp share/$$file tmp/vlc/share/ ; done
477 mkdir tmp/vlc/plugins
478 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
479 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
481 mv tmp/vlc tmp/vlc-${VERSION}
482 (cd tmp ; find vlc-${VERSION} | \
483 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
484 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
489 # Check that tmp isn't in the way
490 @if test -e tmp; then \
491 echo "Error: please remove ./tmp, it is in the way"; false; \
493 echo "OK."; mkdir tmp; \
496 # Copy relevant files
498 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
501 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
507 # Gtk/Gnome/* aliases and OS X application
509 gnome-vlc gvlc kvlc qvlc: vlc
510 rm -f $@ && ln -s vlc $@
514 ifneq (,$(findstring darwin,$(SYS)))
516 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
517 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
518 $(INSTALL) -d vlc.app/Contents/MacOS/share
519 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
520 $(INSTALL) vlc vlc.app/Contents/MacOS/
522 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
524 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
530 # Generic rules (see below)
532 src/misc/modules_builtin.h: Makefile.opts Makefile Makefile.config
533 @echo "make[$(MAKELEVEL)]: Creating \`$@'"
534 @rm -f $@ && cp $@.in $@
536 @for i in $(BUILTINS) ; do \
537 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
538 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
539 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
543 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
544 @echo " do \\" >> $@ ;
545 @echo " { \\" >> $@ ;
547 @for i in $(BUILTINS) ; do \
548 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
551 @echo " } while( 0 );" >> $@ ;
555 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
557 $(CPP_DEP): %.dpp: FORCE
558 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
560 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
561 $(C_OBJ): %.o: $(H_OBJ)
562 $(C_OBJ): %.o: .dep/%.d
564 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
566 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
567 $(CPP_OBJ): %.o: $(H_OBJ)
568 $(CPP_OBJ): %.o: .dep/%.dpp
569 $(CPP_OBJ): %.o: %.cpp
570 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
572 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
573 $(M_OBJ): %.o: $(H_OBJ)
574 $(M_OBJ): %.o: .dep/%.dm
576 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
578 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
579 ifneq (,(findstring mingw32,$(SYS)))
580 $(RESOURCE_OBJ): %.o: %.rc
581 $(WINDRES) -i $< -o $@
585 # Main application target
587 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
588 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
590 xres -o $@ ./share/vlc_beos.rsrc
594 # here are the rules for a dynamic link of libvlc:
595 #vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
596 # $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
599 # Main library target
601 lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
603 ar rc $@ $(LIBVLC_OBJ)
606 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
607 # $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
613 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
614 $(PLUGIN_OBJ): $(H_OBJ) FORCE
615 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
618 # Built-in modules target
620 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
621 $(BUILTIN_OBJ): $(H_OBJ) FORCE
622 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
625 # Mozilla plugin target
627 mozilla/libvlcplugin.so: FORCE
629 @cd mozilla && $(MAKE) builtins_LDFLAGS="$(builtins_LDFLAGS)"