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
73 PLUGINS_TARGETS := a52/a52 \
75 a52_system/a52_system \
85 chroma/chroma_i420_rgb \
86 chroma/chroma_i420_rgb_mmx \
87 chroma/chroma_i420_yuy2 \
88 chroma/chroma_i420_yuy2_mmx \
89 chroma/chroma_i422_yuy2 \
90 chroma/chroma_i422_yuy2_mmx \
91 chroma/chroma_i420_ymga \
92 chroma/chroma_i420_ymga_mmx \
107 filter/filter_clone \
109 filter/filter_deinterlace \
110 filter/filter_distort \
111 filter/filter_invert \
112 filter/filter_transform \
114 filter/filter_clone \
130 lpcm_adec/lpcm_adec \
135 memcpy/memcpymmxext \
137 memcpy/memcpyaltivec \
142 motion/motionmmxext \
144 motion/motionaltivec \
145 mpeg_system/mpeg_audio \
146 mpeg_system/mpeg_es \
147 mpeg_system/mpeg_ps \
148 mpeg_system/mpeg_ts \
149 mpeg_system/mpeg_ts_dvbpsi \
150 mpeg_adec/mpeg_adec \
151 mpeg_vdec/mpeg_vdec \
158 satellite/satellite \
176 INTERFACE := interface intf_eject
178 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
179 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
180 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
181 MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras
183 LIBVLC_OBJ := $(LIBVLC:%=src/%.o) \
184 $(INTERFACE:%=src/interface/%.o) \
185 $(PLAYLIST:%=src/playlist/%.o) \
186 $(INPUT:%=src/input/%.o) \
187 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
188 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
189 $(MISC:%=src/misc/%.o)
191 VLC_OBJ := $(VLC:%=src/%.o)
193 C_OBJ := $(VLC_OBJ) $(LIBVLC_OBJ)
198 ifeq ($(NEED_GETOPT),1)
199 LIBVLC_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
202 ifeq ($(NEED_SYMBOLS),1)
203 LIBVLC_OBJ += src/misc/symbols.o
207 CPP_OBJ := src/misc/beos_specific.o
210 ifneq (,$(findstring darwin,$(SYS)))
211 LIBVLC_OBJ += src/misc/darwin_specific.o
214 ifneq (,$(findstring mingw32,$(SYS)))
215 LIBVLC_OBJ += src/misc/win32_specific.o
216 RESOURCE_OBJ := share/vlc_win32_rc.o
219 LIBVLC_OBJ += $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ)
220 VLC_OBJ += $(RESOURCE_OBJ)
225 H_OBJ := src/misc/modules_builtin.h
228 # Other lists of files
230 C_DEP := $(C_OBJ:%.o=.dep/%.d)
231 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
234 # Translate plugin names
237 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
240 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
246 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
248 # All symbols must be exported
251 ###############################################################################
253 ###############################################################################
258 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po mozilla/libvlcplugin.so
261 @echo "**** No configuration found, please run ./configure"
264 # $(MAKE) $(MAKECMDGOALS)
269 @echo CFLAGS: $(CFLAGS)
270 @echo LDFLAGS: $(LDFLAGS)
271 @echo plugins_CFLAGS: $(plugins_CFLAGS)
272 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
273 @echo builtins_CFLAGS: $(builtins_CFLAGS)
274 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
275 @echo C_OBJ: $(C_OBJ)
276 @echo CPP_OBJ: $(CPP_OBJ)
277 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
278 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
283 clean: plugins-clean po-clean vlc-clean mozilla-clean
284 rm -f src/*/*.o extras/*/*.o
285 rm -f lib/*.so* lib/*.a
286 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
287 rm -Rf extras/MacOSX/build
290 -cd po && $(MAKE) clean
293 for dir in $(PLUGINS_DIR) ; do \
294 ( cd plugins/$${dir} \
295 && $(MAKE) -f ../../Makefile.modules clean ) ; done
296 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
299 rm -f $(C_OBJ) $(CPP_OBJ)
300 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
304 -cd mozilla && $(MAKE) clean
307 -cd po && $(MAKE) maintainer-clean
308 rm -f **/*.o **/*~ *.log
309 rm -f Makefile.opts Makefile.config
310 rm -f include/defs.h include/modules_builtin.h
311 rm -f src/misc/modules_builtin.h
312 rm -f config*status config*cache config*log conftest*
313 rm -f gmon.out core build-stamp
318 # Install/uninstall rules
320 install: vlc-install plugins-install libvlc-install po-install mozilla-install
322 uninstall: vlc-uninstall plugins-uninstall libvlc-install po-uninstall mozilla-uninstall
325 mkdir -p $(DESTDIR)$(bindir)
326 $(INSTALL) vlc $(DESTDIR)$(bindir)
328 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
330 mkdir -p $(DESTDIR)$(datadir)/vlc
331 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
332 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
333 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
336 rm -f $(DESTDIR)$(bindir)/vlc
338 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
340 rm -f $(DESTDIR)$(datadir)/vlc/*.psf
341 rm -f $(DESTDIR)$(datadir)/vlc/*.png
342 rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
345 mkdir -p $(DESTDIR)$(libdir)/vlc
347 $(INSTALL) $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
351 rm -f $(DESTDIR)$(libdir)/vlc/*.so
354 mkdir -p $(DESTDIR)$(bindir)
355 $(INSTALL) vlc-config $(DESTDIR)$(bindir)
356 mkdir -p $(DESTDIR)$(includedir)/vlc
357 $(INSTALL) -m 644 include/vlc/*.h $(DESTDIR)$(includedir)/vlc
358 mkdir -p $(DESTDIR)$(libdir)
359 $(INSTALL) -m 644 lib/libvlc.a $(DESTDIR)$(libdir)
362 rm -f $(DESTDIR)$(bindir)/vlc-config
363 rm -Rf $(DESTDIR)$(includedir)/vlc
364 rm -f $(DESTDIR)$(libdir)/libvlc.a
368 -cd mozilla && $(MAKE) install
373 -cd mozilla && $(MAKE) uninstall
377 -cd po && $(MAKE) install
380 -cd po && $(MAKE) uninstall
383 # Package generation rules
386 # Check that tmp isn't in the way
387 @if test -e tmp; then \
388 echo "Error: please remove ./tmp, it is in the way"; false; \
390 echo "OK."; mkdir tmp; \
392 # Copy directory structure in tmp
393 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
394 do mkdir -p tmp/vlc/$$i ; \
397 find debian -mindepth 1 -maxdepth 1 -type d | \
398 while read i ; do rm -Rf tmp/vlc/$$i ; done
399 # Copy .c .h .in .cpp .m and .glade files
400 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
401 do cp $$i tmp/vlc/$$i ; done
402 # Grmbl... special case...
403 for i in API BUGS DESIGN TODO ; \
404 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
405 # Copy plugin Makefiles
406 find plugins -type f -name Makefile | while read i ; \
407 do cp $$i tmp/vlc/$$i ; done
408 # Copy extra programs and documentation
409 cp -a extras/* tmp/vlc/extras
410 cp -a doc/* tmp/vlc/doc
411 find tmp/vlc/extras tmp/vlc/doc \
412 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
413 while read i ; do rm -Rf $$i ; done
415 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
416 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
418 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
419 ABOUT-NLS BUGS MODULES vlc.spec \
420 Makefile Makefile.*.in Makefile.dep Makefile.modules \
421 configure configure.in install-sh install-win32 macosx-dmg \
422 config.sub config.guess aclocal.m4 mkinstalldirs \
424 # Copy Debian control files
425 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
426 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
427 for file in control changelog rules ; do \
428 cp debian/$$file tmp/vlc/debian/ ; done
429 # Copy ipkg control files
430 for file in control rules patch ; do \
431 cp ipkg/$$file tmp/vlc/ipkg/ ; done
432 # Copy fonts and icons
433 for file in share/*vlc* share/*psf; do \
434 cp $$file tmp/vlc/share ; done
437 mv tmp/vlc tmp/$$F; (cd tmp ; \
438 cd $$F && $(MAKE) distclean && cd .. ; \
439 tar czf ../$$F.tar.gz $$F);
444 # XXX: this rule is probably only useful to you if you have exactly
445 # the same setup as me. Contact sam@zoy.org if you need to use it.
447 # Check that tmp isn't in the way
448 @if test -e tmp; then \
449 echo "Error: please remove ./tmp, it is in the way"; false; \
451 echo "OK."; mkdir tmp; \
453 # Create installation script
454 cp install-win32 tmp/nsi
455 # Copy relevant files
458 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
459 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
460 do cp $$file tmp/$${file}.txt ; \
461 unix2dos tmp/$${file}.txt ; done
463 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
464 # don't include these two
465 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
467 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
470 for file in default8x16.psf default8x9.psf ; \
471 do cp share/$$file tmp/share/ ; done
473 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
478 # Check that tmp isn't in the way
479 @if test -e tmp; then \
480 echo "Error: please remove ./tmp, it is in the way"; false; \
482 echo "OK."; mkdir tmp; \
486 mkdir -p tmp/vlc/share
487 # Copy relevant files
490 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
491 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
492 for file in default8x16.psf default8x9.psf ; \
493 do cp share/$$file tmp/vlc/share/ ; done
494 mkdir tmp/vlc/plugins
495 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
496 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
498 mv tmp/vlc tmp/vlc-${VERSION}
499 (cd tmp ; find vlc-${VERSION} | \
500 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
501 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
506 # Check that tmp isn't in the way
507 @if test -e tmp; then \
508 echo "Error: please remove ./tmp, it is in the way"; false; \
510 echo "OK."; mkdir tmp; \
513 # Copy relevant files
515 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
518 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
524 # Gtk/Gnome/* aliases and OS X application
526 gnome-vlc gvlc kvlc qvlc: vlc
527 rm -f $@ && ln -s vlc $@
531 ifneq (,$(findstring darwin,$(SYS)))
533 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
534 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
535 $(INSTALL) -d vlc.app/Contents/MacOS/share
536 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
537 $(INSTALL) vlc vlc.app/Contents/MacOS/
539 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
541 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
547 # Generic rules (see below)
549 src/misc/modules_builtin.h: Makefile.opts Makefile Makefile.config
550 @echo "make[$(MAKELEVEL)]: Creating \`$@'"
551 @rm -f $@ && cp $@.in $@
553 @for i in $(BUILTINS) ; do \
554 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
555 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
556 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
560 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
561 @echo " do \\" >> $@ ;
562 @echo " { \\" >> $@ ;
564 @for i in $(BUILTINS) ; do \
565 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
568 @echo " } while( 0 );" >> $@ ;
572 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
574 $(CPP_DEP): %.dpp: FORCE
575 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
577 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
578 $(C_OBJ): %.o: $(H_OBJ)
579 $(C_OBJ): %.o: .dep/%.d
581 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
583 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
584 $(CPP_OBJ): %.o: $(H_OBJ)
585 $(CPP_OBJ): %.o: .dep/%.dpp
586 $(CPP_OBJ): %.o: %.cpp
587 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
589 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
590 $(M_OBJ): %.o: $(H_OBJ)
591 $(M_OBJ): %.o: .dep/%.dm
593 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
595 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
596 ifneq (,(findstring mingw32,$(SYS)))
597 $(RESOURCE_OBJ): %.o: %.rc
598 $(WINDRES) -i $< -o $@
602 # Main application target
604 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
605 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
607 xres -o $@ ./share/vlc_beos.rsrc
611 # here are the rules for a dynamic link of libvlc:
612 #vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
613 # $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
616 # Main library target
618 lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ) $(BUILTIN_OBJ)
620 ar rc $@ $(LIBVLC_OBJ)
622 rm -Rf lib/tmp && mkdir -p lib/tmp
623 cd lib/tmp && for i in $(BUILTINS) ; do ar x ../../plugins/$$i.a ; done
629 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
630 # $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
636 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
637 $(PLUGIN_OBJ): $(H_OBJ) FORCE
638 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
641 # Built-in modules target
643 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
644 $(BUILTIN_OBJ): $(H_OBJ) FORCE
645 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
648 # Mozilla plugin target
650 mozilla/libvlcplugin.so: FORCE
652 @cd mozilla && $(MAKE) builtins_LDFLAGS="$(builtins_LDFLAGS)"