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