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 \
82 chroma/chroma_i420_rgb \
83 chroma/chroma_i420_rgb_mmx \
84 chroma/chroma_i420_yuy2 \
85 chroma/chroma_i420_yuy2_mmx \
86 chroma/chroma_i422_yuy2 \
87 chroma/chroma_i422_yuy2_mmx \
88 chroma/chroma_i420_ymga \
89 chroma/chroma_i420_ymga_mmx \
103 filter/filter_deinterlace \
104 filter/filter_transform \
105 filter/filter_invert \
106 filter/filter_distort \
108 filter/filter_clone \
125 lpcm_adec/lpcm_adec \
130 memcpy/memcpymmxext \
132 memcpy/memcpyaltivec \
137 motion/motionmmxext \
139 motion/motionaltivec \
140 mpeg_system/mpeg_audio \
141 mpeg_system/mpeg_es \
142 mpeg_system/mpeg_ps \
143 mpeg_system/mpeg_ts \
144 mpeg_system/mpeg_ts_dvbpsi \
145 mpeg_adec/mpeg_adec \
146 mpeg_vdec/mpeg_vdec \
154 satellite/satellite \
169 INTERFACE := main interface intf_msg intf_playlist intf_eject
170 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
171 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
172 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
173 MISC := mtime modules configuration netutils iso_lang
175 C_OBJ := $(INTERFACE:%=src/interface/%.o) \
176 $(INPUT:%=src/input/%.o) \
177 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
178 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
179 $(MISC:%=src/misc/%.o)
184 ifeq ($(NEED_GETOPT),1)
185 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
188 ifeq ($(NEED_SYMBOLS),1)
189 C_OBJ += src/misc/symbols.o
193 CPP_OBJ := src/misc/beos_specific.o
196 ifneq (,$(findstring darwin,$(SYS)))
197 C_OBJ += src/misc/darwin_specific.o
200 ifneq (,$(findstring mingw32,$(SYS)))
201 C_OBJ += src/misc/win32_specific.o
202 RESOURCE_OBJ := share/vlc_win32_rc.o
205 VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ)
210 H_OBJ := src/misc/modules_builtin.h
213 # Other lists of files
215 C_DEP := $(C_OBJ:%.o=.dep/%.d)
216 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
219 # Translate plugin names
222 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
225 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
231 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
233 # All symbols must be exported
236 ###############################################################################
238 ###############################################################################
243 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
246 @echo "**** No configuration found, please run ./configure"
249 # $(MAKE) $(MAKECMDGOALS)
254 @echo CFLAGS: $(CFLAGS)
255 @echo LDFLAGS: $(LDFLAGS)
256 @echo plugins_CFLAGS: $(plugins_CFLAGS)
257 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
258 @echo builtins_CFLAGS: $(builtins_CFLAGS)
259 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
260 @echo C_OBJ: $(C_OBJ)
261 @echo CPP_OBJ: $(CPP_OBJ)
262 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
263 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
268 clean: plugins-clean po-clean vlc-clean
269 rm -f src/*/*.o extras/*/*.o
270 rm -f lib/*.so* lib/*.a
271 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
272 rm -rf extras/MacOSX/build
275 -cd po && $(MAKE) clean
278 for dir in $(PLUGINS_DIR) ; do \
279 ( cd plugins/$${dir} \
280 && $(MAKE) -f ../../Makefile.modules clean ) ; done
281 rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
284 rm -f $(C_OBJ) $(CPP_OBJ)
285 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
289 -cd po && $(MAKE) maintainer-clean
290 rm -f **/*.o **/*~ *.log
291 rm -f Makefile.opts Makefile.config
292 rm -f include/defs.h include/modules_builtin.h
293 rm -f src/misc/modules_builtin.h
294 rm -f config*status config*cache config*log conftest*
295 rm -f gmon.out core build-stamp
300 # Install/uninstall rules
302 install: vlc-install plugins-install po-install
304 uninstall: vlc-uninstall plugins-uninstall po-uninstall
307 mkdir -p $(DESTDIR)$(bindir)
308 $(INSTALL) vlc $(DESTDIR)$(bindir)
310 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
312 mkdir -p $(DESTDIR)$(datadir)/videolan
313 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
314 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
315 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
318 rm -f $(DESTDIR)$(bindir)/vlc
320 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
322 rm -f $(DESTDIR)$(datadir)/videolan/*.psf
323 rm -f $(DESTDIR)$(datadir)/videolan/*.png
324 rm -f $(DESTDIR)$(datadir)/videolan/*.xpm
327 mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
329 $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/videolan/vlc
333 rm -f $(DESTDIR)$(libdir)/videolan/vlc/*.so
336 -cd po && $(MAKE) install
339 -cd po && $(MAKE) uninstall
342 # Package generation rules
345 # Check that tmp isn't in the way
346 @if test -e tmp; then \
347 echo "Error: please remove ./tmp, it is in the way"; false; \
349 echo "OK."; mkdir tmp; \
351 # Copy directory structure in tmp
352 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
353 do mkdir -p tmp/vlc/$$i ; \
356 find debian -mindepth 1 -maxdepth 1 -type d | \
357 while read i ; do rm -Rf tmp/vlc/$$i ; done
358 # Copy .c .h .in .cpp .m and .glade files
359 find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
360 do cp $$i tmp/vlc/$$i ; done
361 # Grmbl... special case...
362 for i in API BUGS DESIGN TODO ; \
363 do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
364 # Copy plugin Makefiles
365 find plugins -type f -name Makefile | while read i ; \
366 do cp $$i tmp/vlc/$$i ; done
367 # Copy extra programs and documentation
368 cp -a extras/* tmp/vlc/extras
369 cp -a doc/* tmp/vlc/doc
370 find tmp/vlc/extras tmp/vlc/doc \
371 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
372 while read i ; do rm -Rf $$i ; done
374 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
375 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
377 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
378 ABOUT-NLS BUGS plugins/LIST vlc.spec \
379 Makefile Makefile.*.in Makefile.dep Makefile.modules \
380 configure configure.in install-sh install-win32 macosx-dmg \
381 config.sub config.guess aclocal.m4 mkinstalldirs \
383 # Copy Debian control files
384 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
385 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
386 for file in control changelog rules ; do \
387 cp debian/$$file tmp/vlc/debian/ ; done
388 # Copy ipkg control files
389 for file in control rules patch ; do \
390 cp ipkg/$$file tmp/vlc/ipkg/ ; done
391 # Copy fonts and icons
392 for file in share/*vlc* share/*psf; do \
393 cp $$file tmp/vlc/share ; done
396 mv tmp/vlc tmp/$$F; (cd tmp ; tar czf ../$$F.tar.gz $$F); \
401 # XXX: this rule is probably only useful to you if you have exactly
402 # the same setup as me. Contact sam@zoy.org if you need to use it.
404 # Check that tmp isn't in the way
405 @if test -e tmp; then \
406 echo "Error: please remove ./tmp, it is in the way"; false; \
408 echo "OK."; mkdir tmp; \
410 # Create installation script
411 cp install-win32 tmp/nsi
412 # Copy relevant files
415 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
416 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
417 do cp $$file tmp/$${file}.txt ; \
418 unix2dos tmp/$${file}.txt ; done
420 cp $(PLUGINS:%=plugins/%.so) tmp/plugins/
421 # don't include these two
422 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
424 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
427 for file in default8x16.psf default8x9.psf ; \
428 do cp share/$$file tmp/share/ ; done
430 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
435 # Check that tmp isn't in the way
436 @if test -e tmp; then \
437 echo "Error: please remove ./tmp, it is in the way"; false; \
439 echo "OK."; mkdir tmp; \
443 mkdir -p tmp/vlc/share
444 # Copy relevant files
447 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
448 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
449 for file in default8x16.psf default8x9.psf ; \
450 do cp share/$$file tmp/vlc/share/ ; done
451 mkdir tmp/vlc/plugins
452 cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/
453 strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
455 mv tmp/vlc tmp/vlc-${VERSION}
456 (cd tmp ; find vlc-${VERSION} | \
457 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
458 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
463 # Check that tmp isn't in the way
464 @if test -e tmp; then \
465 echo "Error: please remove ./tmp, it is in the way"; false; \
467 echo "OK."; mkdir tmp; \
470 # Copy relevant files
472 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
475 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
481 # Gtk/Gnome/* aliases and OS X application
483 gnome-vlc gvlc kvlc qvlc: vlc
484 rm -f $@ && ln -s vlc $@
488 ifneq (,$(findstring darwin,$(SYS)))
490 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
491 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
492 $(INSTALL) -d vlc.app/Contents/MacOS/share
493 $(INSTALL) -d vlc.app/Contents/MacOS/plugins
494 $(INSTALL) vlc vlc.app/Contents/MacOS/
496 $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
498 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
504 # Generic rules (see below)
506 $(H_OBJ): Makefile.opts Makefile.dep Makefile
507 # @echo "regenerating $@"
508 @rm -f $@ && cp $@.in $@
510 @for i in $(BUILTINS) ; do \
511 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
512 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
513 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
517 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
518 @echo " do \\" >> $@ ;
519 @echo " { \\" >> $@ ;
521 @for i in $(BUILTINS) ; do \
522 echo " ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
525 @echo " } while( 0 );" >> $@ ;
529 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
531 $(CPP_DEP): %.dpp: FORCE
532 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
534 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
535 $(C_OBJ): %.o: $(H_OBJ)
536 $(C_OBJ): %.o: .dep/%.d
538 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
540 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
541 $(CPP_OBJ): %.o: $(H_OBJ)
542 $(CPP_OBJ): %.o: .dep/%.dpp
543 $(CPP_OBJ): %.o: %.cpp
544 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
546 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
547 $(M_OBJ): %.o: $(H_OBJ)
548 $(M_OBJ): %.o: .dep/%.dm
550 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
552 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
553 ifneq (,(findstring mingw32,$(SYS)))
554 $(RESOURCE_OBJ): %.o: %.rc
555 $(WINDRES) -i $< -o $@
559 # Main application target
561 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) $(BUILTIN_OBJ)
562 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
564 xres -o $@ ./share/vlc_beos.rsrc
571 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
573 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
576 # Built-in modules target
578 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
579 $(BUILTIN_OBJ): FORCE
580 @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)