1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
5 # SUBDIRS stores the directories where a "make" is required when building
6 # something. DIST_SUBDIRS stores the directories where nothing is built but
7 # which have makefiles with distribution information.
8 SUBDIRS = po intl m4 share
9 DIST_SUBDIRS = $(SUBDIRS) modules src debian doc ipkg lib
11 EXTRA_DIST = BUGS FAQ HACKING MAINTAINERS STATUS \
12 INSTALL.win32 README.MacOSX.rtf vlc.spec install-win32 \
13 Modules.am macosx-dmg \
14 configure.ac.in mkinstalldirs bootstrap
19 # List of programs, libraries and headers that need to be built and/or
20 # distributed. Initialized to empty because we'll use += later.
29 # Tell aclocal to use -I m4. Wonder if it really works.
30 ACLOCAL_AMFLAGS = -I m4
32 # XXX: these flags could be set in configure.ac.in, but we set them here
33 # because old versions of automake don't support them in configure.ac.
34 AUTOMAKE_OPTIONS = foreign dist-bzip2 subdir-objects
36 ###############################################################################
37 # Compilation flags for debug mode, profiling, and others
38 ###############################################################################
40 # Standard flags used everywhere to build things in the distribution. Some
41 # of them are empty but might be extended later in the Makefile. *_default
42 # is the default flag list for all files in the distribution, for instance
43 # the vlc code. *_pic is for PIC code, such as the Mozilla plugin. *_plugin
44 # is for plugin code, *_builtin is for builtin code, and *_builtin_pic is
45 # for PIC builtin code, for instance builtin modules in the mozilla plugin.
47 CPPFLAGS_default = -I$(top_srcdir)/include
53 CPPFLAGS_pic = $(CPPFLAGS_default)
54 CFLAGS_pic = $(CFLAGS_default) @CFLAGS_pics@
55 CXXFLAGS_pic = $(CXXFLAGS_default) @CFLAGS_pics@
56 OBJCFLAGS_pic = $(OBJCFLAGS_default) @CFLAGS_pics@
57 LDFLAGS_pic = $(LDFLAGS_default)
59 CPPFLAGS_plugin = $(CPPFLAGS_default) -D__VLC__ -D__PLUGIN__
60 CFLAGS_plugin = $(CFLAGS_default) @CFLAGS_plugins@
61 CXXFLAGS_plugin = $(CXXFLAGS_default) @CFLAGS_plugins@
62 OBJCFLAGS_plugin = $(OBJCFLAGS_default) @CFLAGS_plugins@
63 LDFLAGS_plugin = @LDFLAGS_plugins@
65 CPPFLAGS_builtin = $(CPPFLAGS_default) -D__VLC__ -D__BUILTIN__
66 CFLAGS_builtin = $(CFLAGS_default) @CFLAGS_builtins@
67 CXXFLAGS_builtin = $(CXXFLAGS_default) @CFLAGS_builtins@
68 OBJCFLAGS_builtin = $(OBJCFLAGS_default) @CFLAGS_builtins@
72 CPPFLAGS_builtin_pic = $(CPPFLAGS_builtin) $(CPPFLAGS_pic)
73 CFLAGS_builtin_pic = $(CFLAGS_builtin) $(CFLAGS_pic)
74 CXXFLAGS_builtin_pic = $(CXXFLAGS_builtin) $(CXXFLAGS_pic)
75 OBJCFLAGS_builtin_pic = $(OBJCFLAGS_builtin) $(OBJCFLAGS_pic)
76 LDFLAGS_builtin_pic = $(LDFLAGS_builtin) $(LDFLAGS_pic)
77 L_builtin_pic = $(L_builtin) $(L_pic)
79 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
80 CPPFLAGS_default += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE
81 CPPFLAGS_default += -D_REENTRANT -D_THREAD_SAFE
82 CPPFLAGS_default += -D_GNU_SOURCE
85 CPPFLAGS_default += -DLOCALEDIR=\"$(datadir)/locale\"
87 # Data and plugin location
88 CPPFLAGS_default += -DDATA_PATH=\"@prefix@/share/vlc\"
89 CPPFLAGS_default += -DPLUGIN_PATH=\"@prefix@/lib/vlc\"
91 # Conditional flags that get added to *FLAGS_default
93 CPPFLAGS_release = -DHAVE_RELEASE
96 CPPFLAGS_debug = -DDEBUG -DHAVE_RELEASE
100 CPPFLAGS_gprof = -DGPROF
101 CFLAGS_gprof = -finstrument-functions
104 CPPFLAGS_cprof = -DCPROF
108 CFLAGS_optim = @CFLAGS_OPTIM@ @CFLAGS_TUNING@
115 CFLAGS_nodebug = @CFLAGS_OPTIM_NODEBUG@
121 CPPFLAGS_default += $(CPPFLAGS_release) \
122 $(CPPFLAGS_debug) $(CPPFLAGS_gprof) $(CPPFLAGS_cprof)
123 CFLAGS_default += $(CFLAGS_optim) $(CFLAGS_nodebug) \
124 $(CFLAGS_debug) $(CFLAGS_gprof) $(CFLAGS_cprof)
125 CXXFLAGS_default += $(CFLAGS_optim) $(CFLAGS_nodebug) \
126 $(CFLAGS_debug) $(CFLAGS_gprof) $(CFLAGS_cprof)
127 OBJCFLAGS_default += $(CFLAGS_optim) $(CFLAGS_nodebug) \
128 $(CFLAGS_debug) $(CFLAGS_gprof) $(CFLAGS_cprof)
130 ###############################################################################
132 ###############################################################################
135 include/vlc_symbols.h \
136 src/misc/modules_builtin.h \
137 src/misc/modules_plugin.h
139 pkgincludedir = $(includedir)/vlc
141 dist_pkginclude_HEADERS = \
146 include/vlc/decoder.h \
147 include/vlc/input.h \
150 noinst_HEADERS += $(HEADERS_include) $(HEADERS_include_built)
153 include/aout_internal.h \
154 include/audio_output.h \
155 include/beos_specific.h \
156 include/configuration.h \
157 include/darwin_specific.h \
159 include/input_ext-dec.h \
160 include/input_ext-intf.h \
161 include/input_ext-plugins.h \
162 include/interface.h \
163 include/intf_eject.h \
168 include/modules_inner.h \
172 include/os_specific.h \
173 include/stream_control.h \
174 include/stream_output.h \
175 include/variables.h \
177 include/video_output.h \
178 include/vlc_common.h \
179 include/vlc_config.h \
181 include/vlc_messages.h \
182 include/vlc_objects.h \
183 include/vlc_playlist.h \
184 include/vlc_threads.h \
185 include/vlc_threads_funcs.h \
186 include/win32_specific.h
188 HEADERS_include_built = \
189 include/vlc_symbols.h
191 include/vlc_symbols.h: Makefile $(HEADERS_include)
193 echo '/* DO NOT EDIT THIS FILE! See Makefile.am */' >> $@.in
194 echo 'struct module_symbols_t {' >> $@.in
195 cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' >> $@.in
197 echo '#ifdef __PLUGIN__' >> $@.in
198 cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' >> $@.in
199 echo '#endif /* __PLUGIN__ */' >> $@.in
202 src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
203 rm -f $@.tmp && cp $@.in $@.tmp
204 sed -e 's#.*\$[I][d]:.*# * Automatically generated from '$@'.in by bootstrap#' < $@.in > $@.tmp
205 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $@.tmp
206 cat $(HEADERS_include) | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $@.tmp
210 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
211 rm -f $@.tmp && cp $@.in $@.tmp
213 for i in $(BUILTINS) ; do echo "int vlc_entry__"`echo $$i | sed -e 'y@/@_@' -e 's@\..*@@'`"( module_t* );" >>$@.tmp; done
216 echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@.tmp
217 echo " do \\" >> $@.tmp
218 echo " { \\" >> $@.tmp
220 for i in $(BUILTINS) ; do echo " ALLOCATE_BUILTIN("`echo $$i | sed -e 'y@/@_@' -e 's@\..*@@'`"); \\" >> $@.tmp ; done
222 echo " } while( 0 );" >> $@.tmp
226 # These dependencies are mandatory
227 $(SOURCES): include/vlc_symbols.h
228 $(SOURCES_libvlc): src/misc/modules_plugin.h src/misc/modules_builtin.h
230 ###############################################################################
232 ###############################################################################
235 extras/GNUgetopt/COPYING \
236 extras/GNUgetopt/getopt.c \
237 extras/GNUgetopt/getopt.h \
238 extras/GNUgetopt/getopt1.c
241 SOURCES_libgetopt = extras/GNUgetopt/getopt.c extras/GNUgetopt/getopt1.c
244 ###############################################################################
246 ###############################################################################
249 extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib \
250 extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib \
251 extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib \
252 extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
253 extras/MacOSX/Resources/divx.icns \
254 extras/MacOSX/Resources/generic.icns \
255 extras/MacOSX/Resources/mpeg.icns \
256 extras/MacOSX/Resources/mpeg1.icns \
257 extras/MacOSX/Resources/mpeg2.icns \
258 extras/MacOSX/Resources/mpeg4.icns \
259 extras/MacOSX/Resources/vlc.icns \
260 extras/MacOSX/Resources/pause.png \
261 extras/MacOSX/Resources/play.png \
262 extras/MacOSX/Resources/stop.png \
263 extras/MacOSX/Resources/stepf.png \
264 extras/MacOSX/Resources/stepr.png \
265 extras/MacOSX/vlc.pbproj/project.pbxproj
267 ###############################################################################
269 ###############################################################################
271 bin_SCRIPTS = vlc-config
273 lib_LIBRARIES += lib/libvlc.a $(LIBRARIES_libvlc_pic)
275 lib_libvlc_a_SOURCES = $(SOURCES_libvlc)
276 lib_libvlc_a_CFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CFLAGS_default) @CFLAGS_vlc@
277 lib_libvlc_a_CXXFLAGS = $(CPPFLAGS_default) -D__VLC__ $(CXXFLAGS_default)
279 lib_libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
280 lib_libvlc_pic_a_CFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CFLAGS_pic) @CFLAGS_vlc@
281 lib_libvlc_pic_a_CXXFLAGS = $(CPPFLAGS_pic) -D__VLC__ $(CXXFLAGS_pic)
284 SOURCES_libvlc_beos = src/misc/beos_specific.cpp
287 SOURCES_libvlc_darwin = src/misc/darwin_specific.c
290 SOURCES_libvlc_win32 = src/misc/win32_specific.c
293 LIBRARIES_libvlc_pic = lib/libvlc_pic.a
297 src/misc/beos_specific.cpp \
298 src/misc/darwin_specific.c \
299 src/misc/win32_specific.c
304 src/interface/interface.c \
305 src/interface/intf_eject.c \
306 src/playlist/playlist.c \
308 src/input/input_ext-plugins.c \
309 src/input/input_ext-dec.c \
310 src/input/input_ext-intf.c \
311 src/input/input_dec.c \
312 src/input/input_programs.c \
313 src/input/input_clock.c \
314 src/input/input_info.c \
315 src/video_output/video_output.c \
316 src/video_output/vout_pictures.c \
317 src/video_output/vout_pictures.h \
318 src/video_output/video_text.c \
319 src/video_output/video_text.h \
320 src/video_output/vout_subpictures.c \
321 src/audio_output/common.c \
322 src/audio_output/dec.c \
323 src/audio_output/filters.c \
324 src/audio_output/input.c \
325 src/audio_output/mixer.c \
326 src/audio_output/output.c \
327 src/audio_output/intf.c \
328 src/stream_output/stream_output.c \
333 src/misc/configuration.c \
334 src/misc/netutils.c \
335 src/misc/iso_lang.c \
336 src/misc/iso-639.def \
337 src/misc/messages.c \
339 src/misc/variables.c \
342 $(SOURCES_libvlc_win32) \
343 $(SOURCES_libvlc_beos) \
344 $(SOURCES_libvlc_darwin)
346 ###############################################################################
348 ###############################################################################
352 vlc_SOURCES = src/vlc.c $(SOURCES_libgetopt)
354 # @AUTOMAKE_SUCKS@ gets expanded to $(L_builtin) $(LDFLAGS_builtin)
355 # but we don't write it directly, otherwise automake will go amok and eat all
356 # the memory because of its 2^N crap algorithm. So we fool him. Nuahaha.
357 vlc_LDADD = lib/libvlc.a $(LDFLAGS_vlc) $(DATA_win32_rc) @AUTOMAKE_SUCKS@
358 vlc_CFLAGS = $(CPPFLAGS_default) $(CFLAGS_default)
360 # We use DEPENDENCIES_vlc instead of vlc_DEPENDENCIES because of an
361 # old automake-1.5 bug (automake/279).
362 DEPENDENCIES_vlc = lib/libvlc.a $(L_builtin) $(DATA_win32_rc)
364 vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc)
366 $(LINK) $(vlc_LDFLAGS) $(vlc_OBJECTS) $(vlc_LDADD) $(LIBS)
368 xres -o $@ ./share/vlc_beos.rsrc
372 # Install the symlinks
374 for i in dummy $(ALIASES) ; do if test "x$$i" != "xdummy" ; then \
375 rm -f $(DESTDIR)$(bindir)/$$i && \
376 ln -s vlc $(DESTDIR)$(bindir)/$$i ; \
380 # Create the MacOS X app
381 vlc_app_DATA = vlc.app
382 vlc_appdir = $(bindir)
385 cd extras/MacOSX ; pbxbuild | grep -v '^[ \t]' | grep -v "^$$"
386 cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
387 $(INSTALL) -d vlc.app/Contents/MacOS/share
388 $(INSTALL) -d vlc.app/Contents/MacOS/modules
389 $(INSTALL) vlc vlc.app/Contents/MacOS/
390 # FIXME: install modules ! (and add dependency on modules)
391 $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
395 DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA)
396 noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT)
397 noinst_share_vlc_win32_rcdir = $(libdir)
398 share/vlc_win32_rc.$(OBJEXT): share/vlc_win32_rc.rc
399 $(WINDRES) -i $< -o $@
402 ###############################################################################
403 # Building the Mozilla plugin
404 ###############################################################################
406 noinst_LIBRARIES += $(noinst_LIBRARIES_mozilla)
408 MOSTLYCLEANFILES += mozilla/libvlcplugin$(LIBEXT)
410 EXTRA_DIST += $(SOURCES_mozilla) mozilla/vlcintf.idl
412 BUILT_SOURCES += $(BUILT_SOURCES_mozilla)
415 mozilla/vlcshell.cpp \
416 mozilla/vlcplugin.cpp \
417 mozilla/vlcplugin.h \
418 mozilla/vlcpeer.cpp \
420 mozilla/classinfo.h \
424 noinst_LIBRARIES_mozilla = mozilla/libvlcplugin.a
426 mozilla_libvlcplugin_a_SOURCES = $(SOURCES_mozilla) $(BUILT_SOURCES_mozilla) \
428 mozilla_libvlcplugin_a_CFLAGS = $(CPPFLAGS_pic) $(CFLAGS_pic) \
429 $(CPPFLAGS_mozilla) $(CFLAGS_mozilla)
430 mozilla_libvlcplugin_a_CXXFLAGS = $(CPPFLAGS_pic) $(CXXFLAGS_pic) \
431 $(CPPFLAGS_mozilla) $(CXXFLAGS_mozilla)
432 mozilla_libvlcplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(L_builtin_pic)
434 BUILT_SOURCES_mozilla = mozilla/vlcintf.h
435 $(SOURCES_mozilla): mozilla/vlcintf.h
437 mozilla_libvlcplugin_DATA = mozilla/libvlcplugin$(LIBEXT)
438 mozilla_libvlcplugindir = $(libdir)/mozilla/plugins
439 mozilla/libvlcplugin$(LIBEXT): mozilla/libvlcplugin.a $(L_builtin_pic)
440 $(CC) -o $@ $(mozilla_libvlcplugin_a_OBJECTS) lib/libvlc_pic.a \
441 $(L_builtin_pic) -shared $(LDFLAGS) $(LDFLAGS_vlc) \
442 $(LDFLAGS_mozilla) $(LDFLAGS_builtin_pic)
444 mozilla_vlcintf_xpt_DATA = mozilla/vlcintf.xpt
445 mozilla_vlcintf_xptdir = $(libdir)/mozilla/components
446 mozilla/vlcintf.xpt: Makefile mozilla/vlcintf.idl
447 $(XPIDL) -I/usr/share/idl/mozilla -m typelib \
448 -o mozilla/vlcintf mozilla/vlcintf.idl
450 mozilla/vlcintf.h: Makefile mozilla/vlcintf.idl
451 $(XPIDL) -I/usr/share/idl/mozilla -m header \
452 -o mozilla/vlcintf mozilla/vlcintf.idl
455 ###############################################################################
457 ###############################################################################
458 libvlcdir = $(libdir)/vlc