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 ###############################################################################
21 INTERFACE := interface intf_eject
23 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system input_info
24 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
25 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
26 MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras
28 LIBVLC_OBJ := $(LIBVLC:%=src/%.o) \
29 $(INTERFACE:%=src/interface/%.o) \
30 $(PLAYLIST:%=src/playlist/%.o) \
31 $(INPUT:%=src/input/%.o) \
32 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
33 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
34 $(MISC:%=src/misc/%.o)
36 VLC_OBJ := $(VLC:%=src/%.o)
38 C_OBJ := $(VLC_OBJ) $(LIBVLC_OBJ)
43 ifeq ($(NEED_GETOPT),1)
44 LIBVLC_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
47 ifeq ($(NEED_SYMBOLS),1)
48 LIBVLC_OBJ += src/misc/symbols.o
52 CPP_OBJ := src/misc/beos_specific.o
55 ifneq (,$(findstring darwin,$(SYS)))
56 LIBVLC_OBJ += src/misc/darwin_specific.o
59 ifneq (,$(findstring mingw32,$(SYS)))
60 LIBVLC_OBJ += src/misc/win32_specific.o
61 RESOURCE_OBJ := share/vlc_win32_rc.o
64 LIBVLC_OBJ += $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ)
65 VLC_OBJ += $(RESOURCE_OBJ)
70 H_OBJ := src/misc/modules_builtin.h
73 # Other lists of files
75 C_DEP := $(C_OBJ:%.o=.dep/%.d)
76 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
79 # Translate plugin names
82 PLUGIN_OBJ := $(PLUGINS:%=modules/%.so)
85 BUILTIN_OBJ := $(BUILTINS:%=modules/%.a)
91 VERSION := $(shell grep '^ *VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
93 # All symbols must be exported
96 ###############################################################################
98 ###############################################################################
103 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po mozilla/libvlcplugin.so
106 @echo "**** No configuration found, please run ./configure"
109 # $(MAKE) $(MAKECMDGOALS)
114 @echo CFLAGS: $(CFLAGS)
115 @echo LDFLAGS: $(LDFLAGS)
116 @echo plugins_CFLAGS: $(plugins_CFLAGS)
117 @echo plugins_LDFLAGS: $(plugins_LDFLAGS)
118 @echo builtins_CFLAGS: $(builtins_CFLAGS)
119 @echo builtins_LDFLAGS: $(builtins_LDFLAGS)
120 @echo C_OBJ: $(C_OBJ)
121 @echo CPP_OBJ: $(CPP_OBJ)
122 @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
123 @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
128 clean: plugins-clean po-clean vlc-clean mozilla-clean
129 rm -f src/*/*.o extras/*/*.o
130 rm -f lib/*.so* lib/*.a
131 rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
132 rm -Rf extras/MacOSX/build
135 -cd po && $(MAKE) clean
138 for dir in $(shell echo $(PLUGIN_OBJ) $(BUILTIN_OBJ) | sed 's@\([^ ]*\)/[^ ]*@\1@g' ) ; do ( PARENT=`pwd` ; cd $${dir} && $(MAKE) -f $$PARENT/Makefile.modules clean PARENT=$$PARENT ) ; done
141 rm -f $(C_OBJ) $(CPP_OBJ)
142 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
146 -cd mozilla && $(MAKE) clean
149 -cd po && $(MAKE) maintainer-clean
150 rm -f **/*.o **/*~ *.log
151 rm -f Makefile.opts Makefile.config
152 rm -f include/defs.h include/modules_builtin.h
153 rm -f src/misc/modules_builtin.h
154 rm -f config*status config*cache config*log conftest*
155 rm -f gmon.out core build-stamp
160 # Install/uninstall rules
162 install: vlc-install plugins-install builtins-install libvlc-install po-install mozilla-install
164 uninstall: vlc-uninstall plugins-uninstall builtins-uninstall libvlc-uninstall po-uninstall mozilla-uninstall
167 mkdir -p $(DESTDIR)$(bindir)
168 $(INSTALL) vlc $(DESTDIR)$(bindir)
170 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
172 mkdir -p $(DESTDIR)$(datadir)/vlc
173 $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
174 $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
175 $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
178 rm -f $(DESTDIR)$(bindir)/vlc
180 for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
182 rm -f $(DESTDIR)$(datadir)/vlc/*.psf
183 rm -f $(DESTDIR)$(datadir)/vlc/*.png
184 rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
185 -rmdir $(DESTDIR)$(datadir)/vlc
188 mkdir -p $(DESTDIR)$(libdir)/vlc
190 $(INSTALL) $(PLUGINS:%=modules/%.so) $(DESTDIR)$(libdir)/vlc
194 rm -f $(DESTDIR)$(libdir)/vlc/*.so
195 -rmdir $(DESTDIR)$(libdir)/vlc
198 mkdir -p $(DESTDIR)$(libdir)/vlc
200 $(INSTALL) -m 644 $(BUILTINS:%=modules/%.a) $(DESTDIR)$(libdir)/vlc
204 rm -f $(DESTDIR)$(libdir)/vlc/*.a
205 -rmdir $(DESTDIR)$(libdir)/vlc
208 mkdir -p $(DESTDIR)$(bindir)
209 $(INSTALL) vlc-config $(DESTDIR)$(bindir)
210 mkdir -p $(DESTDIR)$(includedir)/vlc
211 $(INSTALL) -m 644 include/vlc/*.h $(DESTDIR)$(includedir)/vlc
212 mkdir -p $(DESTDIR)$(libdir)
213 $(INSTALL) -m 644 lib/libvlc.a $(DESTDIR)$(libdir)
216 rm -f $(DESTDIR)$(bindir)/vlc-config
217 rm -Rf $(DESTDIR)$(includedir)/vlc
218 rm -f $(DESTDIR)$(libdir)/libvlc.a
222 -cd mozilla && $(MAKE) install
227 -cd mozilla && $(MAKE) uninstall
231 -cd po && $(MAKE) install
234 -cd po && $(MAKE) uninstall
237 # Package generation rules
240 # Check that tmp isn't in the way
241 @if test -e tmp; then \
242 echo "Error: please remove ./tmp, it is in the way"; false; \
244 echo "OK."; mkdir tmp; \
246 # Copy directory structure in tmp
247 find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
248 do mkdir -p tmp/vlc/$$i ; \
251 find debian -mindepth 1 -maxdepth 1 -type d | \
252 while read i ; do rm -Rf tmp/vlc/$$i ; done
253 # Copy .c .h .in .cpp .m and .glade files
254 find include src modules -type f -name '*.[bcdhigmrst]*' | while read i ; \
255 do cp $$i tmp/vlc/$$i ; done
256 # Grmbl... special case...
257 for i in API BUGS DESIGN TODO ; \
258 do cp modules/mad/$$i tmp/vlc/modules/mad ; done
259 # Copy plugin Makefiles
260 find modules -type f -name Makefile | while read i ; \
261 do cp $$i tmp/vlc/$$i ; done
262 # Copy extra programs and documentation
263 cp -a extras/* tmp/vlc/extras
264 cp -a doc/* tmp/vlc/doc
265 find tmp/vlc/extras tmp/vlc/doc \
266 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
267 while read i ; do rm -Rf $$i ; done
269 cp po/ChangeLog po/vlc.pot po/*.po tmp/vlc/po
270 for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
272 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
273 ABOUT-NLS BUGS MODULES vlc.spec \
274 Makefile Makefile.*.in Makefile.dep Makefile.modules \
275 configure configure.in install-sh install-win32 macosx-dmg \
276 config.sub config.guess aclocal.m4 mkinstalldirs \
278 # Copy Debian control files
279 for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
280 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
281 for file in control changelog rules ; do \
282 cp debian/$$file tmp/vlc/debian/ ; done
283 # Copy ipkg control files
284 for file in control rules patch ; do \
285 cp ipkg/$$file tmp/vlc/ipkg/ ; done
286 # Copy fonts and icons
287 for file in share/*vlc* share/*psf; do \
288 cp $$file tmp/vlc/share ; done
291 mv tmp/vlc tmp/$$F; (cd tmp ; \
292 cd $$F && $(MAKE) distclean && cd .. ; \
293 tar czf ../$$F.tar.gz $$F);
298 # XXX: this rule is probably only useful to you if you have exactly
299 # the same setup as me. Contact sam@zoy.org if you need to use it.
301 # Check that tmp isn't in the way
302 @if test -e tmp; then \
303 echo "Error: please remove ./tmp, it is in the way"; false; \
305 echo "OK."; mkdir tmp; \
307 # Create installation script
308 cp install-win32 tmp/nsi
309 # Copy relevant files
312 cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
313 for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
314 do cp $$file tmp/$${file}.txt ; \
315 unix2dos tmp/$${file}.txt ; done
317 cp $(PLUGINS:%=modules/%.so) tmp/modules/
318 # don't include these two
319 #rm -f tmp/modules/gtk.so tmp/modules/sdl.so
321 for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/modules/$$i.so ; fi ; done
324 for file in default8x16.psf default8x9.psf ; \
325 do cp share/$$file tmp/share/ ; done
327 wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe -- /DVERSION=${VERSION} /CD tmp/nsi
332 # Check that tmp isn't in the way
333 @if test -e tmp; then \
334 echo "Error: please remove ./tmp, it is in the way"; false; \
336 echo "OK."; mkdir tmp; \
340 mkdir -p tmp/vlc/share
341 # Copy relevant files
344 xres -o tmp/vlc/vlc ./share/vlc_beos.rsrc
345 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
346 for file in default8x16.psf default8x9.psf ; \
347 do cp share/$$file tmp/vlc/share/ ; done
348 mkdir tmp/vlc/modules
349 cp $(PLUGINS:%=modules/%.so) tmp/vlc/modules/
350 strip $(PLUGINS:%=tmp/vlc/modules/%.so)
352 mv tmp/vlc tmp/vlc-${VERSION}
353 (cd tmp ; find vlc-${VERSION} | \
354 zip -9 -@ vlc-${VERSION}-BeOS-x86.zip )
355 mv tmp/vlc-${VERSION}-BeOS-x86.zip .
360 # Check that tmp isn't in the way
361 @if test -e tmp; then \
362 echo "Error: please remove ./tmp, it is in the way"; false; \
364 echo "OK."; mkdir tmp; \
367 # Copy relevant files
369 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp/
372 ./macosx-dmg 0 "vlc-${VERSION}" tmp/*
378 # Gtk/Gnome/* aliases and OS X application
380 gnome-vlc gvlc kvlc qvlc: vlc
381 rm -f $@ && ln -s vlc $@
385 ifneq (,$(findstring darwin,$(SYS)))
387 cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
388 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
389 $(INSTALL) -d vlc.app/Contents/MacOS/share
390 $(INSTALL) -d vlc.app/Contents/MacOS/modules
391 $(INSTALL) vlc vlc.app/Contents/MacOS/
393 $(INSTALL) $(PLUGINS:%=modules/%.so) vlc.app/Contents/MacOS/modules
395 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
401 # Generic rules (see below)
403 src/misc/modules_builtin.h: Makefile.opts Makefile Makefile.config
404 @echo "make[$(MAKELEVEL)]: Creating \`$@'"
405 @rm -f $@ && cp $@.in $@
407 @for i in $(BUILTINS) ; do \
408 echo "int vlc_entry__"`basename $$i`"( module_t* );" >>$@; \
412 @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
413 @echo " do \\" >> $@ ;
414 @echo " { \\" >> $@ ;
416 @for i in $(BUILTINS) ; do \
417 echo " ALLOCATE_BUILTIN("`basename $$i`"); \\" >> $@ ; \
420 @echo " } while( 0 );" >> $@ ;
424 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
426 $(CPP_DEP): %.dpp: FORCE
427 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
429 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
430 $(C_OBJ): %.o: $(H_OBJ)
431 $(C_OBJ): %.o: .dep/%.d
433 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
435 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
436 $(CPP_OBJ): %.o: $(H_OBJ)
437 $(CPP_OBJ): %.o: .dep/%.dpp
438 $(CPP_OBJ): %.o: %.cpp
439 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
441 $(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile
442 $(M_OBJ): %.o: $(H_OBJ)
443 $(M_OBJ): %.o: .dep/%.dm
445 $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $<
447 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
448 ifneq (,(findstring mingw32,$(SYS)))
449 $(RESOURCE_OBJ): %.o: %.rc
450 $(WINDRES) -i $< -o $@
454 # Main application target
456 vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
457 $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(LDFLAGS) $(vlc_LDFLAGS) $(BUILTIN_OBJ) $(builtins_LDFLAGS)
459 xres -o $@ ./share/vlc_beos.rsrc
464 # Main library target
466 lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
468 ar rc $@ $(LIBVLC_OBJ)
472 # DO NOT DISTRIBUTE SHARED VERSIONS OF LIBVLC UNTIL THE ABI IS STABLE
473 # OR BURN IN HELL -- Sam
475 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
476 # $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
478 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
479 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
481 modules/%.a modules/%.so: $(H_OBJ) FORCE
482 @cd $(shell echo $@ | sed -e 's@\(.*\)/.*@\1@') && $(MAKE) -f $(shell echo $@ | sed -e 's@[^/]*/@../@g' -e 's@\(.*\)/.*@\1@')/Makefile.modules $(shell echo $@ | sed -e 's@.*/@@') PARENT=$(shell echo $@ | sed -e 's@[^/]*/@../@g' -e 's@\(.*\)/.*@\1@')
485 # Mozilla plugin target
487 mozilla/libvlcplugin.so: FORCE
489 @cd mozilla && $(MAKE) builtins_LDFLAGS="$(builtins_LDFLAGS)"