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
69 PLUGINS_TARGETS := a52/a52 \
71 a52_system/a52_system \
81 chroma/chroma_i420_rgb \
82 chroma/chroma_i420_rgb_mmx \
83 chroma/chroma_i420_yuy2 \
84 chroma/chroma_i420_yuy2_mmx \
85 chroma/chroma_i422_yuy2 \
86 chroma/chroma_i422_yuy2_mmx \
87 chroma/chroma_i420_ymga \
88 chroma/chroma_i420_ymga_mmx \
101 filter/filter_clone \
103 filter/filter_deinterlace \
104 filter/filter_distort \
105 filter/filter_invert \
106 filter/filter_transform \
108 filter/filter_clone \
124 lpcm_adec/lpcm_adec \
129 memcpy/memcpymmxext \
131 memcpy/memcpyaltivec \
136 motion/motionmmxext \
138 motion/motionaltivec \
139 mpeg_system/mpeg_audio \
140 mpeg_system/mpeg_es \
141 mpeg_system/mpeg_ps \
142 mpeg_system/mpeg_ts \
143 mpeg_system/mpeg_ts_dvbpsi \
144 mpeg_adec/mpeg_adec \
145 mpeg_vdec/mpeg_vdec \
151 satellite/satellite \
168 INTERFACE := interface intf_eject
170 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
171 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
172 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
173 MISC := mtime modules threads cpu configuration netutils iso_lang messages objects
175 LIBVLC_OBJ := $(LIBVLC:%=src/%.o) \
176 $(INTERFACE:%=src/interface/%.o) \
177 $(PLAYLIST:%=src/playlist/%.o) \
178 $(INPUT:%=src/input/%.o) \
179 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
180 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
181 $(MISC:%=src/misc/%.o)
183 VLC_OBJ := $(VLC:%=src/%.o)
185 C_OBJ := $(VLC_OBJ) $(LIBVLC_OBJ)
190 ifeq ($(NEED_GETOPT),1)
191 LIBVLC_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
194 ifeq ($(NEED_SYMBOLS),1)
195 LIBVLC_OBJ += src/misc/symbols.o
199 CPP_OBJ := src/misc/beos_specific.o
202 ifneq (,$(findstring darwin,$(SYS)))
203 LIBVLC_OBJ += src/misc/darwin_specific.o
206 ifneq (,$(findstring mingw32,$(SYS)))
207 LIBVLC_OBJ += src/misc/win32_specific.o
208 RESOURCE_OBJ := share/vlc_win32_rc.o
211 LIBVLC_OBJ += $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ)
212 VLC_OBJ += $(RESOURCE_OBJ)
217 H_OBJ := src/misc/modules_builtin.h
220 # Other lists of files
222 C_DEP := $(C_OBJ:%.o=.dep/%.d)
223 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
226 # Translate plugin names
229 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
232 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
238 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
240 # All symbols must be exported
243 ###############################################################################
245 ###############################################################################
250 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
253 @echo "**** No configuration found, please run ./configure"
256 # $(MAKE) $(MAKECMDGOALS)
261 @echo CFLAGS: $(CFLAGS)
262 @echo LDFLAGS: $(LDFLAGS)
263 @echo plugins_CFLAGS: $(plugins_CFLAGS)
264 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
265 @echo builtins_CFLAGS: $(builtins_CFLAGS)
266 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
267 @echo C_OBJ: $(C_OBJ)
268 @echo CPP_OBJ: $(CPP_OBJ)
269 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
270 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
275 clean: plugins-clean po-clean vlc-clean
276 rm -f src/*/*.o extras/*/*.o
277 rm -f lib/*.so* lib/*.a
278 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
279 rm -Rf extras/MacOSX/build
282 -cd po && $(MAKE) clean
285 for dir in $(PLUGINS_DIR) ; do \
286 ( cd plugins/$${dir} \
287 && $(MAKE) -f ../../Makefile.modules clean ) ; done
288 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
291 rm -f $(C_OBJ) $(CPP_OBJ)
292 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
296 -cd po && $(MAKE) maintainer-clean
297 rm -f **/*.o **/*~ *.log
298 rm -f Makefile.opts Makefile.config
299 rm -f include/defs.h include/modules_builtin.h
300 rm -f src/misc/modules_builtin.h
301 rm -f config*status config*cache config*log conftest*
302 rm -f gmon.out core build-stamp
307 # Install/uninstall rules
309 install: vlc-install plugins-install po-install
311 uninstall: vlc-uninstall plugins-uninstall po-uninstall
314 mkdir -p $(DESTDIR)$(bindir)
315 $(INSTALL) vlc $(DESTDIR)$(bindir)
317 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
319 mkdir -p $(DESTDIR)$(datadir)/vlc
320 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
321 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
322 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
325 rm -f $(DESTDIR)$(bindir)/vlc
327 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
329 rm -f $(DESTDIR)$(datadir)/vlc/*.psf
330 rm -f $(DESTDIR)$(datadir)/vlc/*.png
331 rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
334 mkdir -p $(DESTDIR)$(libdir)/vlc
336 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
340 rm -f $(DESTDIR)$(libdir)/vlc/*.so
343 -cd po && $(MAKE) install
346 -cd po && $(MAKE) uninstall
349 # Package generation rules
352 # Check that tmp isn't in the way
353 @if test -e tmp; then \
354 echo "Error: please remove ./tmp, it is in the way"; false; \
356 echo "OK."; mkdir tmp; \
358 # Copy directory structure in tmp
359 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
360 do mkdir -p tmp/vlc/$$i ; \
363 find debian -mindepth 1 -maxdepth 1 -type d | \
364 while read i ; do rm -Rf tmp/vlc/$$i ; done
365 # Copy .c .h .in .cpp .m and .glade files
366 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
367 do cp $$i tmp/vlc/$$i ; done
368 # Grmbl... special case...
369 for i in API BUGS DESIGN TODO ; \
370 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
371 # Copy plugin Makefiles
372 find plugins -type f -name Makefile | while read i ; \
373 do cp $$i tmp/vlc/$$i ; done
374 # Copy extra programs and documentation
375 cp -a extras/* tmp/vlc/extras
376 cp -a doc/* tmp/vlc/doc
377 find tmp/vlc/extras tmp/vlc/doc \
378 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
379 while read i ; do rm -Rf $$i ; done
381 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
382 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
384 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
385 ABOUT-NLS BUGS MODULES vlc.spec \
386 Makefile Makefile.*.in Makefile.dep Makefile.modules \
387 configure configure.in install-sh install-win32 macosx-dmg \
388 config.sub config.guess aclocal.m4 mkinstalldirs \
390 # Copy Debian control files
391 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
392 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
393 for file in control changelog rules ; do \
394 cp debian/$$file tmp/vlc/debian/ ; done
395 # Copy ipkg control files
396 for file in control rules patch ; do \
397 cp ipkg/$$file tmp/vlc/ipkg/ ; done
398 # Copy fonts and icons
399 for file in share/*vlc* share/*psf; do \
400 cp $$file tmp/vlc/share ; done
403 mv tmp/vlc tmp/$$F; (cd tmp ; \
404 cd $$F && $(MAKE) distclean && cd .. ; \
405 tar czf ../$$F.tar.gz $$F);
410 # XXX: this rule is probably only useful to you if you have exactly
411 # the same setup as me. Contact sam@zoy.org if you need to use it.
413 # Check that tmp isn't in the way
414 @if test -e tmp; then \
415 echo "Error: please remove ./tmp, it is in the way"; false; \
417 echo "OK."; mkdir tmp; \
419 # Create installation script
420 cp install-win32 tmp/nsi
421 # Copy relevant files
424 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
425 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
426 do cp $$file tmp/$${file}.txt ; \
427 unix2dos tmp/$${file}.txt ; done
429 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
430 # don't include these two
431 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
433 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
436 for file in default8x16.psf default8x9.psf ; \
437 do cp share/$$file tmp/share/ ; done
439 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
444 # Check that tmp isn't in the way
445 @if test -e tmp; then \
446 echo "Error: please remove ./tmp, it is in the way"; false; \
448 echo "OK."; mkdir tmp; \
452 mkdir -p tmp/vlc/share
453 # Copy relevant files
456 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
457 for file in default8x16.psf default8x9.psf ; \
458 do cp share/$$file tmp/vlc/share/ ; done
459 mkdir tmp/vlc/plugins
460 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
461 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
463 mv tmp/vlc tmp/vlc-${VERSION}
464 (cd tmp ; find vlc-${VERSION} | \
465 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
466 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
471 # Check that tmp isn't in the way
472 @if test -e tmp; then \
473 echo "Error: please remove ./tmp, it is in the way"; false; \
475 echo "OK."; mkdir tmp; \
478 # Copy relevant files
480 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
483 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
489 # Gtk/Gnome/* aliases and OS X application
491 gnome-vlc gvlc kvlc qvlc: vlc
492 rm -f $@ && ln -s vlc $@
496 ifneq (,$(findstring darwin,$(SYS)))
498 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
499 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
500 $(INSTALL) -d vlc.app/Contents/MacOS/share
501 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
502 $(INSTALL) vlc vlc.app/Contents/MacOS/
504 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
506 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
512 # Generic rules (see below)
514 src/misc/modules_builtin.h: Makefile.opts Makefile
515 @echo "make[$(MAKELEVEL)]: Creating \`$@'"
516 @rm -f $@ && cp $@.in $@
518 @for i in $(BUILTINS) ; do \
519 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
520 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
521 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
525 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
526 @echo " do \\" >> $@ ;
527 @echo " { \\" >> $@ ;
529 @for i in $(BUILTINS) ; do \
530 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
533 @echo " } while( 0 );" >> $@ ;
537 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
539 $(CPP_DEP): %.dpp: FORCE
540 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
542 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
543 $(C_OBJ): %.o: $(H_OBJ)
544 $(C_OBJ): %.o: .dep/%.d
546 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
548 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
549 $(CPP_OBJ): %.o: $(H_OBJ)
550 $(CPP_OBJ): %.o: .dep/%.dpp
551 $(CPP_OBJ): %.o: %.cpp
552 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
554 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
555 $(M_OBJ): %.o: $(H_OBJ)
556 $(M_OBJ): %.o: .dep/%.dm
558 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
560 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
561 ifneq (,(findstring mingw32,$(SYS)))
562 $(RESOURCE_OBJ): %.o: %.rc
563 $(WINDRES) -i $< -o $@
567 # Main application target
569 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
570 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
572 xres -o $@ ./share/vlc_beos.rsrc
576 # here are the rules for a dynamic link of libvlc:
577 #vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
578 # $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
581 # Main library target
583 lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
585 ar rc $@ $(LIBVLC_OBJ)
588 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
589 # $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
595 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
596 $(PLUGIN_OBJ): $(H_OBJ) FORCE
597 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
600 # Built-in modules target
602 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
603 $(BUILTIN_OBJ): $(H_OBJ) FORCE
604 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)