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