summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: e461fbde7407b8b7534b8eef78e8403a42677f62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Note: All source files are listed in Makefile.sources.

include $(top_srcdir)/build/Makefile.am.common
include $(srcdir)/Makefile.am.features

EXTRA_DIST += Makefile.win32      Makefile.win32.features
#MAINTAINERCLEANFILES += $(srcdir)/Makefile.win32.features

AM_CPPFLAGS = -I$(srcdir) $(CAIRO_CFLAGS)
AM_LDFLAGS = $(CAIRO_LDFLAGS)

if OS_WIN32
export_symbols = -export-symbols cairo.def
cairo_def_dependency = cairo.def
endif

$(top_builddir)/config.h: $(top_srcdir)/config.h.in
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h

cairoincludedir = $(includedir)/cairo
cairoinclude_HEADERS = $(enabled_cairo_headers)

lib_LTLIBRARIES = libcairo.la

libcairo_la_SOURCES = \
	$(enabled_cairo_headers) \
	$(enabled_cairo_private) \
	$(enabled_cairo_sources) \
	$(NULL)
libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
libcairo_la_LIBADD = $(CAIRO_LIBS)
libcairo_la_DEPENDENCIES = $(cairo_def_dependency)

# Special headers
cairoinclude_HEADERS += $(top_srcdir)/cairo-version.h
libcairo_la_SOURCES += cairo-version.h
nodist_cairoinclude_HEADERS = cairo-features.h
nodist_libcairo_la_SOURCES  = cairo-features.h
BUILT_SOURCES  += cairo-features.h cairo-supported-features.h
DISTCLEANFILES += cairo-features.h cairo-supported-features.h
cairo-features.h cairo-supported-features.h:
	cd $(top_builddir) && ./config.status src/$@

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(enabled_cairo_pkgconf)

CLEANFILES += cairo.def
cairo.def: cairo-features.h $(enabled_cairo_headers)
	@echo Generating $@
	@(echo EXPORTS; \
	(cd $(srcdir); cat $(enabled_cairo_headers) || echo 'cairo_ERROR ()' ) | \
	grep -v -E '^# *include' | \
	( cat cairo-features.h - | $(CPP) -D__cplusplus - || echo 'cairo_ERROR ()' ) | \
	grep -E '^cairo_.* \(' | \
	sed -e 's/[ 	].*//' | \
	sort; \
	echo LIBRARY libcairo-$(CAIRO_VERSION_SONUM).dll; \
	) >$@
	@ ! grep -q cairo_ERROR $@ || ($(RM) $@; false)

TESTS_ENVIRONMENT = \
	srcdir="$(srcdir)" \
	MAKE="$(MAKE) $(AM_MAKEFLAGS)" \
	all_cairo_files="$(all_cairo_files)" \
	all_cairo_headers="$(all_cairo_headers)" \
	all_cairo_private="$(all_cairo_private)" \
	all_cairo_sources="$(all_cairo_sources)" \
	enabled_cairo_files="$(enabled_cairo_files)" \
	enabled_cairo_headers="$(enabled_cairo_headers)" \
	enabled_cairo_private="$(enabled_cairo_private)" \
	enabled_cairo_sources="$(enabled_cairo_sources)" \
	$(NULL)
TESTS_SH = \
	check-def.sh \
	check-doc-syntax.sh\
	check-headers.sh \
	check-plt.sh \
	check-preprocessor-syntax.sh \
	$(NULL)
TESTS += $(TESTS_SH)
if CROSS_COMPILING
else
TESTS += check-link$(EXEEXT)
endif

EXTRA_DIST += $(TESTS_SH) check-has-hidden-symbols.c
check_PROGRAMS += check-link check-skiplist
check_link_LDADD = libcairo.la

check_skiplist_SOURCES = cairo-skiplist.c
check_skiplist_CPPFLAGS = -DMAIN $(AM_CPPFLAGS)

check: headers-standalone

PREPROCESS_ARGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
COMPILE_ARGS = $(PREPROCESS_ARGS) $(AM_CFLAGS) $(CFLAGS)

# The pre-processed result is used by check-{def,plt}.sh to determine whether
# cairo has been compiled with symbol hiding.
.c.i: $(cairoinclude_HEADERS) $(nodist_cairoinclude_HEADERS) cairoint.h $(top_builddir)/config.h
	$(CPP) $(PREPROCESS_ARGS) $< -o $@
.c.s: $(cairoinclude_HEADERS) $(nodist_cairoinclude_HEADERS) cairoint.h $(top_builddir)/config.h
	$(CC) $(COMPILE_ARGS) $< -S -o $@

include $(srcdir)/Makefile.am.analysis