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