1 ###############################################################################
2 # vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
3 ###############################################################################
5 ifeq ($(shell [ ! -r Makefile.opts ] && echo 1),)
9 ###############################################################################
11 ###############################################################################
14 # All possible plugin directories, needed for make clean
63 PLUGINS_TARGETS := a52/a52 \
73 chroma/chroma_i420_rgb \
74 chroma/chroma_i420_rgb_mmx \
75 chroma/chroma_i420_yuy2 \
76 chroma/chroma_i420_yuy2_mmx \
77 chroma/chroma_i422_yuy2 \
78 chroma/chroma_i422_yuy2_mmx \
79 chroma/chroma_i420_ymga \
80 chroma/chroma_i420_ymga_mmx \
92 filter/filter_deinterlace \
93 filter/filter_transform \
94 filter/filter_invert \
95 filter/filter_distort \
112 lpcm_adec/lpcm_adec \
117 memcpy/memcpymmxext \
119 memcpy/memcpyaltivec \
124 motion/motionmmxext \
126 motion/motionaltivec \
127 mpeg_system/mpeg_es \
128 mpeg_system/mpeg_ps \
129 mpeg_system/mpeg_ts \
130 mpeg_adec/mpeg_adec \
131 mpeg_vdec/mpeg_vdec \
137 satellite/satellite \
152 INTERFACE := main interface intf_msg intf_playlist intf_eject
153 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
154 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
155 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
156 MISC := mtime modules configuration netutils iso_lang
158 C_OBJ := $(INTERFACE:%=src/interface/%.o) \
159 $(INPUT:%=src/input/%.o) \
160 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
161 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
162 $(MISC:%=src/misc/%.o)
167 ifeq ($(NEED_GETOPT),1)
168 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
171 ifeq ($(NEED_SYMBOLS),1)
172 C_OBJ += src/misc/symbols.o
176 CPP_OBJ := src/misc/beos_specific.o
179 ifneq (,$(findstring darwin,$(SYS)))
180 C_OBJ += src/misc/darwin_specific.o
183 ifneq (,$(findstring mingw32,$(SYS)))
184 C_OBJ += src/misc/win32_specific.o
185 RESOURCE_OBJ := share/vlc_win32_rc.o
188 VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ)
193 H_OBJ := src/misc/modules_builtin.h
196 # Other lists of files
198 C_DEP := $(C_OBJ:%.o=.dep/%.d)
199 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
202 # Translate plugin names
205 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
208 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
214 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
216 # All symbols must be exported
219 ###############################################################################
221 ###############################################################################
226 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
229 @echo "**** No configuration found, please run ./configure"
232 # $(MAKE) $(MAKECMDGOALS)
237 @echo CFLAGS: $(CFLAGS)
238 @echo LDFLAGS: $(LDFLAGS)
239 @echo plugins_CFLAGS: $(plugins_CFLAGS)
240 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
241 @echo builtins_CFLAGS: $(builtins_CFLAGS)
242 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
243 @echo C_OBJ: $(C_OBJ)
244 @echo CPP_OBJ: $(CPP_OBJ)
245 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
246 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
251 clean: plugins-clean po-clean vlc-clean
252 rm -f src/*/*.o extras/*/*.o
253 rm -f lib/*.so* lib/*.a
254 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
255 rm -rf extras/MacOSX/build
258 -cd po && $(MAKE) clean
261 for dir in $(PLUGINS_DIR) ; do \
262 ( cd plugins/$${dir} \
263 && $(MAKE) -f ../../Makefile.modules clean ) ; done
264 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
267 rm -f $(C_OBJ) $(CPP_OBJ)
268 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
272 -cd po && $(MAKE) maintainer-clean
273 rm -f **/*.o **/*~ *.log
275 rm -f include/defs.h include/modules_builtin.h
276 rm -f src/misc/modules_builtin.h
277 rm -f config*status config*cache config*log conftest*
278 rm -f gmon.out core build-stamp
283 # Install/uninstall rules
285 install: vlc-install plugins-install po-install
287 uninstall: vlc-uninstall plugins-uninstall po-uninstall
290 mkdir -p $(DESTDIR)$(bindir)
291 $(INSTALL) vlc $(DESTDIR)$(bindir)
293 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
295 mkdir -p $(DESTDIR)$(datadir)/videolan
296 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
297 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
298 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
301 rm -f $(DESTDIR)$(bindir)/vlc
303 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
305 rm -f $(DESTDIR)$(datadir)/videolan/*.psf
306 rm -f $(DESTDIR)$(datadir)/videolan/*.png
307 rm -f $(DESTDIR)$(datadir)/videolan/*.xpm
310 mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
312 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/videolan/vlc
316 rm -f $(DESTDIR)$(libdir)/videolan/vlc/*.so
319 -cd po && $(MAKE) install
322 -cd po && $(MAKE) uninstall
325 # Package generation rules
328 # Check that tmp isn't in the way
329 @if test -e tmp; then \
330 echo "Error: please remove ./tmp, it is in the way"; false; \
332 echo "OK."; mkdir tmp; \
334 # Copy directory structure in tmp
335 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
336 do mkdir -p tmp/vlc/$$i ; \
339 find debian -mindepth 1 -maxdepth 1 -type d | \
340 while read i ; do rm -Rf tmp/vlc/$$i ; done
341 # Copy .c .h .in .cpp and .glade files
342 find include src plugins -type f -name '*.[bcdhigrst]*' | while read i ; \
343 do cp $$i tmp/vlc/$$i ; done
344 # Grmbl... special case...
345 for i in API BUGS DESIGN TODO ; \
346 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
347 # Copy plugin Makefiles
348 find plugins -type f -name Makefile | while read i ; \
349 do cp $$i tmp/vlc/$$i ; done
350 # Copy extra programs and documentation
351 cp -a extras/* tmp/vlc/extras
352 cp -a doc/* tmp/vlc/doc
353 find tmp/vlc/extras tmp/vlc/doc \
354 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
355 while read i ; do rm -Rf $$i ; done
357 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
358 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
360 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
361 ABOUT-NLS BUGS MODULES vlc.spec \
362 Makefile Makefile.opts.in Makefile.dep Makefile.modules \
363 configure configure.in install-sh install-win32 macosx-dmg \
364 config.sub config.guess aclocal.m4 mkinstalldirs \
366 # Copy Debian control files
367 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
368 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
369 for file in control changelog rules ; do \
370 cp debian/$$file tmp/vlc/debian/ ; done
371 # Copy ipkg control files
372 for file in control rules patch ; do \
373 cp ipkg/$$file tmp/vlc/ipkg/ ; done
374 # Copy fonts and icons
375 for file in share/*vlc* share/*psf; do \
376 cp $$file tmp/vlc/share ; done
379 mv tmp/vlc tmp/$$F; (cd tmp ; tar czf ../$$F.tar.gz $$F); \
384 # XXX: this rule is probably only useful to you if you have exactly
385 # the same setup as me. Contact sam@zoy.org if you need to use it.
387 # Check that tmp isn't in the way
388 @if test -e tmp; then \
389 echo "Error: please remove ./tmp, it is in the way"; false; \
391 echo "OK."; mkdir tmp; \
393 # Create installation script
394 cp install-win32 tmp/nsi
395 # Copy relevant files
398 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
399 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
400 do cp $$file tmp/$${file}.txt ; \
401 unix2dos tmp/$${file}.txt ; done
403 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
404 # don't include these two
405 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
407 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
410 for file in default8x16.psf default8x9.psf ; \
411 do cp share/$$file tmp/share/ ; done
413 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
418 # Check that tmp isn't in the way
419 @if test -e tmp; then \
420 echo "Error: please remove ./tmp, it is in the way"; false; \
422 echo "OK."; mkdir tmp; \
426 mkdir -p tmp/vlc/share
427 # Copy relevant files
430 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
431 for file in default8x16.psf default8x9.psf ; \
432 do cp share/$$file tmp/vlc/share/ ; done
433 mkdir tmp/vlc/plugins
434 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
435 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
437 mv tmp/vlc tmp/vlc-${VERSION}
438 (cd tmp ; find vlc-${VERSION} | \
439 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
440 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
445 # Check that tmp isn't in the way
446 @if test -e tmp; then \
447 echo "Error: please remove ./tmp, it is in the way"; false; \
449 echo "OK."; mkdir tmp; \
452 # Copy relevant files
454 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/
457 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
463 # Gtk/Gnome/* aliases and OS X application
465 gnome-vlc gvlc kvlc qvlc: vlc
466 rm -f $@ && ln -s vlc $@
470 ifneq (,$(findstring darwin,$(SYS)))
472 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t'
473 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
474 $(INSTALL) -d vlc.app/Contents/MacOS/share
475 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
476 $(INSTALL) vlc vlc.app/Contents/MacOS/
478 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
480 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
486 # Generic rules (see below)
488 $(H_OBJ): Makefile.opts Makefile.dep Makefile
489 # @echo "regenerating $@"
490 @rm -f $@ && cp $@.in $@
492 @for i in $(BUILTINS) ; do \
493 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
494 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
495 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
499 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
500 @echo " do \\" >> $@ ;
501 @echo " { \\" >> $@ ;
503 @for i in $(BUILTINS) ; do \
504 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
507 @echo " } while( 0 );" >> $@ ;
511 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
513 $(CPP_DEP): %.dpp: FORCE
514 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
516 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
517 $(C_OBJ): %.o: $(H_OBJ)
518 $(C_OBJ): %.o: .dep/%.d
520 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
522 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
523 $(CPP_OBJ): %.o: $(H_OBJ)
524 $(CPP_OBJ): %.o: .dep/%.dpp
525 $(CPP_OBJ): %.o: %.cpp
526 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
528 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
529 ifneq (,(findstring mingw32,$(SYS)))
530 $(RESOURCE_OBJ): %.o: %.rc
531 $(WINDRES) -i $< -o $@
535 # Main application target
537 vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) $(BUILTIN_OBJ)
538 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
540 xres -o $@ ./share/vlc_beos.rsrc
547 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
549 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
552 # Built-in modules target
554 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
555 $(BUILTIN_OBJ): FORCE
556 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)