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