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
68 PLUGINS_TARGETS := a52/a52 \
79 chroma/chroma_i420_rgb \
80 chroma/chroma_i420_rgb_mmx \
81 chroma/chroma_i420_yuy2 \
82 chroma/chroma_i420_yuy2_mmx \
83 chroma/chroma_i422_yuy2 \
84 chroma/chroma_i422_yuy2_mmx \
85 chroma/chroma_i420_ymga \
86 chroma/chroma_i420_ymga_mmx \
99 filter/filter_deinterlace \
100 filter/filter_transform \
101 filter/filter_invert \
102 filter/filter_distort \
104 filter/filter_clone \
121 lpcm_adec/lpcm_adec \
126 memcpy/memcpymmxext \
128 memcpy/memcpyaltivec \
133 motion/motionmmxext \
135 motion/motionaltivec \
136 mpeg_system/mpeg_audio \
137 mpeg_system/mpeg_es \
138 mpeg_system/mpeg_ps \
139 mpeg_system/mpeg_ts \
140 mpeg_system/mpeg_ts_dvbpsi \
141 mpeg_adec/mpeg_adec \
142 mpeg_vdec/mpeg_vdec \
148 satellite/satellite \
163 INTERFACE := main interface intf_msg intf_playlist intf_eject
164 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
165 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
166 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
167 MISC := mtime modules configuration netutils iso_lang
169 C_OBJ := $(INTERFACE:%=src/interface/%.o) \
170 $(INPUT:%=src/input/%.o) \
171 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
172 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
173 $(MISC:%=src/misc/%.o)
178 ifeq ($(NEED_GETOPT),1)
179 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
182 ifeq ($(NEED_SYMBOLS),1)
183 C_OBJ += src/misc/symbols.o
187 CPP_OBJ := src/misc/beos_specific.o
190 ifneq (,$(findstring darwin,$(SYS)))
191 C_OBJ += src/misc/darwin_specific.o
194 ifneq (,$(findstring mingw32,$(SYS)))
195 C_OBJ += src/misc/win32_specific.o
196 RESOURCE_OBJ := share/vlc_win32_rc.o
199 VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ)
204 H_OBJ := src/misc/modules_builtin.h
207 # Other lists of files
209 C_DEP := $(C_OBJ:%.o=.dep/%.d)
210 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
213 # Translate plugin names
216 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
219 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
225 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
227 # All symbols must be exported
230 ###############################################################################
232 ###############################################################################
237 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
240 @echo "**** No configuration found, please run ./configure"
243 # $(MAKE) $(MAKECMDGOALS)
248 @echo CFLAGS: $(CFLAGS)
249 @echo LDFLAGS: $(LDFLAGS)
250 @echo plugins_CFLAGS: $(plugins_CFLAGS)
251 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
252 @echo builtins_CFLAGS: $(builtins_CFLAGS)
253 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
254 @echo C_OBJ: $(C_OBJ)
255 @echo CPP_OBJ: $(CPP_OBJ)
256 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
257 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
262 clean: plugins-clean po-clean vlc-clean
263 rm -f src/*/*.o extras/*/*.o
264 rm -f lib/*.so* lib/*.a
265 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
266 rm -rf extras/MacOSX/build
269 -cd po && $(MAKE) clean
272 for dir in $(PLUGINS_DIR) ; do \
273 ( cd plugins/$${dir} \
274 && $(MAKE) -f ../../Makefile.modules clean ) ; done
275 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
278 rm -f $(C_OBJ) $(CPP_OBJ)
279 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
283 -cd po && $(MAKE) maintainer-clean
284 rm -f **/*.o **/*~ *.log
285 rm -f Makefile.opts Makefile.config
286 rm -f include/defs.h include/modules_builtin.h
287 rm -f src/misc/modules_builtin.h
288 rm -f config*status config*cache config*log conftest*
289 rm -f gmon.out core build-stamp
294 # Install/uninstall rules
296 install: vlc-install plugins-install po-install
298 uninstall: vlc-uninstall plugins-uninstall po-uninstall
301 mkdir -p $(DESTDIR)$(bindir)
302 $(INSTALL) vlc $(DESTDIR)$(bindir)
304 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
306 mkdir -p $(DESTDIR)$(datadir)/videolan
307 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
308 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
309 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
312 rm -f $(DESTDIR)$(bindir)/vlc
314 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
316 rm -f $(DESTDIR)$(datadir)/videolan/*.psf
317 rm -f $(DESTDIR)$(datadir)/videolan/*.png
318 rm -f $(DESTDIR)$(datadir)/videolan/*.xpm
321 mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
323 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/videolan/vlc
327 rm -f $(DESTDIR)$(libdir)/videolan/vlc/*.so
330 -cd po && $(MAKE) install
333 -cd po && $(MAKE) uninstall
336 # Package generation rules
339 # Check that tmp isn't in the way
340 @if test -e tmp; then \
341 echo "Error: please remove ./tmp, it is in the way"; false; \
343 echo "OK."; mkdir tmp; \
345 # Copy directory structure in tmp
346 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
347 do mkdir -p tmp/vlc/$$i ; \
350 find debian -mindepth 1 -maxdepth 1 -type d | \
351 while read i ; do rm -Rf tmp/vlc/$$i ; done
352 # Copy .c .h .in .cpp .m and .glade files
353 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
354 do cp $$i tmp/vlc/$$i ; done
355 # Grmbl... special case...
356 for i in API BUGS DESIGN TODO ; \
357 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
358 # Copy plugin Makefiles
359 find plugins -type f -name Makefile | while read i ; \
360 do cp $$i tmp/vlc/$$i ; done
361 # Copy extra programs and documentation
362 cp -a extras/* tmp/vlc/extras
363 cp -a doc/* tmp/vlc/doc
364 find tmp/vlc/extras tmp/vlc/doc \
365 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
366 while read i ; do rm -Rf $$i ; done
368 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
369 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
371 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
372 ABOUT-NLS BUGS plugins/LIST vlc.spec \
373 Makefile Makefile.*.in Makefile.dep Makefile.modules \
374 configure configure.in install-sh install-win32 macosx-dmg \
375 config.sub config.guess aclocal.m4 mkinstalldirs \
377 # Copy Debian control files
378 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
379 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
380 for file in control changelog rules ; do \
381 cp debian/$$file tmp/vlc/debian/ ; done
382 # Copy ipkg control files
383 for file in control rules patch ; do \
384 cp ipkg/$$file tmp/vlc/ipkg/ ; done
385 # Copy fonts and icons
386 for file in share/*vlc* share/*psf; do \
387 cp $$file tmp/vlc/share ; done
390 mv tmp/vlc tmp/$$F; (cd tmp ; tar czf ../$$F.tar.gz $$F); \
395 # XXX: this rule is probably only useful to you if you have exactly
396 # the same setup as me. Contact sam@zoy.org if you need to use it.
398 # Check that tmp isn't in the way
399 @if test -e tmp; then \
400 echo "Error: please remove ./tmp, it is in the way"; false; \
402 echo "OK."; mkdir tmp; \
404 # Create installation script
405 cp install-win32 tmp/nsi
406 # Copy relevant files
409 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
410 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
411 do cp $$file tmp/$${file}.txt ; \
412 unix2dos tmp/$${file}.txt ; done
414 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
415 # don't include these two
416 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
418 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
421 for file in default8x16.psf default8x9.psf ; \
422 do cp share/$$file tmp/share/ ; done
424 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
429 # Check that tmp isn't in the way
430 @if test -e tmp; then \
431 echo "Error: please remove ./tmp, it is in the way"; false; \
433 echo "OK."; mkdir tmp; \
437 mkdir -p tmp/vlc/share
438 # Copy relevant files
441 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
442 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
443 for file in default8x16.psf default8x9.psf ; \
444 do cp share/$$file tmp/vlc/share/ ; done
445 mkdir tmp/vlc/plugins
446 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
447 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
449 mv tmp/vlc tmp/vlc-${VERSION}
450 (cd tmp ; find vlc-${VERSION} | \
451 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
452 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
457 # Check that tmp isn't in the way
458 @if test -e tmp; then \
459 echo "Error: please remove ./tmp, it is in the way"; false; \
461 echo "OK."; mkdir tmp; \
464 # Copy relevant files
466 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
469 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
475 # Gtk/Gnome/* aliases and OS X application
477 gnome-vlc gvlc kvlc qvlc: vlc
478 rm -f $@ && ln -s vlc $@
482 ifneq (,$(findstring darwin,$(SYS)))
484 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
485 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
486 $(INSTALL) -d vlc.app/Contents/MacOS/share
487 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
488 $(INSTALL) vlc vlc.app/Contents/MacOS/
490 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
492 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
498 # Generic rules (see below)
500 $(H_OBJ): Makefile.opts Makefile.dep Makefile
501 # @echo "regenerating $@"
502 @rm -f $@ && cp $@.in $@
504 @for i in $(BUILTINS) ; do \
505 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
506 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
507 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
511 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
512 @echo " do \\" >> $@ ;
513 @echo " { \\" >> $@ ;
515 @for i in $(BUILTINS) ; do \
516 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
519 @echo " } while( 0 );" >> $@ ;
523 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
525 $(CPP_DEP): %.dpp: FORCE
526 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
528 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
529 $(C_OBJ): %.o: $(H_OBJ)
530 $(C_OBJ): %.o: .dep/%.d
532 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
534 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
535 $(CPP_OBJ): %.o: $(H_OBJ)
536 $(CPP_OBJ): %.o: .dep/%.dpp
537 $(CPP_OBJ): %.o: %.cpp
538 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
540 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
541 $(M_OBJ): %.o: $(H_OBJ)
542 $(M_OBJ): %.o: .dep/%.dm
544 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
546 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
547 ifneq (,(findstring mingw32,$(SYS)))
548 $(RESOURCE_OBJ): %.o: %.rc
549 $(WINDRES) -i $< -o $@
553 # Main application target
555 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) $(BUILTIN_OBJ)
556 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
558 xres -o $@ ./share/vlc_beos.rsrc
565 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
567 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
570 # Built-in modules target
572 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
573 $(BUILTIN_OBJ): FORCE
574 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)