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
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
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
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 po && $(MAKE) maintainer-clean
299 rm -f **/*.o **/*~ *.log
300 rm -f Makefile.opts Makefile.config
301 rm -f include/defs.h include/modules_builtin.h
302 rm -f src/misc/modules_builtin.h
303 rm -f config*status config*cache config*log conftest*
304 rm -f gmon.out core build-stamp
309 # Install/uninstall rules
311 install: vlc-install plugins-install po-install
313 uninstall: vlc-uninstall plugins-uninstall po-uninstall
316 mkdir -p $(DESTDIR)$(bindir)
317 $(INSTALL) vlc $(DESTDIR)$(bindir)
319 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
321 mkdir -p $(DESTDIR)$(datadir)/vlc
322 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
323 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
324 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
327 rm -f $(DESTDIR)$(bindir)/vlc
329 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
331 rm -f $(DESTDIR)$(datadir)/vlc/*.psf
332 rm -f $(DESTDIR)$(datadir)/vlc/*.png
333 rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
336 mkdir -p $(DESTDIR)$(libdir)/vlc
338 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
342 rm -f $(DESTDIR)$(libdir)/vlc/*.so
345 -cd po && $(MAKE) install
348 -cd po && $(MAKE) uninstall
351 # Package generation rules
354 # Check that tmp isn't in the way
355 @if test -e tmp; then \
356 echo "Error: please remove ./tmp, it is in the way"; false; \
358 echo "OK."; mkdir tmp; \
360 # Copy directory structure in tmp
361 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
362 do mkdir -p tmp/vlc/$$i ; \
365 find debian -mindepth 1 -maxdepth 1 -type d | \
366 while read i ; do rm -Rf tmp/vlc/$$i ; done
367 # Copy .c .h .in .cpp .m and .glade files
368 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
369 do cp $$i tmp/vlc/$$i ; done
370 # Grmbl... special case...
371 for i in API BUGS DESIGN TODO ; \
372 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
373 # Copy plugin Makefiles
374 find plugins -type f -name Makefile | while read i ; \
375 do cp $$i tmp/vlc/$$i ; done
376 # Copy extra programs and documentation
377 cp -a extras/* tmp/vlc/extras
378 cp -a doc/* tmp/vlc/doc
379 find tmp/vlc/extras tmp/vlc/doc \
380 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
381 while read i ; do rm -Rf $$i ; done
383 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
384 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
386 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
387 ABOUT-NLS BUGS MODULES vlc.spec \
388 Makefile Makefile.*.in Makefile.dep Makefile.modules \
389 configure configure.in install-sh install-win32 macosx-dmg \
390 config.sub config.guess aclocal.m4 mkinstalldirs \
392 # Copy Debian control files
393 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
394 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
395 for file in control changelog rules ; do \
396 cp debian/$$file tmp/vlc/debian/ ; done
397 # Copy ipkg control files
398 for file in control rules patch ; do \
399 cp ipkg/$$file tmp/vlc/ipkg/ ; done
400 # Copy fonts and icons
401 for file in share/*vlc* share/*psf; do \
402 cp $$file tmp/vlc/share ; done
405 mv tmp/vlc tmp/$$F; (cd tmp ; \
406 cd $$F && $(MAKE) distclean && cd .. ; \
407 tar czf ../$$F.tar.gz $$F);
412 # XXX: this rule is probably only useful to you if you have exactly
413 # the same setup as me. Contact sam@zoy.org if you need to use it.
415 # Check that tmp isn't in the way
416 @if test -e tmp; then \
417 echo "Error: please remove ./tmp, it is in the way"; false; \
419 echo "OK."; mkdir tmp; \
421 # Create installation script
422 cp install-win32 tmp/nsi
423 # Copy relevant files
426 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
427 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
428 do cp $$file tmp/$${file}.txt ; \
429 unix2dos tmp/$${file}.txt ; done
431 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
432 # don't include these two
433 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
435 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
438 for file in default8x16.psf default8x9.psf ; \
439 do cp share/$$file tmp/share/ ; done
441 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
446 # Check that tmp isn't in the way
447 @if test -e tmp; then \
448 echo "Error: please remove ./tmp, it is in the way"; false; \
450 echo "OK."; mkdir tmp; \
454 mkdir -p tmp/vlc/share
455 # Copy relevant files
458 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
459 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
460 for file in default8x16.psf default8x9.psf ; \
461 do cp share/$$file tmp/vlc/share/ ; done
462 mkdir tmp/vlc/plugins
463 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
464 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
466 mv tmp/vlc tmp/vlc-${VERSION}
467 (cd tmp ; find vlc-${VERSION} | \
468 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
469 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
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; \
481 # Copy relevant files
483 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
486 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
492 # Gtk/Gnome/* aliases and OS X application
494 gnome-vlc gvlc kvlc qvlc: vlc
495 rm -f $@ && ln -s vlc $@
499 ifneq (,$(findstring darwin,$(SYS)))
501 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
502 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
503 $(INSTALL) -d vlc.app/Contents/MacOS/share
504 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
505 $(INSTALL) vlc vlc.app/Contents/MacOS/
507 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
509 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
515 # Generic rules (see below)
517 src/misc/modules_builtin.h: Makefile.opts Makefile
518 @echo "make[$(MAKELEVEL)]: Creating \`$@'"
519 @rm -f $@ && cp $@.in $@
521 @for i in $(BUILTINS) ; do \
522 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
523 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
524 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
528 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
529 @echo " do \\" >> $@ ;
530 @echo " { \\" >> $@ ;
532 @for i in $(BUILTINS) ; do \
533 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
536 @echo " } while( 0 );" >> $@ ;
540 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
542 $(CPP_DEP): %.dpp: FORCE
543 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
545 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
546 $(C_OBJ): %.o: $(H_OBJ)
547 $(C_OBJ): %.o: .dep/%.d
549 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
551 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
552 $(CPP_OBJ): %.o: $(H_OBJ)
553 $(CPP_OBJ): %.o: .dep/%.dpp
554 $(CPP_OBJ): %.o: %.cpp
555 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
557 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
558 $(M_OBJ): %.o: $(H_OBJ)
559 $(M_OBJ): %.o: .dep/%.dm
561 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
563 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
564 ifneq (,(findstring mingw32,$(SYS)))
565 $(RESOURCE_OBJ): %.o: %.rc
566 $(WINDRES) -i $< -o $@
570 # Main application target
572 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
573 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
575 xres -o $@ ./share/vlc_beos.rsrc
579 # here are the rules for a dynamic link of libvlc:
580 #vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
581 # $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
584 # Main library target
586 lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
588 ar rc $@ $(LIBVLC_OBJ)
591 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
592 # $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
598 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
599 $(PLUGIN_OBJ): $(H_OBJ) FORCE
600 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
603 # Built-in modules target
605 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
606 $(BUILTIN_OBJ): $(H_OBJ) FORCE
607 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)