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
71 PLUGINS_TARGETS := a52/a52 \
83 chroma/chroma_i420_rgb \
84 chroma/chroma_i420_rgb_mmx \
85 chroma/chroma_i420_yuy2 \
86 chroma/chroma_i420_yuy2_mmx \
87 chroma/chroma_i422_yuy2 \
88 chroma/chroma_i422_yuy2_mmx \
89 chroma/chroma_i420_ymga \
90 chroma/chroma_i420_ymga_mmx \
104 filter/filter_deinterlace \
105 filter/filter_transform \
106 filter/filter_invert \
107 filter/filter_distort \
109 filter/filter_clone \
126 lpcm_adec/lpcm_adec \
131 memcpy/memcpymmxext \
133 memcpy/memcpyaltivec \
138 motion/motionmmxext \
140 motion/motionaltivec \
141 mpeg_system/mpeg_audio \
142 mpeg_system/mpeg_es \
143 mpeg_system/mpeg_ps \
144 mpeg_system/mpeg_ts \
145 mpeg_system/mpeg_ts_dvbpsi \
146 mpeg_adec/mpeg_adec \
147 mpeg_vdec/mpeg_vdec \
155 satellite/satellite \
170 INTERFACE := main interface intf_msg intf_playlist intf_eject
171 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
172 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
173 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
174 MISC := mtime modules configuration netutils iso_lang
176 C_OBJ := $(INTERFACE:%=src/interface/%.o) \
177 $(INPUT:%=src/input/%.o) \
178 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
179 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
180 $(MISC:%=src/misc/%.o)
185 ifeq ($(NEED_GETOPT),1)
186 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
189 ifeq ($(NEED_SYMBOLS),1)
190 C_OBJ += src/misc/symbols.o
194 CPP_OBJ := src/misc/beos_specific.o
197 ifneq (,$(findstring darwin,$(SYS)))
198 C_OBJ += src/misc/darwin_specific.o
201 ifneq (,$(findstring mingw32,$(SYS)))
202 C_OBJ += src/misc/win32_specific.o
203 RESOURCE_OBJ := share/vlc_win32_rc.o
206 VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ)
211 H_OBJ := src/misc/modules_builtin.h
214 # Other lists of files
216 C_DEP := $(C_OBJ:%.o=.dep/%.d)
217 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
220 # Translate plugin names
223 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
226 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
232 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
234 # All symbols must be exported
237 ###############################################################################
239 ###############################################################################
244 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
247 @echo "**** No configuration found, please run ./configure"
250 # $(MAKE) $(MAKECMDGOALS)
255 @echo CFLAGS: $(CFLAGS)
256 @echo LDFLAGS: $(LDFLAGS)
257 @echo plugins_CFLAGS: $(plugins_CFLAGS)
258 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
259 @echo builtins_CFLAGS: $(builtins_CFLAGS)
260 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
261 @echo C_OBJ: $(C_OBJ)
262 @echo CPP_OBJ: $(CPP_OBJ)
263 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
264 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
269 clean: plugins-clean po-clean vlc-clean
270 rm -f src/*/*.o extras/*/*.o
271 rm -f lib/*.so* lib/*.a
272 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
273 rm -rf extras/MacOSX/build
276 -cd po && $(MAKE) clean
279 for dir in $(PLUGINS_DIR) ; do \
280 ( cd plugins/$${dir} \
281 && $(MAKE) -f ../../Makefile.modules clean ) ; done
282 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
285 rm -f $(C_OBJ) $(CPP_OBJ)
286 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
290 -cd po && $(MAKE) maintainer-clean
291 rm -f **/*.o **/*~ *.log
292 rm -f Makefile.opts Makefile.config
293 rm -f include/defs.h include/modules_builtin.h
294 rm -f src/misc/modules_builtin.h
295 rm -f config*status config*cache config*log conftest*
296 rm -f gmon.out core build-stamp
301 # Install/uninstall rules
303 install: vlc-install plugins-install po-install
305 uninstall: vlc-uninstall plugins-uninstall po-uninstall
308 mkdir -p $(DESTDIR)$(bindir)
309 $(INSTALL) vlc $(DESTDIR)$(bindir)
311 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
313 mkdir -p $(DESTDIR)$(datadir)/videolan
314 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
315 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
316 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
319 rm -f $(DESTDIR)$(bindir)/vlc
321 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
323 rm -f $(DESTDIR)$(datadir)/videolan/*.psf
324 rm -f $(DESTDIR)$(datadir)/videolan/*.png
325 rm -f $(DESTDIR)$(datadir)/videolan/*.xpm
328 mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
330 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/videolan/vlc
334 rm -f $(DESTDIR)$(libdir)/videolan/vlc/*.so
337 -cd po && $(MAKE) install
340 -cd po && $(MAKE) uninstall
343 # Package generation rules
346 # Check that tmp isn't in the way
347 @if test -e tmp; then \
348 echo "Error: please remove ./tmp, it is in the way"; false; \
350 echo "OK."; mkdir tmp; \
352 # Copy directory structure in tmp
353 find . -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
354 do mkdir -p tmp/vlc/$$i ; \
357 find debian -mindepth 1 -maxdepth 1 -type d | \
358 while read i ; do rm -Rf tmp/vlc/$$i ; done
359 # Copy .c .h .in .cpp .m and .glade files
360 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
361 do cp $$i tmp/vlc/$$i ; done
362 # Grmbl... special case...
363 for i in API BUGS DESIGN TODO ; \
364 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
365 # Copy plugin Makefiles
366 find plugins -type f -name Makefile | while read i ; \
367 do cp $$i tmp/vlc/$$i ; done
368 # Copy extra programs and documentation
369 cp -a extras/* tmp/vlc/extras
370 cp -a doc/* tmp/vlc/doc
371 find tmp/vlc/extras tmp/vlc/doc \
372 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
373 while read i ; do rm -Rf $$i ; done
375 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
376 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
378 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
379 ABOUT-NLS BUGS plugins/LIST vlc.spec \
380 Makefile Makefile.*.in Makefile.dep Makefile.modules \
381 configure configure.in install-sh install-win32 macosx-dmg \
382 config.sub config.guess aclocal.m4 mkinstalldirs \
384 # Copy Debian control files
385 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
386 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
387 for file in control changelog rules ; do \
388 cp debian/$$file tmp/vlc/debian/ ; done
389 # Copy ipkg control files
390 for file in ipkg/* ; do \
391 cp $$file tmp/vlc/ipkg/ ; done
392 # Copy fonts and icons
393 for file in share/*vlc* share/*psf; do \
394 cp $$file tmp/vlc/share ; done
397 mv tmp/vlc tmp/$$F; (cd tmp ; tar czf ../$$F.tar.gz $$F); \
402 # XXX: this rule is probably only useful to you if you have exactly
403 # the same setup as me. Contact sam@zoy.org if you need to use it.
405 # Check that tmp isn't in the way
406 @if test -e tmp; then \
407 echo "Error: please remove ./tmp, it is in the way"; false; \
409 echo "OK."; mkdir tmp; \
411 # Create installation script
412 cp install-win32 tmp/nsi
413 # Copy relevant files
416 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
417 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
418 do cp $$file tmp/$${file}.txt ; \
419 unix2dos tmp/$${file}.txt ; done
421 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
422 # don't include these two
423 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
425 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
428 for file in default8x16.psf default8x9.psf ; \
429 do cp share/$$file tmp/share/ ; done
431 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
436 # Check that tmp isn't in the way
437 @if test -e tmp; then \
438 echo "Error: please remove ./tmp, it is in the way"; false; \
440 echo "OK."; mkdir tmp; \
444 mkdir -p tmp/vlc/share
445 # Copy relevant files
448 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
449 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
450 for file in default8x16.psf default8x9.psf ; \
451 do cp share/$$file tmp/vlc/share/ ; done
452 mkdir tmp/vlc/plugins
453 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
454 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
456 mv tmp/vlc tmp/vlc-${VERSION}
457 (cd tmp ; find vlc-${VERSION} | \
458 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
459 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
464 # Check that tmp isn't in the way
465 @if test -e tmp; then \
466 echo "Error: please remove ./tmp, it is in the way"; false; \
468 echo "OK."; mkdir tmp; \
471 # Copy relevant files
473 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
476 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
482 # Gtk/Gnome/* aliases and OS X application
484 gnome-vlc gvlc kvlc qvlc: vlc
485 rm -f $@ && ln -s vlc $@
489 ifneq (,$(findstring darwin,$(SYS)))
491 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
492 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
493 $(INSTALL) -d vlc.app/Contents/MacOS/share
494 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
495 $(INSTALL) vlc vlc.app/Contents/MacOS/
497 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
499 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
505 # Generic rules (see below)
507 $(H_OBJ): Makefile.opts Makefile.dep Makefile
508 # @echo "regenerating $@"
509 @rm -f $@ && cp $@.in $@
511 @for i in $(BUILTINS) ; do \
512 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
513 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
514 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
518 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
519 @echo " do \\" >> $@ ;
520 @echo " { \\" >> $@ ;
522 @for i in $(BUILTINS) ; do \
523 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
526 @echo " } while( 0 );" >> $@ ;
530 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
532 $(CPP_DEP): %.dpp: FORCE
533 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
535 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
536 $(C_OBJ): %.o: $(H_OBJ)
537 $(C_OBJ): %.o: .dep/%.d
539 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
541 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
542 $(CPP_OBJ): %.o: $(H_OBJ)
543 $(CPP_OBJ): %.o: .dep/%.dpp
544 $(CPP_OBJ): %.o: %.cpp
545 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
547 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
548 $(M_OBJ): %.o: $(H_OBJ)
549 $(M_OBJ): %.o: .dep/%.dm
551 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
553 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
554 ifneq (,(findstring mingw32,$(SYS)))
555 $(RESOURCE_OBJ): %.o: %.rc
556 $(WINDRES) -i $< -o $@
560 # Main application target
562 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) $(BUILTIN_OBJ)
563 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
565 xres -o $@ ./share/vlc_beos.rsrc
572 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
574 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
577 # Built-in modules target
579 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
580 $(BUILTIN_OBJ): FORCE
581 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)