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 \
100 filter/filter_deinterlace \
101 filter/filter_distort \
102 filter/filter_invert \
103 filter/filter_transform \
105 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 \
165 INTERFACE := interface intf_eject
167 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
168 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
169 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
170 MISC := mtime modules threads cpu configuration netutils iso_lang messages objects
172 LIBVLC_OBJ := $(LIBVLC:%=src/%.o) \
173 $(INTERFACE:%=src/interface/%.o) \
174 $(PLAYLIST:%=src/playlist/%.o) \
175 $(INPUT:%=src/input/%.o) \
176 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
177 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
178 $(MISC:%=src/misc/%.o)
180 VLC_OBJ := $(VLC:%=src/%.o)
182 C_OBJ := $(VLC_OBJ) $(LIBVLC_OBJ)
187 ifeq ($(NEED_GETOPT),1)
188 LIBVLC_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
191 ifeq ($(NEED_SYMBOLS),1)
192 LIBVLC_OBJ += src/misc/symbols.o
196 CPP_OBJ := src/misc/beos_specific.o
199 ifneq (,$(findstring darwin,$(SYS)))
200 LIBVLC_OBJ += src/misc/darwin_specific.o
203 ifneq (,$(findstring mingw32,$(SYS)))
204 LIBVLC_OBJ += src/misc/win32_specific.o
205 RESOURCE_OBJ := share/vlc_win32_rc.o
208 LIBVLC_OBJ += $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ)
209 VLC_OBJ += $(RESOURCE_OBJ)
214 H_OBJ := src/misc/modules_builtin.h
217 # Other lists of files
219 C_DEP := $(C_OBJ:%.o=.dep/%.d)
220 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
223 # Translate plugin names
226 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
229 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
235 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
237 # All symbols must be exported
240 ###############################################################################
242 ###############################################################################
247 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
250 @echo "**** No configuration found, please run ./configure"
253 # $(MAKE) $(MAKECMDGOALS)
258 @echo CFLAGS: $(CFLAGS)
259 @echo LDFLAGS: $(LDFLAGS)
260 @echo plugins_CFLAGS: $(plugins_CFLAGS)
261 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
262 @echo builtins_CFLAGS: $(builtins_CFLAGS)
263 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
264 @echo C_OBJ: $(C_OBJ)
265 @echo CPP_OBJ: $(CPP_OBJ)
266 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
267 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
272 clean: plugins-clean po-clean vlc-clean
273 rm -f src/*/*.o extras/*/*.o
274 rm -f lib/*.so* lib/*.a
275 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
276 rm -Rf extras/MacOSX/build
279 -cd po && $(MAKE) clean
282 for dir in $(PLUGINS_DIR) ; do \
283 ( cd plugins/$${dir} \
284 && $(MAKE) -f ../../Makefile.modules clean ) ; done
285 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
288 rm -f $(C_OBJ) $(CPP_OBJ)
289 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
293 -cd po && $(MAKE) maintainer-clean
294 rm -f **/*.o **/*~ *.log
295 rm -f Makefile.opts Makefile.config
296 rm -f include/defs.h include/modules_builtin.h
297 rm -f src/misc/modules_builtin.h
298 rm -f config*status config*cache config*log conftest*
299 rm -f gmon.out core build-stamp
304 # Install/uninstall rules
306 install: vlc-install plugins-install po-install
308 uninstall: vlc-uninstall plugins-uninstall po-uninstall
311 mkdir -p $(DESTDIR)$(bindir)
312 $(INSTALL) vlc $(DESTDIR)$(bindir)
314 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
316 mkdir -p $(DESTDIR)$(datadir)/vlc
317 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
318 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
319 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
322 rm -f $(DESTDIR)$(bindir)/vlc
324 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
326 rm -f $(DESTDIR)$(datadir)/vlc/*.psf
327 rm -f $(DESTDIR)$(datadir)/vlc/*.png
328 rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
331 mkdir -p $(DESTDIR)$(libdir)/vlc
333 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
337 rm -f $(DESTDIR)$(libdir)/vlc/*.so
340 -cd po && $(MAKE) install
343 -cd po && $(MAKE) uninstall
346 # Package generation rules
349 # Check that tmp isn't in the way
350 @if test -e tmp; then \
351 echo "Error: please remove ./tmp, it is in the way"; false; \
353 echo "OK."; mkdir tmp; \
355 # Copy directory structure in tmp
356 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
357 do mkdir -p tmp/vlc/$$i ; \
360 find debian -mindepth 1 -maxdepth 1 -type d | \
361 while read i ; do rm -Rf tmp/vlc/$$i ; done
362 # Copy .c .h .in .cpp .m and .glade files
363 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
364 do cp $$i tmp/vlc/$$i ; done
365 # Grmbl... special case...
366 for i in API BUGS DESIGN TODO ; \
367 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
368 # Copy plugin Makefiles
369 find plugins -type f -name Makefile | while read i ; \
370 do cp $$i tmp/vlc/$$i ; done
371 # Copy extra programs and documentation
372 cp -a extras/* tmp/vlc/extras
373 cp -a doc/* tmp/vlc/doc
374 find tmp/vlc/extras tmp/vlc/doc \
375 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
376 while read i ; do rm -Rf $$i ; done
378 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
379 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
381 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
382 ABOUT-NLS BUGS MODULES vlc.spec \
383 Makefile Makefile.*.in Makefile.dep Makefile.modules \
384 configure configure.in install-sh install-win32 macosx-dmg \
385 config.sub config.guess aclocal.m4 mkinstalldirs \
387 # Copy Debian control files
388 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
389 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
390 for file in control changelog rules ; do \
391 cp debian/$$file tmp/vlc/debian/ ; done
392 # Copy ipkg control files
393 for file in control rules patch ; do \
394 cp ipkg/$$file tmp/vlc/ipkg/ ; done
395 # Copy fonts and icons
396 for file in share/*vlc* share/*psf; do \
397 cp $$file tmp/vlc/share ; done
400 mv tmp/vlc tmp/$$F; (cd tmp ; \
401 cd $$F && $(MAKE) distclean && cd .. ; \
402 tar czf ../$$F.tar.gz $$F);
407 # XXX: this rule is probably only useful to you if you have exactly
408 # the same setup as me. Contact sam@zoy.org if you need to use it.
410 # Check that tmp isn't in the way
411 @if test -e tmp; then \
412 echo "Error: please remove ./tmp, it is in the way"; false; \
414 echo "OK."; mkdir tmp; \
416 # Create installation script
417 cp install-win32 tmp/nsi
418 # Copy relevant files
421 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
422 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
423 do cp $$file tmp/$${file}.txt ; \
424 unix2dos tmp/$${file}.txt ; done
426 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
427 # don't include these two
428 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
430 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
433 for file in default8x16.psf default8x9.psf ; \
434 do cp share/$$file tmp/share/ ; done
436 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
441 # Check that tmp isn't in the way
442 @if test -e tmp; then \
443 echo "Error: please remove ./tmp, it is in the way"; false; \
445 echo "OK."; mkdir tmp; \
449 mkdir -p tmp/vlc/share
450 # Copy relevant files
453 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
454 for file in default8x16.psf default8x9.psf ; \
455 do cp share/$$file tmp/vlc/share/ ; done
456 mkdir tmp/vlc/plugins
457 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
458 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
460 mv tmp/vlc tmp/vlc-${VERSION}
461 (cd tmp ; find vlc-${VERSION} | \
462 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
463 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
468 # Check that tmp isn't in the way
469 @if test -e tmp; then \
470 echo "Error: please remove ./tmp, it is in the way"; false; \
472 echo "OK."; mkdir tmp; \
475 # Copy relevant files
477 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
480 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
486 # Gtk/Gnome/* aliases and OS X application
488 gnome-vlc gvlc kvlc qvlc: vlc
489 rm -f $@ && ln -s vlc $@
493 ifneq (,$(findstring darwin,$(SYS)))
495 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
496 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
497 $(INSTALL) -d vlc.app/Contents/MacOS/share
498 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
499 $(INSTALL) vlc vlc.app/Contents/MacOS/
501 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
503 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
509 # Generic rules (see below)
511 src/misc/modules_builtin.h: Makefile.opts Makefile
512 @echo "make[$(MAKELEVEL)]: Creating \`$@'"
513 @rm -f $@ && cp $@.in $@
515 @for i in $(BUILTINS) ; do \
516 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
517 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
518 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
522 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
523 @echo " do \\" >> $@ ;
524 @echo " { \\" >> $@ ;
526 @for i in $(BUILTINS) ; do \
527 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
530 @echo " } while( 0 );" >> $@ ;
534 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
536 $(CPP_DEP): %.dpp: FORCE
537 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
539 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
540 $(C_OBJ): %.o: $(H_OBJ)
541 $(C_OBJ): %.o: .dep/%.d
543 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
545 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
546 $(CPP_OBJ): %.o: $(H_OBJ)
547 $(CPP_OBJ): %.o: .dep/%.dpp
548 $(CPP_OBJ): %.o: %.cpp
549 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
551 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
552 $(M_OBJ): %.o: $(H_OBJ)
553 $(M_OBJ): %.o: .dep/%.dm
555 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
557 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
558 ifneq (,(findstring mingw32,$(SYS)))
559 $(RESOURCE_OBJ): %.o: %.rc
560 $(WINDRES) -i $< -o $@
564 # Main application target
566 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
567 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
569 xres -o $@ ./share/vlc_beos.rsrc
573 # here are the rules for a dynamic link of libvlc:
574 #vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
575 # $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
578 # Main library target
580 lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
582 ar rc $@ $(LIBVLC_OBJ)
585 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
586 # $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
592 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
593 $(PLUGIN_OBJ): $(H_OBJ) FORCE
594 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
597 # Built-in modules target
599 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
600 $(BUILTIN_OBJ): $(H_OBJ) FORCE
601 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)