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