]> git.sesse.net Git - vlc/blob - src/Makefile.am
e93961db7dc18ae02af2473031d645ce468246ca
[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 = \
10         vlc-plugin.pc.in \
11         libvlccore.sym \
12         revision.txt
13
14 BUILT_SOURCES = $(nodist_pluginsinclude_HEADERS)
15 CLEANFILES = $(BUILT_SOURCES)
16
17 SUFFIXES = .pc.in .pc .rc.in .rc
18
19 ###############################################################################
20 # Headers
21 ###############################################################################
22
23 pluginsincludedir = $(pkgincludedir)/plugins
24
25 pluginsinclude_HEADERS = \
26         ../include/vlc_access.h \
27         ../include/vlc_acl.h \
28         ../include/vlc_aout.h \
29         ../include/vlc_aout_intf.h \
30         ../include/vlc_aout_mixer.h \
31         ../include/vlc_arrays.h \
32         ../include/vlc_art_finder.h \
33         ../include/vlc_atomic.h \
34         ../include/vlc_avcodec.h \
35         ../include/vlc_bits.h \
36         ../include/vlc_block.h \
37         ../include/vlc_block_helper.h \
38         ../include/vlc_charset.h \
39         ../include/vlc_codec.h \
40         ../include/vlc_common.h \
41         ../include/vlc_config.h \
42         ../include/vlc_config_cat.h \
43         ../include/vlc_configuration.h \
44         ../include/vlc_cpu.h \
45         ../include/vlc_dialog.h \
46         ../include/vlc_demux.h \
47         ../include/vlc_epg.h \
48         ../include/vlc_es.h \
49         ../include/vlc_es_out.h \
50         ../include/vlc_events.h \
51         ../include/vlc_filter.h \
52         ../include/vlc_fourcc.h \
53         ../include/vlc_fs.h \
54         ../include/vlc_gcrypt.h \
55         ../include/vlc_opengl.h \
56         ../include/vlc_http.h \
57         ../include/vlc_httpd.h \
58         ../include/vlc_image.h \
59         ../include/vlc_inhibit.h \
60         ../include/vlc_input.h \
61         ../include/vlc_input_item.h \
62         ../include/vlc_main.h \
63         ../include/vlc_md5.h \
64         ../include/vlc_messages.h \
65         ../include/vlc_meta.h \
66         ../include/vlc_media_library.h \
67         ../include/vlc_modules.h \
68         ../include/vlc_mouse.h \
69         ../include/vlc_mtime.h \
70         ../include/vlc_network.h \
71         ../include/vlc_objects.h \
72         ../include/vlc_picture.h \
73         ../include/vlc_picture_fifo.h \
74         ../include/vlc_picture_pool.h \
75         ../include/vlc_playlist.h \
76         ../include/vlc_plugin.h \
77         ../include/vlc_probe.h \
78         ../include/vlc_rand.h \
79         ../include/vlc_services_discovery.h \
80         ../include/vlc_sql.h \
81         ../include/vlc_sout.h \
82         ../include/vlc_spu.h \
83         ../include/vlc_stream.h \
84         ../include/vlc_strings.h \
85         ../include/vlc_subpicture.h \
86         ../include/vlc_text_style.h \
87         ../include/vlc_threads.h \
88         ../include/vlc_tls.h \
89         ../include/vlc_url.h \
90         ../include/vlc_variables.h \
91         ../include/vlc_vlm.h \
92         ../include/vlc_video_splitter.h \
93         ../include/vlc_vout.h \
94         ../include/vlc_vout_display.h \
95         ../include/vlc_vout_osd.h \
96         ../include/vlc_vout_window.h \
97         ../include/vlc_xml.h \
98         ../include/vlc_xlib.h \
99         $(NULL)
100 nodist_pluginsinclude_HEADERS = ../include/vlc_about.h
101
102 noinst_HEADERS = \
103         ../include/vlc_codec_synchro.h \
104         ../include/vlc_codecs.h \
105         ../include/vlc_extensions.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_memory.h \
112         ../include/vlc_osd.h \
113         ../include/vlc_pgpkey.h \
114         ../include/vlc_update.h \
115         ../include/vlc_vod.h \
116         ../include/vlc_vout_wrapper.h \
117         ../include/vlc_windows_interfaces.h \
118         $(NULL)
119
120 ../include/vlc_about.h: Makefile.am $(top_srcdir)/COPYING $(top_srcdir)/THANKS $(top_srcdir)/AUTHORS
121         $(AM_V_at)rm -f -- "$@.tmp"
122         $(AM_V_at)mkdir -p -- ../include
123         $(AM_V_GEN)(echo "/* Automatically generated file - DO NOT EDIT */" && \
124         echo "static const char psz_license[] =" && \
125         sed 's/"/\\"/g;s/^.*$$/\"&\\n\"/' "$(top_srcdir)/COPYING" && \
126         echo ";" && \
127         echo "static const char psz_thanks[] =" && \
128         sed '/\$$Id:/d;s/"/\\"/g;s/<.*.> //;s/^.*$$/\"&\\n\"/' \
129                 "$(top_srcdir)/THANKS" && \
130         echo ";" && \
131         echo "static const char psz_authors[] =" && \
132         sed '/\$$Id:/d;s/"/\\"/g;s/<.*.> //;s/^.*$$/\"&\\n\"/' \
133                 "$(top_srcdir)/AUTHORS" && \
134         echo ";") >> "$@.tmp"
135         $(AM_V_at)mv -f -- "$@.tmp" "$@"
136
137 ###############################################################################
138 # pkg-config integration
139 ###############################################################################
140
141 pkgconfigdir = $(libdir)/pkgconfig
142 pkgconfig_DATA = vlc-plugin.pc
143 CLEANFILES += $(pkgconfig_DATA)
144
145 .pc.in.pc: $(top_builddir)/config.status
146         $(AM_V_GEN)cd "$(top_builddir)" && \
147         $(SHELL) ./config.status --file="src/$@"
148
149 ##############################################################################
150 # Windows resource files
151 ##############################################################################
152
153 if HAVE_WIN32
154 noinst_DATA = libvlc_win32_rc.rc
155 endif
156 EXTRA_DIST += libvlc_win32_rc.rc.in
157
158 .rc.in.rc: $(top_builddir)/config.status
159         cd "$(top_builddir)" && \
160         $(SHELL) ./config.status --file="src/$@"
161
162 ###############################################################################
163 # Building libvlc
164 ###############################################################################
165
166 lib_LTLIBRARIES = libvlccore.la
167
168 AM_CPPFLAGS = $(INCICONV) \
169         -DMODULE_STRING=\"main\" \
170         -DLOCALEDIR=\"$(localedir)\" \
171         -DSYSCONFDIR=\"$(sysconfdir)\" \
172         -DDATA_PATH=\"$(vlcdatadir)\" \
173         -DPKGLIBDIR=\"$(vlclibdir)\"
174 AM_CFLAGS = $(CFLAGS_libvlccore)
175
176 libvlccore_la_SOURCES = $(SOURCES_libvlc)
177 libvlccore_la_LDFLAGS = \
178         -no-undefined \
179         $(LDFLAGS_libvlccore) \
180         -no-undefined \
181         -export-symbols $(srcdir)/libvlccore.sym \
182         -version-info 5:0:0
183 libvlccore_la_LIBADD = $(LIBS_libvlccore) \
184         $(LTLIBINTL) $(LTLIBICONV) \
185         $(SOCKET_LIBS) $(LIBDL) $(LIBM) \
186         ../compat/libcompat.la
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) -avoid-version
191 endif
192
193 libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
194         $(WINDRES) --include-dir $(top_srcdir)/share -i $< -o $@
195
196 EXTRA_libvlccore_la_SOURCES = \
197         $(SOURCES_libvlc_darwin) \
198         $(SOURCES_libvlc_linux) \
199         $(SOURCES_libvlc_win32) \
200         $(SOURCES_libvlc_os2) \
201         $(SOURCES_libvlc_other) \
202         $(SOURCES_libvlc_httpd) \
203         $(SOURCES_libvlc_sout) \
204         $(SOURCES_libvlc_vlm) \
205         $(NULL)
206 if HAVE_DARWIN
207 libvlccore_la_SOURCES += $(SOURCES_libvlc_darwin)
208 else
209 if HAVE_LINUX
210 libvlccore_la_SOURCES += $(SOURCES_libvlc_linux)
211 else
212 if HAVE_WIN32
213 libvlccore_la_SOURCES += $(SOURCES_libvlc_win32)
214 else
215 if HAVE_WINCE
216 libvlccore_la_SOURCES += $(SOURCES_libvlc_win32)
217 else
218 if HAVE_SYMBIAN
219 #libvlccore_la_SOURCES += $(SOURCES_libvlc_symbian)
220 else
221 if HAVE_OS2
222 libvlccore_la_SOURCES += $(SOURCES_libvlc_os2)
223 else
224 libvlccore_la_SOURCES += $(SOURCES_libvlc_other)
225 endif
226 endif
227 endif
228 endif
229 endif
230 endif
231 if BUILD_HTTPD
232 libvlccore_la_SOURCES += $(SOURCES_libvlc_httpd)
233 endif
234 if ENABLE_SOUT
235 libvlccore_la_SOURCES += $(SOURCES_libvlc_sout)
236 if ENABLE_VLM
237 libvlccore_la_SOURCES += $(SOURCES_libvlc_vlm)
238 endif
239 endif
240
241 SOURCES_libvlc_darwin = \
242         posix/darwin_dirs.c \
243         misc/atomic.c \
244         posix/filesystem.c \
245         posix/plugin.c \
246         network/poll.c \
247         posix/thread.c \
248         posix/darwin_specific.c \
249         $(NULL)
250
251 SOURCES_libvlc_linux = \
252         posix/dirs.c \
253         misc/atomic.c \
254         posix/filesystem.c \
255         posix/plugin.c \
256         network/poll.c \
257         posix/thread.c \
258         posix/linux_specific.c \
259         $(NULL)
260
261 SOURCES_libvlc_win32 = \
262         win32/dirs.c \
263         win32/atomic.c \
264         win32/filesystem.c \
265         win32/plugin.c \
266         win32/poll.c \
267         win32/thread.c \
268         win32/specific.c \
269         win32/winsock.c \
270         $(NULL)
271
272 SOURCES_libvlc_symbian = \
273         symbian/path.cpp \
274         symbian/dirs.c \
275         misc/atomic.c \
276         win32/plugin.c \
277         $(NULL)
278
279 SOURCES_libvlc_os2 = \
280         os2/dirs.c \
281         misc/atomic.c \
282         posix/filesystem.c \
283         posix/plugin.c \
284         os2/poll.c \
285         os2/thread.c \
286         os2/specific.c \
287         $(NULL)
288
289 SOURCES_libvlc_other = \
290         posix/dirs.c \
291         misc/atomic.c \
292         posix/filesystem.c \
293         network/poll.c \
294         posix/thread.c \
295         posix/specific.c \
296         $(NULL)
297
298 SOURCES_libvlc_common = \
299         libvlc.c \
300         libvlc.h \
301         libvlc-module.c \
302         missing.c \
303         revision.c \
304         version.c \
305         interface/dialog.c \
306         interface/interface.c \
307         interface/intf_eject.c \
308         playlist/playlist_internal.h \
309         playlist/art.c \
310         playlist/art.h \
311         playlist/thread.c \
312         playlist/control.c \
313         playlist/engine.c \
314         playlist/fetcher.c \
315         playlist/fetcher.h \
316         playlist/sort.c \
317         playlist/loadsave.c \
318         playlist/preparser.c \
319         playlist/preparser.h \
320         playlist/tree.c \
321         playlist/item.c \
322         playlist/search.c \
323         playlist/services_discovery.c \
324         input/item.c \
325         input/access.c \
326         input/clock.c \
327         input/control.c \
328         input/decoder.c \
329         input/decoder_synchro.c \
330         input/demux.c \
331         input/es_out.c \
332         input/es_out_timeshift.c \
333         input/event.c \
334         input/input.c \
335         input/info.h \
336         input/meta.c \
337         input/access.h \
338         input/clock.h \
339         input/decoder.h \
340         input/demux.h \
341         input/es_out.h \
342         input/es_out_timeshift.h \
343         input/event.h \
344         input/item.h \
345         input/stream.h \
346         input/input_internal.h \
347         input/input_interface.h \
348         input/vlm_internal.h \
349         input/vlm_event.h \
350         input/resource.h \
351         input/resource.c \
352         input/stream.c \
353         input/stream_demux.c \
354         input/stream_filter.c \
355         input/stream_memory.c \
356         input/subtitles.c \
357         input/var.c \
358         video_output/chrono.h \
359         video_output/control.c \
360         video_output/control.h \
361         video_output/display.c \
362         video_output/display.h \
363         video_output/event.h \
364         video_output/inhibit.c \
365         video_output/inhibit.h \
366         video_output/interlacing.c \
367         video_output/interlacing.h \
368         video_output/snapshot.c \
369         video_output/snapshot.h \
370         video_output/statistic.h \
371         video_output/postprocessing.c \
372         video_output/postprocessing.h \
373         video_output/video_output.c \
374         video_output/video_text.c \
375         video_output/video_epg.c \
376         video_output/video_widgets.c \
377         video_output/vout_subpictures.c \
378         video_output/window.c \
379         video_output/opengl.c \
380         video_output/vout_intf.c \
381         video_output/vout_internal.h \
382         video_output/vout_control.h \
383         video_output/vout_wrapper.c \
384         audio_output/aout_internal.h \
385         audio_output/common.c \
386         audio_output/dec.c \
387         audio_output/filters.c \
388         audio_output/input.c \
389         audio_output/mixer.c \
390         audio_output/output.c \
391         audio_output/intf.c \
392         osd/osd.c \
393         osd/osd_text.c \
394         network/acl.c \
395         network/getaddrinfo.c \
396         network/io.c \
397         network/tcp.c \
398         network/udp.c \
399         network/rootbind.c \
400         network/tls.c \
401         text/charset.c \
402         text/strings.c \
403         text/unicode.c \
404         text/filesystem.c \
405         text/iso_lang.c \
406         text/iso-639_def.h \
407         misc/md5.c \
408         misc/probe.c \
409         misc/rand.c \
410         misc/mtime.c \
411         misc/block.c \
412         misc/fourcc.c \
413         misc/es_format.c \
414         misc/picture.c \
415         misc/picture_fifo.c \
416         misc/picture_pool.c \
417         modules/modules.h \
418         modules/modules.c \
419         modules/bank.c \
420         modules/cache.c \
421         modules/entry.c \
422         modules/textdomain.c \
423         misc/threads.c \
424         misc/stats.c \
425         misc/cpu.c \
426         misc/epg.c \
427         misc/exit.c \
428         config/configuration.h \
429         config/core.c \
430         config/chain.c \
431         config/file.c \
432         config/help.c \
433         config/intf.c \
434         config/keys.c \
435         config/cmdline.c \
436         config/dirs.c \
437         config/getopt.c \
438         config/vlc_getopt.h \
439         misc/events.c \
440         misc/image.c \
441         misc/messages.c \
442         misc/objects.c \
443         misc/variables.h \
444         misc/variables.c \
445         misc/error.c \
446         misc/update.h \
447         misc/update.c \
448         misc/update_crypto.c \
449         misc/xml.c \
450         misc/media_library.c \
451         extras/libc.c \
452         extras/tdestroy.c \
453         misc/filter.c \
454         misc/filter_chain.c \
455         misc/http_auth.c \
456         misc/sql.c \
457         misc/text_style.c \
458         misc/subpicture.c \
459         misc/subpicture.h \
460         $(NULL)
461
462 SOURCES_libvlc_httpd = \
463         network/httpd.c \
464         $(NULL)
465
466 SOURCES_libvlc_sout = \
467         stream_output/stream_output.c \
468         stream_output/stream_output.h \
469         stream_output/announce.c \
470         stream_output/sap.c \
471         stream_output/sdp.c \
472         $(NULL)
473
474 SOURCES_libvlc_vlm = \
475         input/vlm.c \
476         input/vlm_event.c \
477         input/vlmshell.c \
478         $(NULL)
479
480 SOURCES_libvlc = \
481         $(SOURCES_libvlc_common) \
482         $(NULL)
483
484 ###############################################################################
485 # GIT revision
486 ###############################################################################
487
488 BUILT_SOURCES += stamp-revision
489 MAINTAINERCLEANFILES = $(srcdir)/revision.txt $(srcdir)/revision.c
490
491 $(srcdir)/revision.c: $(srcdir)/revision.txt
492         $(AM_V_at)rm -f -- $@
493         $(AM_V_GEN)echo "const char psz_vlc_changeset[] = \"$$(cat $<)\";" \
494                 > $@
495
496 $(srcdir)/revision.txt:
497         $(AM_V_at)$(MAKE) stamp-revision
498         $(AM_V_GEN)touch $@
499
500 stamp-revision:
501         $(AM_V_at)rm -f -- revision.tmp
502         $(AM_V_GEN)if ! git \
503                         --git-dir="$(top_srcdir)/.git/" describe \
504                         --tags --long --match '?.*.*' --always; then \
505                 cat $(srcdir)/revision.txt ; \
506         fi > revision.tmp
507         $(AM_V_at)if diff revision.tmp $(srcdir)/revision.txt >/dev/null 2>&1; then \
508                 rm -f -- revision.tmp; \
509         else \
510                 mv -f -- revision.tmp $(srcdir)/revision.txt; \
511         fi
512 #2>&1
513
514 ###############################################################################
515 # Unit/regression test
516 ###############################################################################
517
518 dist_check_SCRIPTS = check_headers
519
520 check-local:
521         for h in `echo $(pkginclude_HEADERS) | sed -e s,\.\./include/,,g`; \
522         do \
523                 echo grep - "#include <$$h>" $(srcdir)/test/headers.c ; \
524                 if ! grep -- "#include <$$h>" $(srcdir)/test/headers.c ; \
525                 then \
526                         echo "Header $$h not included in test/headers.c!"; \
527                         exit 1; \
528                 fi ; \
529         done
530         $(srcdir)/check_headers $(pluginsinclude_HEADERS)
531
532 FORCE:
533         @echo "Generated source cannot be phony. Go away." >&2
534         @exit 1
535
536 .PHONY: FORCE