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