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