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
70 PLUGINS_TARGETS := a52/a52 \
72 a52_system/a52_system \
82 chroma/chroma_i420_rgb \
83 chroma/chroma_i420_rgb_mmx \
84 chroma/chroma_i420_yuy2 \
85 chroma/chroma_i420_yuy2_mmx \
86 chroma/chroma_i422_yuy2 \
87 chroma/chroma_i422_yuy2_mmx \
88 chroma/chroma_i420_ymga \
89 chroma/chroma_i420_ymga_mmx \
102 filter/filter_clone \
104 filter/filter_deinterlace \
105 filter/filter_distort \
106 filter/filter_invert \
107 filter/filter_transform \
109 filter/filter_clone \
125 lpcm_adec/lpcm_adec \
130 memcpy/memcpymmxext \
132 memcpy/memcpyaltivec \
137 motion/motionmmxext \
139 motion/motionaltivec \
140 mpeg_system/mpeg_audio \
141 mpeg_system/mpeg_es \
142 mpeg_system/mpeg_ps \
143 mpeg_system/mpeg_ts \
144 mpeg_system/mpeg_ts_dvbpsi \
145 mpeg_adec/mpeg_adec \
146 mpeg_vdec/mpeg_vdec \
152 satellite/satellite \
170 INTERFACE := interface intf_eject
172 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
173 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
174 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
175 MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras
177 LIBVLC_OBJ := $(LIBVLC:%=src/%.o) \
178 $(INTERFACE:%=src/interface/%.o) \
179 $(PLAYLIST:%=src/playlist/%.o) \
180 $(INPUT:%=src/input/%.o) \
181 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
182 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
183 $(MISC:%=src/misc/%.o)
185 VLC_OBJ := $(VLC:%=src/%.o)
187 C_OBJ := $(VLC_OBJ) $(LIBVLC_OBJ)
192 ifeq ($(NEED_GETOPT),1)
193 LIBVLC_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
196 ifeq ($(NEED_SYMBOLS),1)
197 LIBVLC_OBJ += src/misc/symbols.o
201 CPP_OBJ := src/misc/beos_specific.o
204 ifneq (,$(findstring darwin,$(SYS)))
205 LIBVLC_OBJ += src/misc/darwin_specific.o
208 ifneq (,$(findstring mingw32,$(SYS)))
209 LIBVLC_OBJ += src/misc/win32_specific.o
210 RESOURCE_OBJ := share/vlc_win32_rc.o
213 LIBVLC_OBJ += $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ)
214 VLC_OBJ += $(RESOURCE_OBJ)
219 H_OBJ := src/misc/modules_builtin.h
222 # Other lists of files
224 C_DEP := $(C_OBJ:%.o=.dep/%.d)
225 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
228 # Translate plugin names
231 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
234 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
240 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
242 # All symbols must be exported
245 ###############################################################################
247 ###############################################################################
252 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po mozilla/libvlcplugin.so
255 @echo "**** No configuration found, please run ./configure"
258 # $(MAKE) $(MAKECMDGOALS)
263 @echo CFLAGS: $(CFLAGS)
264 @echo LDFLAGS: $(LDFLAGS)
265 @echo plugins_CFLAGS: $(plugins_CFLAGS)
266 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
267 @echo builtins_CFLAGS: $(builtins_CFLAGS)
268 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
269 @echo C_OBJ: $(C_OBJ)
270 @echo CPP_OBJ: $(CPP_OBJ)
271 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
272 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
277 clean: plugins-clean po-clean vlc-clean mozilla-clean
278 rm -f src/*/*.o extras/*/*.o
279 rm -f lib/*.so* lib/*.a
280 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
281 rm -Rf extras/MacOSX/build
284 -cd po && $(MAKE) clean
287 for dir in $(PLUGINS_DIR) ; do \
288 ( cd plugins/$${dir} \
289 && $(MAKE) -f ../../Makefile.modules clean ) ; done
290 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
293 rm -f $(C_OBJ) $(CPP_OBJ)
294 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
298 -cd mozilla && $(MAKE) clean
301 -cd po && $(MAKE) maintainer-clean
302 rm -f **/*.o **/*~ *.log
303 rm -f Makefile.opts Makefile.config
304 rm -f include/defs.h include/modules_builtin.h
305 rm -f src/misc/modules_builtin.h
306 rm -f config*status config*cache config*log conftest*
307 rm -f gmon.out core build-stamp
312 # Install/uninstall rules
314 install: vlc-install plugins-install po-install mozilla-install
316 uninstall: vlc-uninstall plugins-uninstall po-uninstall mozilla-uninstall
319 mkdir -p $(DESTDIR)$(bindir)
320 $(INSTALL) vlc $(DESTDIR)$(bindir)
322 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
324 mkdir -p $(DESTDIR)$(datadir)/vlc
325 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
326 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
327 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
330 rm -f $(DESTDIR)$(bindir)/vlc
332 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
334 rm -f $(DESTDIR)$(datadir)/vlc/*.psf
335 rm -f $(DESTDIR)$(datadir)/vlc/*.png
336 rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
339 mkdir -p $(DESTDIR)$(libdir)/vlc
341 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
345 rm -f $(DESTDIR)$(libdir)/vlc/*.so
349 -cd mozilla && $(MAKE) install
354 -cd mozilla && $(MAKE) uninstall
358 -cd po && $(MAKE) install
361 -cd po && $(MAKE) uninstall
364 # Package generation rules
367 # Check that tmp isn't in the way
368 @if test -e tmp; then \
369 echo "Error: please remove ./tmp, it is in the way"; false; \
371 echo "OK."; mkdir tmp; \
373 # Copy directory structure in tmp
374 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
375 do mkdir -p tmp/vlc/$$i ; \
378 find debian -mindepth 1 -maxdepth 1 -type d | \
379 while read i ; do rm -Rf tmp/vlc/$$i ; done
380 # Copy .c .h .in .cpp .m and .glade files
381 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
382 do cp $$i tmp/vlc/$$i ; done
383 # Grmbl... special case...
384 for i in API BUGS DESIGN TODO ; \
385 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
386 # Copy plugin Makefiles
387 find plugins -type f -name Makefile | while read i ; \
388 do cp $$i tmp/vlc/$$i ; done
389 # Copy extra programs and documentation
390 cp -a extras/* tmp/vlc/extras
391 cp -a doc/* tmp/vlc/doc
392 find tmp/vlc/extras tmp/vlc/doc \
393 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
394 while read i ; do rm -Rf $$i ; done
396 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
397 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
399 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
400 ABOUT-NLS BUGS MODULES vlc.spec \
401 Makefile Makefile.*.in Makefile.dep Makefile.modules \
402 configure configure.in install-sh install-win32 macosx-dmg \
403 config.sub config.guess aclocal.m4 mkinstalldirs \
405 # Copy Debian control files
406 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
407 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
408 for file in control changelog rules ; do \
409 cp debian/$$file tmp/vlc/debian/ ; done
410 # Copy ipkg control files
411 for file in control rules patch ; do \
412 cp ipkg/$$file tmp/vlc/ipkg/ ; done
413 # Copy fonts and icons
414 for file in share/*vlc* share/*psf; do \
415 cp $$file tmp/vlc/share ; done
418 mv tmp/vlc tmp/$$F; (cd tmp ; \
419 cd $$F && $(MAKE) distclean && cd .. ; \
420 tar czf ../$$F.tar.gz $$F);
425 # XXX: this rule is probably only useful to you if you have exactly
426 # the same setup as me. Contact sam@zoy.org if you need to use it.
428 # Check that tmp isn't in the way
429 @if test -e tmp; then \
430 echo "Error: please remove ./tmp, it is in the way"; false; \
432 echo "OK."; mkdir tmp; \
434 # Create installation script
435 cp install-win32 tmp/nsi
436 # Copy relevant files
439 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
440 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
441 do cp $$file tmp/$${file}.txt ; \
442 unix2dos tmp/$${file}.txt ; done
444 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
445 # don't include these two
446 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
448 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
451 for file in default8x16.psf default8x9.psf ; \
452 do cp share/$$file tmp/share/ ; done
454 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
459 # Check that tmp isn't in the way
460 @if test -e tmp; then \
461 echo "Error: please remove ./tmp, it is in the way"; false; \
463 echo "OK."; mkdir tmp; \
467 mkdir -p tmp/vlc/share
468 # Copy relevant files
471 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
472 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
473 for file in default8x16.psf default8x9.psf ; \
474 do cp share/$$file tmp/vlc/share/ ; done
475 mkdir tmp/vlc/plugins
476 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
477 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
479 mv tmp/vlc tmp/vlc-${VERSION}
480 (cd tmp ; find vlc-${VERSION} | \
481 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
482 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
487 # Check that tmp isn't in the way
488 @if test -e tmp; then \
489 echo "Error: please remove ./tmp, it is in the way"; false; \
491 echo "OK."; mkdir tmp; \
494 # Copy relevant files
496 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
499 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
505 # Gtk/Gnome/* aliases and OS X application
507 gnome-vlc gvlc kvlc qvlc: vlc
508 rm -f $@ && ln -s vlc $@
512 ifneq (,$(findstring darwin,$(SYS)))
514 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
515 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
516 $(INSTALL) -d vlc.app/Contents/MacOS/share
517 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
518 $(INSTALL) vlc vlc.app/Contents/MacOS/
520 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
522 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
528 # Generic rules (see below)
530 src/misc/modules_builtin.h: Makefile.opts Makefile
531 @echo "make[$(MAKELEVEL)]: Creating \`$@'"
532 @rm -f $@ && cp $@.in $@
534 @for i in $(BUILTINS) ; do \
535 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
536 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
537 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
541 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
542 @echo " do \\" >> $@ ;
543 @echo " { \\" >> $@ ;
545 @for i in $(BUILTINS) ; do \
546 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
549 @echo " } while( 0 );" >> $@ ;
553 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
555 $(CPP_DEP): %.dpp: FORCE
556 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
558 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
559 $(C_OBJ): %.o: $(H_OBJ)
560 $(C_OBJ): %.o: .dep/%.d
562 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
564 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
565 $(CPP_OBJ): %.o: $(H_OBJ)
566 $(CPP_OBJ): %.o: .dep/%.dpp
567 $(CPP_OBJ): %.o: %.cpp
568 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
570 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
571 $(M_OBJ): %.o: $(H_OBJ)
572 $(M_OBJ): %.o: .dep/%.dm
574 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
576 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
577 ifneq (,(findstring mingw32,$(SYS)))
578 $(RESOURCE_OBJ): %.o: %.rc
579 $(WINDRES) -i $< -o $@
583 # Main application target
585 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
586 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
588 xres -o $@ ./share/vlc_beos.rsrc
592 # here are the rules for a dynamic link of libvlc:
593 #vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
594 # $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
597 # Main library target
599 lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
601 ar rc $@ $(LIBVLC_OBJ)
604 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
605 # $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
611 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
612 $(PLUGIN_OBJ): $(H_OBJ) FORCE
613 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
616 # Built-in modules target
618 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
619 $(BUILTIN_OBJ): $(H_OBJ) FORCE
620 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
623 # Mozilla plugin target
625 mozilla/libvlcplugin.so: FORCE
627 @cd mozilla && $(MAKE) builtins_LDFLAGS="$(builtins_LDFLAGS)"