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
65 PLUGINS_TARGETS := a52/a52 \
76 chroma/chroma_i420_rgb \
77 chroma/chroma_i420_rgb_mmx \
78 chroma/chroma_i420_yuy2 \
79 chroma/chroma_i420_yuy2_mmx \
80 chroma/chroma_i422_yuy2 \
81 chroma/chroma_i422_yuy2_mmx \
82 chroma/chroma_i420_ymga \
83 chroma/chroma_i420_ymga_mmx \
96 filter/filter_deinterlace \
97 filter/filter_transform \
98 filter/filter_invert \
99 filter/filter_distort \
101 filter/filter_clone \
117 lpcm_adec/lpcm_adec \
122 memcpy/memcpymmxext \
124 memcpy/memcpyaltivec \
129 motion/motionmmxext \
131 motion/motionaltivec \
132 mpeg_system/mpeg_audio \
133 mpeg_system/mpeg_es \
134 mpeg_system/mpeg_ps \
135 mpeg_system/mpeg_ts \
136 mpeg_system/mpeg_ts_dvbpsi \
137 mpeg_adec/mpeg_adec \
138 mpeg_vdec/mpeg_vdec \
144 satellite/satellite \
159 INTERFACE := main interface intf_msg intf_playlist intf_eject
160 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
161 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
162 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
163 MISC := mtime modules configuration netutils iso_lang
165 C_OBJ := $(INTERFACE:%=src/interface/%.o) \
166 $(INPUT:%=src/input/%.o) \
167 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
168 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
169 $(MISC:%=src/misc/%.o)
174 ifeq ($(NEED_GETOPT),1)
175 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
178 ifeq ($(NEED_SYMBOLS),1)
179 C_OBJ += src/misc/symbols.o
183 CPP_OBJ := src/misc/beos_specific.o
186 ifneq (,$(findstring darwin,$(SYS)))
187 C_OBJ += src/misc/darwin_specific.o
190 ifneq (,$(findstring mingw32,$(SYS)))
191 C_OBJ += src/misc/win32_specific.o
192 RESOURCE_OBJ := share/vlc_win32_rc.o
195 VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ)
200 H_OBJ := src/misc/modules_builtin.h
203 # Other lists of files
205 C_DEP := $(C_OBJ:%.o=.dep/%.d)
206 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
209 # Translate plugin names
212 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
215 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
221 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
223 # All symbols must be exported
226 ###############################################################################
228 ###############################################################################
233 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
236 @echo "**** No configuration found, please run ./configure"
239 # $(MAKE) $(MAKECMDGOALS)
244 @echo CFLAGS: $(CFLAGS)
245 @echo LDFLAGS: $(LDFLAGS)
246 @echo plugins_CFLAGS: $(plugins_CFLAGS)
247 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
248 @echo builtins_CFLAGS: $(builtins_CFLAGS)
249 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
250 @echo C_OBJ: $(C_OBJ)
251 @echo CPP_OBJ: $(CPP_OBJ)
252 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
253 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
258 clean: plugins-clean po-clean vlc-clean
259 rm -f src/*/*.o extras/*/*.o
260 rm -f lib/*.so* lib/*.a
261 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
262 rm -rf extras/MacOSX/build
265 -cd po && $(MAKE) clean
268 for dir in $(PLUGINS_DIR) ; do \
269 ( cd plugins/$${dir} \
270 && $(MAKE) -f ../../Makefile.modules clean ) ; done
271 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
274 rm -f $(C_OBJ) $(CPP_OBJ)
275 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
279 -cd po && $(MAKE) maintainer-clean
280 rm -f **/*.o **/*~ *.log
282 rm -f include/defs.h include/modules_builtin.h
283 rm -f src/misc/modules_builtin.h
284 rm -f config*status config*cache config*log conftest*
285 rm -f gmon.out core build-stamp
290 # Install/uninstall rules
292 install: vlc-install plugins-install po-install
294 uninstall: vlc-uninstall plugins-uninstall po-uninstall
297 mkdir -p $(DESTDIR)$(bindir)
298 $(INSTALL) vlc $(DESTDIR)$(bindir)
300 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
302 mkdir -p $(DESTDIR)$(datadir)/videolan
303 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
304 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
305 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
308 rm -f $(DESTDIR)$(bindir)/vlc
310 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
312 rm -f $(DESTDIR)$(datadir)/videolan/*.psf
313 rm -f $(DESTDIR)$(datadir)/videolan/*.png
314 rm -f $(DESTDIR)$(datadir)/videolan/*.xpm
317 mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
319 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/videolan/vlc
323 rm -f $(DESTDIR)$(libdir)/videolan/vlc/*.so
326 -cd po && $(MAKE) install
329 -cd po && $(MAKE) uninstall
332 # Package generation rules
335 # Check that tmp isn't in the way
336 @if test -e tmp; then \
337 echo "Error: please remove ./tmp, it is in the way"; false; \
339 echo "OK."; mkdir tmp; \
341 # Copy directory structure in tmp
342 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
343 do mkdir -p tmp/vlc/$$i ; \
346 find debian -mindepth 1 -maxdepth 1 -type d | \
347 while read i ; do rm -Rf tmp/vlc/$$i ; done
348 # Copy .c .h .in .cpp .m and .glade files
349 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
350 do cp $$i tmp/vlc/$$i ; done
351 # Grmbl... special case...
352 for i in API BUGS DESIGN TODO ; \
353 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
354 # Copy plugin Makefiles
355 find plugins -type f -name Makefile | while read i ; \
356 do cp $$i tmp/vlc/$$i ; done
357 # Copy extra programs and documentation
358 cp -a extras/* tmp/vlc/extras
359 cp -a doc/* tmp/vlc/doc
360 find tmp/vlc/extras tmp/vlc/doc \
361 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
362 while read i ; do rm -Rf $$i ; done
364 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
365 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
367 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
368 ABOUT-NLS BUGS MODULES vlc.spec \
369 Makefile Makefile.opts.in Makefile.dep Makefile.modules \
370 configure configure.in install-sh install-win32 macosx-dmg \
371 config.sub config.guess aclocal.m4 mkinstalldirs \
373 # Copy Debian control files
374 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
375 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
376 for file in control changelog rules ; do \
377 cp debian/$$file tmp/vlc/debian/ ; done
378 # Copy ipkg control files
379 for file in control rules patch ; do \
380 cp ipkg/$$file tmp/vlc/ipkg/ ; done
381 # Copy fonts and icons
382 for file in share/*vlc* share/*psf; do \
383 cp $$file tmp/vlc/share ; done
386 mv tmp/vlc tmp/$$F; (cd tmp ; tar czf ../$$F.tar.gz $$F); \
391 # XXX: this rule is probably only useful to you if you have exactly
392 # the same setup as me. Contact sam@zoy.org if you need to use it.
394 # Check that tmp isn't in the way
395 @if test -e tmp; then \
396 echo "Error: please remove ./tmp, it is in the way"; false; \
398 echo "OK."; mkdir tmp; \
400 # Create installation script
401 cp install-win32 tmp/nsi
402 # Copy relevant files
405 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
406 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
407 do cp $$file tmp/$${file}.txt ; \
408 unix2dos tmp/$${file}.txt ; done
410 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
411 # don't include these two
412 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
414 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
417 for file in default8x16.psf default8x9.psf ; \
418 do cp share/$$file tmp/share/ ; done
420 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
425 # Check that tmp isn't in the way
426 @if test -e tmp; then \
427 echo "Error: please remove ./tmp, it is in the way"; false; \
429 echo "OK."; mkdir tmp; \
433 mkdir -p tmp/vlc/share
434 # Copy relevant files
437 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
438 for file in default8x16.psf default8x9.psf ; \
439 do cp share/$$file tmp/vlc/share/ ; done
440 mkdir tmp/vlc/plugins
441 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
442 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
444 mv tmp/vlc tmp/vlc-${VERSION}
445 (cd tmp ; find vlc-${VERSION} | \
446 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
447 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
452 # Check that tmp isn't in the way
453 @if test -e tmp; then \
454 echo "Error: please remove ./tmp, it is in the way"; false; \
456 echo "OK."; mkdir tmp; \
459 # Copy relevant files
461 cp AUTHORS COPYING ChangeLog README README\ -\ Mac\ OS\ X.rtf FAQ TODO tmp/
464 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
470 # Gtk/Gnome/* aliases and OS X application
472 gnome-vlc gvlc kvlc qvlc: vlc
473 rm -f $@ && ln -s vlc $@
477 ifneq (,$(findstring darwin,$(SYS)))
479 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
480 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
481 $(INSTALL) -d vlc.app/Contents/MacOS/share
482 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
483 $(INSTALL) vlc vlc.app/Contents/MacOS/
485 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
487 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
493 # Generic rules (see below)
495 $(H_OBJ): Makefile.opts Makefile.dep Makefile
496 # @echo "regenerating $@"
497 @rm -f $@ && cp $@.in $@
499 @for i in $(BUILTINS) ; do \
500 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
501 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
502 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
506 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
507 @echo " do \\" >> $@ ;
508 @echo " { \\" >> $@ ;
510 @for i in $(BUILTINS) ; do \
511 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
514 @echo " } while( 0 );" >> $@ ;
518 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
520 $(CPP_DEP): %.dpp: FORCE
521 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
523 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
524 $(C_OBJ): %.o: $(H_OBJ)
525 $(C_OBJ): %.o: .dep/%.d
527 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
529 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
530 $(CPP_OBJ): %.o: $(H_OBJ)
531 $(CPP_OBJ): %.o: .dep/%.dpp
532 $(CPP_OBJ): %.o: %.cpp
533 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
535 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
536 $(M_OBJ): %.o: $(H_OBJ)
537 $(M_OBJ): %.o: .dep/%.dm
539 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
541 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
542 ifneq (,(findstring mingw32,$(SYS)))
543 $(RESOURCE_OBJ): %.o: %.rc
544 $(WINDRES) -i $< -o $@
548 # Main application target
550 vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) $(BUILTIN_OBJ)
551 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
553 xres -o $@ ./share/vlc_beos.rsrc
560 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
562 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
565 # Built-in modules target
567 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
568 $(BUILTIN_OBJ): FORCE
569 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)