]> git.sesse.net Git - vlc/blob - src/Makefile.am
pkg-config for the plugin API
[vlc] / src / Makefile.am
1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
4
5 AUTOMAKE_OPTIONS = subdir-objects
6
7 NULL =
8 EXTRA_DIST = extras/COPYING modules/builtin.h.in libvlc.sym vlc-control.pc.in
9
10 BUILT_SOURCES = modules/builtin.h misc/revision.c ../include/vlc_about.h
11 CLEANFILES = $(BUILT_SOURCES)
12
13 SUFFIXES = .pc.in .pc
14
15 ###############################################################################
16 # Headers
17 ###############################################################################
18
19 pkgincludedir = $(includedir)/vlc
20
21 dist_pkginclude_HEADERS = \
22         ../include/vlc/vlc.h \
23         ../include/vlc/libvlc.h \
24         ../include/vlc/libvlc_structures.h \
25         ../include/vlc/mediacontrol.h \
26         ../include/vlc/mediacontrol_structures.h \
27         $(NULL)
28
29 noinst_HEADERS = $(HEADERS_include)
30
31 HEADERS_include = \
32         ../include/iso_lang.h \
33         ../include/main.h \
34         ../include/mmx.h \
35         ../include/vlc_access.h \
36         ../include/vlc_acl.h \
37         ../include/vlc_aout.h \
38         ../include/vlc_arrays.h \
39         ../include/vlc_bits.h \
40         ../include/vlc_block.h \
41         ../include/vlc_block_helper.h \
42         ../include/vlc_charset.h \
43         ../include/vlc_codec.h \
44         ../include/vlc_codec_synchro.h \
45         ../include/vlc_codecs.h \
46         ../include/vlc_common.h \
47         ../include/vlc_config.h \
48         ../include/vlc_config_cat.h \
49         ../include/vlc_configuration.h \
50         ../include/vlc_demux.h \
51         ../include/vlc_devices.h \
52         ../include/vlc_epg.h \
53         ../include/vlc_es.h \
54         ../include/vlc_es_out.h \
55         ../include/vlc_events.h \
56         ../include/vlc_filter.h \
57         ../include/vlc_fixups.h \
58         ../include/vlc_httpd.h \
59         ../include/vlc_image.h \
60         ../include/vlc_input.h \
61         ../include/vlc_interface.h \
62         ../include/vlc_intf_strings.h \
63         ../include/vlc_keys.h \
64         ../include/vlc_md5.h \
65         ../include/vlc_messages.h \
66         ../include/vlc_meta.h \
67         ../include/vlc_modules.h \
68         ../include/vlc_modules_macros.h \
69         ../include/vlc_mtime.h \
70         ../include/vlc_network.h \
71         ../include/vlc_objects.h \
72         ../include/vlc_osd.h \
73         ../include/vlc_pgpkey.h \
74         ../include/vlc_playlist.h \
75         ../include/vlc_plugin.h \
76         ../include/vlc_rand.h \
77         ../include/vlc_services_discovery.h \
78         ../include/vlc_sout.h \
79         ../include/vlc_stream.h \
80         ../include/vlc_streaming.h \
81         ../include/vlc_strings.h \
82         ../include/vlc_threads.h \
83         ../include/vlc_threads_funcs.h \
84         ../include/vlc_tls.h \
85         ../include/vlc_update.h \
86         ../include/vlc_url.h \
87         ../include/vlc_variables.h \
88         ../include/vlc_vlm.h \
89         ../include/vlc_vod.h \
90         ../include/vlc_vout.h \
91         ../include/vlc_xml.h \
92         $(NULL)
93
94 modules/builtin.h: modules/builtin.h.in ../vlc-config Makefile.am
95         rm -f -- "$@.tmp"
96         cat "$(srcdir)/modules/builtin.h.in" > "$@.tmp"
97 if !HAVE_PLUGINS
98         plugins="$$($(VLC_CONFIG) --list plugin)" ; \
99         test -n "$${plugins}" && \
100         for p in $${plugins}; do \
101                 echo "int vlc_entry__$$p (module_t *);" ; \
102         done >> "$@.tmp"
103 endif
104         echo "#define ALLOCATE_ALL_BUILTINS() \\" >> "$@.tmp"
105         echo "    do \\" >> "$@.tmp"
106         echo "    { \\" >> "$@.tmp"
107 if !HAVE_PLUGINS
108         plugins="$$($(VLC_CONFIG) --list plugin)" ; \
109         test -n "$${plugins}" && \
110         for p in $${plugins}; do \
111                 echo "        ALLOCATE_BUILTIN($$p); \\" ; \
112         done >> "$@.tmp"
113 endif
114         echo '    } while( 0 );' >> "$@.tmp"
115         mv -f -- "$@.tmp" "$@"
116
117 modules/modules.c: modules/builtin.h
118
119 ../include/vlc_about.h: Makefile.am $(top_srcdir)/COPYING $(top_srcdir)/THANKS $(top_srcdir)/AUTHORS
120         rm -f -- "$@.tmp"
121         mkdir -p -- ../include
122         echo "/* Automatically generated file - DO NOT EDIT */" > "$@.tmp"
123         echo "static const char psz_license[] =" >> "$@.tmp"
124         cat $(top_srcdir)/COPYING | sed s/'"'/'\\"'/g | $(AWK) '{ print "\""$$0"\\n\"" }' >> "$@.tmp"
125         echo ";" >> "$@.tmp"
126         echo "static const char psz_thanks[] =" >> "$@.tmp"
127         grep -v '$$Id:'  $(top_srcdir)/THANKS | sed s/'"'/'\\"'/g | $(AWK) '{ print "\""$$0"\\n\"" }'|sed s/"<.*.> "// >> "$@.tmp"
128         echo ";" >> "$@.tmp"
129         echo "static const char psz_authors[] =" >> "$@.tmp"
130         grep N: $(top_srcdir)/AUTHORS | cut -d" " -f 2- | sed s/'"'/'\\"'/g | $(AWK) '{ print "\""$$0"\\n\"" }' >> "$@.tmp"
131         echo ";" >> "$@.tmp"
132         mv -f -- "$@.tmp" "$@"
133
134 ###############################################################################
135 # pkg-config integration
136 ###############################################################################
137
138 pkgconfigdir = $(libdir)/pkgconfig
139 pkgconfig_DATA = vlc-control.pc vlc-plugin.pc
140 CLEANFILES += $(pkgconfig_DATA)
141
142 vlc-control.pc: vlc-control.pc.in $(top_builddir)/config.status
143         cd $(top_builddir) && \
144         $(SHELL) ./config.status --file=src/vlc-control.pc
145
146 .pc.in.pc: $(top_builddir)/config.status
147         cd "$(top_builddir)" && \
148         $(SHELL) ./config.status --file="src/$@"
149
150 ###############################################################################
151 # Building libvlc
152 ###############################################################################
153
154 nice:
155         $(top_builddir)/compile
156
157 lib_LTLIBRARIES = libvlc.la libvlc-control.la
158
159 AM_LDFLAGS = -no-undefined -no-install
160 if HAVE_WIN32
161 AM_LDFLAGS += -avoid-version
162 endif
163
164 libvlc_la_SOURCES = $(SOURCES_libvlc)
165 nodist_libvlc_la_SOURCES = misc/revision.c
166 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc` \
167         -DLOCALEDIR=\"$(localedir)\" \
168         -DDATA_PATH=\"$(pkgdatadir)\" \
169         -DPLUGIN_PATH=\"$(pkglibdir)\"
170 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
171 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc`
172 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --ldflags libvlc` $(AM_LDFLAGS) \
173         -version-info 1:0:0
174 if HAVE_COMPILER_EXPORT
175 libvlc_la_LDFLAGS += -export-dynamic
176 else
177 libvlc_la_LDFLAGS += -export-symbols $(srcdir)/libvlc.sym 
178 endif
179 libvlc_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` $(AM_LIBADD) $(LTLIBINTL)
180
181 libvlc_la_DEPENDENCIES = libvlc.sym
182
183 libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
184 libvlc_control_la_LIBADD = libvlc.la
185 libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
186 libvlc_control_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
187 if HAVE_COMPILER_EXPORT
188 libvlc_control_la_LDFLAGS += -export-dynamic
189 else
190 libvlc_control_la_LDFLAGS += -export-symbols-regex '^_?(libvlc|mediacontrol)_.*'
191 endif
192
193 EXTRA_libvlc_la_SOURCES = \
194         $(SOURCES_libvlc_beos) \
195         $(SOURCES_libvlc_darwin) \
196         $(SOURCES_libvlc_win32) \
197         $(SOURCES_libvlc_dirent) \
198         $(SOURCES_libvlc_getopt) \
199         $(NULL)
200 if HAVE_BEOS
201 libvlc_la_SOURCES += $(SOURCES_libvlc_beos)
202 endif
203 if HAVE_DARWIN
204 libvlc_la_SOURCES += $(SOURCES_libvlc_darwin)
205 endif
206 if HAVE_WIN32
207 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
208 endif
209 if HAVE_WINCE
210 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
211 endif
212 if BUILD_DIRENT
213 libvlc_la_SOURCES += $(SOURCES_libvlc_dirent)
214 endif
215 if BUILD_GETOPT
216 libvlc_la_SOURCES += $(SOURCES_libvlc_getopt)
217 endif
218
219 SOURCES_libvlc_beos = \
220         misc/beos_specific.cpp \
221         $(NULL)
222
223 SOURCES_libvlc_darwin = \
224         misc/darwin_specific.c \
225         $(NULL)
226
227 SOURCES_libvlc_win32 = \
228         misc/win32_specific.c \
229         $(NULL)
230
231 SOURCES_libvlc_dirent = \
232         extras/dirent.c \
233         $(NULL)
234
235 SOURCES_libvlc_getopt = \
236         extras/getopt.c \
237         extras/getopt.h \
238         extras/getopt1.c \
239         $(NULL)
240
241 SOURCES_libvlc_common = \
242         libvlc.c \
243         libvlc-common.c \
244         libvlc.h \
245         libvlc-module.c \
246         interface/interface.c \
247         interface/intf_eject.c \
248         interface/interaction.c \
249         playlist/playlist_internal.h \
250         playlist/thread.c \
251         playlist/control.c \
252         playlist/engine.c \
253         playlist/sort.c \
254         playlist/loadsave.c \
255         playlist/tree.c \
256         playlist/item.c \
257         playlist/search.c \
258         playlist/services_discovery.c \
259         input/item.c \
260         input/access.c \
261         input/clock.c \
262         input/control.c \
263         input/decoder.c \
264         input/decoder_synchro.c \
265         input/demux.c \
266         input/es_out.c \
267         input/input.c \
268         input/meta.c \
269         input/input_internal.h \
270         input/vlm_internal.h \
271         input/stream.c \
272         input/mem_stream.c \
273         input/subtitles.c \
274         input/var.c \
275         video_output/video_output.c \
276         video_output/vout_pictures.c \
277         video_output/vout_pictures.h \
278         video_output/video_text.c \
279         video_output/video_widgets.c \
280         video_output/vout_subpictures.c \
281         video_output/vout_intf.c \
282         audio_output/aout_internal.h \
283         audio_output/common.c \
284         audio_output/dec.c \
285         audio_output/filters.c \
286         audio_output/input.c \
287         audio_output/mixer.c \
288         audio_output/output.c \
289         audio_output/intf.c \
290         stream_output/stream_output.c \
291         stream_output/stream_output.h \
292         stream_output/announce.c \
293         stream_output/profiles.c \
294         stream_output/sap.c \
295         stream_output/sdp.c \
296         osd/osd.c \
297         osd/osd_text.c \
298         osd/osd_widgets.c \
299         network/acl.c \
300         network/getaddrinfo.c \
301         network/io.c \
302         network/error.c \
303         network/tcp.c \
304         network/udp.c \
305         network/httpd.c \
306         network/rootwrap.c \
307         network/tls.c \
308         network/poll.c \
309         text/charset.c \
310         text/strings.c \
311         text/unicode.c \
312         text/wincp.c \
313         text/iso_lang.c \
314         text/iso-639_def.h \
315         misc/md5.c \
316         misc/rand.c \
317         misc/mtime.c \
318         misc/block.c \
319         modules/modules.h \
320         modules/modules.c \
321         modules/cache.c \
322         modules/entry.c \
323         modules/os.c \
324         misc/threads.c \
325         misc/stats.c \
326         misc/cpu.c \
327         config/configuration.h \
328         config/core.c \
329         config/chain.c \
330         config/file.c \
331         config/intf.c \
332         config/cmdline.c \
333         misc/events.c \
334         misc/image.c \
335         misc/messages.c \
336         misc/objects.c \
337         misc/variables.h \
338         misc/variables.c \
339         misc/error.c \
340         misc/update.c \
341         input/vlm.c \
342         misc/xml.c \
343         misc/devices.c \
344         extras/libc.c \
345         $(NULL)
346
347 SOURCES_libvlc = \
348         $(SOURCES_libvlc_common) \
349         $(OPT_SOURCES_libvlc_beos) \
350         $(OPT_SOURCES_libvlc_darwin) \
351         $(OPT_SOURCES_libvlc_win32) \
352         $(OPT_SOURCES_libvlc_dirent) \
353         $(OPT_SOURCES_libvlc_getopt) \
354         $(NULL)
355
356 SOURCES_libvlc_control = \
357         control/libvlc_internal.h \
358         control/core.c \
359         control/log.c \
360         control/playlist.c \
361         control/vlm.c \
362         control/video.c \
363         control/audio.c \
364         control/dynamic_media_list.c \
365         control/event.c \
366         control/flat_media_list_view.c \
367         control/hierarchical_media_list_view.c \
368         control/hierarchical_node_media_list_view.c \
369         control/media_descriptor.c \
370         control/media_instance.c \
371         control/media_list.c \
372         control/media_list_path.h \
373         control/media_list_player.c \
374         control/media_list_view.c \
375         control/media_library.c \
376         control/mediacontrol_internal.h \
377         control/mediacontrol_core.c \
378         control/mediacontrol_util.c \
379         control/mediacontrol_audio_video.c \
380         control/media_discoverer.c \
381         control/tag_query.c
382
383 ###############################################################################
384 # Stamp rules
385 ###############################################################################
386
387 misc/revision.c:
388         rm -f $@ $@.tmp
389         echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > $@.tmp
390         REVISION="$$((LANG=C git --git-dir=$(top_srcdir)/.git show-ref -s HEAD 2>/dev/null || echo exported) | cut -b -10)"; \
391         echo "const char psz_vlc_changeset[] = \"$$REVISION\";" >> $@.tmp
392         mv -f $@.tmp $@
393
394
395 ###############################################################################
396 # Building vlc
397 ###############################################################################
398
399 if BUILD_VLC
400 bin_PROGRAMS = vlc
401 endif
402
403 vlc_SOURCES = vlc.c
404 vlc_DEPENDENCIES = $(DATA_win32_rc) libvlc.la
405
406 vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
407 vlc_LDFLAGS = `$(VLC_CONFIG) --ldflags vlc`
408 vlc_LDADD = $(DATA_win32_rc) libvlc.la $(LTLIBINTL) `$(VLC_CONFIG) -libs vlc`
409
410 if BUILD_VLC
411 vlc$(EXEEXT): $(vlc_OBJECTS) $(vlc_DEPENDENCIES)
412         @rm -f vlc$(EXEEXT)
413         @case `$(VLC_CONFIG) --linkage vlc builtin` in \
414           c++) cmd="$(CXXLINK)" ;; \
415           objc) cmd="$(OBJCLINK)" ;; \
416           c|*) cmd="$(LINK)" ;; \
417         esac ; \
418         cmd="$$cmd $(vlc_OBJECTS) $(vlc_LDADD) $(vlc_LDFLAGS)" ; \
419         echo $$cmd ; \
420         eval $$cmd
421
422 if HAVE_WIN32
423 DATA_win32_rc = $(noinst_DATA)
424 noinst_DATA = vlc_win32_rc.$(OBJEXT)
425
426 vlc_win32_rc.$(OBJEXT): $(top_srcdir)/share/vlc_win32_rc.rc
427         $(WINDRES) -DVERSION=$(VERSION) -DVERSION_NUMBER=`echo $(VERSION).0.0.0 | sed 's/\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\).*/\1,\2,\3,\4/'` --include-dir $(top_srcdir)/share -i $< -o $@
428 endif
429 endif
430
431 ###############################################################################
432 # Unit/regression test
433 ###############################################################################
434 check_PROGRAMS = \
435         test_dictionary \
436         test_i18n_atof \
437         test_url \
438         test_utf8 \
439         test_headers \
440         test_control \
441         $(NULL)
442
443 dist_check_SCRIPTS = check_symbols
444 TESTS = $(check_PROGRAMS) $(dist_check_SCRIPTS)
445
446 CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc`
447
448 test_dictionary_SOURCES = test/dictionary.c
449 test_dictionary_LDADD = libvlc.la
450 test_dictionary_CFLAGS = $(CFLAGS_tests)
451
452 test_i18n_atof_SOURCES = test/i18n_atof.c text/charset.c
453 test_i18n_atof_LDADD = libvlc.la
454 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
455
456 test_url_SOURCES = test/url.c
457 test_url_LDADD = libvlc.la
458 test_url_CFLAGS = $(CFLAGS_tests)
459
460 test_utf8_SOURCES = test/utf8.c
461 test_utf8_LDADD = libvlc.la
462 test_utf8_CFLAGS = $(CFLAGS_tests)
463
464 test_headers_SOURCES = test/headers.c
465 test_headers_CFLAGS = $(CFLAGS_tests)
466
467 test_control_SOURCES = control/testapi.c
468 test_control_LDADD = libvlc-control.la
469 test_control_CFLAGS = $(CFLAGS_tests)
470
471 check-local:
472         for h in `echo $(dist_pkginclude_HEADERS) $(pkginclude_HEADERS) | sed -e s,\.\./include/,,g`; \
473         do \
474                 echo grep - "#include <$$h>" $(srcdir)/test/headers.c ; \
475                 if ! grep -- "#include <$$h>" $(srcdir)/test/headers.c ; \
476                 then \
477                         echo "Header $$h not included in test/headers.c!"; \
478                         exit 1; \
479                 fi ; \
480         done
481
482 FORCE:
483         @echo "Generated source cannot be phony. Go away." >&2
484         @exit 1
485
486 .PHONY: FORCE