This repository was archived by the owner on Mar 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile.am
More file actions
213 lines (157 loc) · 4.53 KB
/
Makefile.am
File metadata and controls
213 lines (157 loc) · 4.53 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# ------------------------------------------------------------------------------
# autotools
SHELL = bash
ACLOCAL_AMFLAGS = -I build/m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
AUTOMAKE_OPTIONS = color-tests parallel-tests
GCC_COLORS ?= 'ooh, shiny!'
export GCC_COLORS
# remove targets if the command fails
.DELETE_ON_ERROR:
# keep intermediate files
.SECONDARY:
# keep the test-suite.log and Makefile around at all times
.PRECIOUS: $(TEST_SUITE_LOG) Makefile
pkgconfiglibdir=$(libdir)/pkgconfig
BUILT_SOURCES =
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST =
include_HEADERS =
pkgconfiglib_DATA =
noinst_LIBRARIES =
check_PROGRAMS =
TESTS =
default_tests =
AM_CPPFLAGS = \
-include $(top_builddir)/build/config.h \
-I $(top_srcdir)/src \
-I $(top_builddir)/src \
$(OUR_CPPFLAGS)
AM_CFLAGS = $(OUR_CFLAGS) $(GLIB_CFLAGS)
AM_LDFLAGS = $(OUR_LDFLAGS)
# ------------------------------------------------------------------------------
# library archive
noinst_LIBRARIES += \
libcvariant.a
libcvariant_a_SOURCES = \
src/c-variant.c \
src/c-variant-private.h \
src/c-variant-reader.c \
src/c-variant-writer.c \
src/libcvariant.sym \
src/c-variant.h
if HAVE_GMP
libcvariant_a_SOURCES += \
src/generator.c \
src/generator.h
endif
# ------------------------------------------------------------------------------
# shared library built from archive
all-local: libcvariant.so.0
include_HEADERS += \
src/c-variant.h
libcvariant.so.0: libcvariant.a $(top_srcdir)/src/libcvariant.sym
$(AM_V_CCLD)$(LINK) -shared \
-Wl,-soname=$@ \
-Wl,--version-script=$(top_srcdir)/src/libcvariant.sym \
-Wl,--whole-archive libcvariant.a -Wl,--no-whole-archive
CLEANFILES += \
libcvariant.so.0
install-exec-local:
@echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1
@echo " $(INSTALL) libcvariant.so.0 '$(DESTDIR)$(libdir)'"; \
$(INSTALL) libcvariant.so.0 "$(DESTDIR)$(libdir)" || exit $$?
@echo " $(LN_S) -f libcvariant.so.0 '$(DESTDIR)$(libdir)/libcvariant.so'"; \
$(LN_S) -f libcvariant.so.0 "$(DESTDIR)$(libdir)/libcvariant.so" || exit $$?
uninstall-local:
@test ! -d "$(DESTDIR)$(libdir)" || \
{ echo " ( cd '$(DESTDIR)$(libdir)' && rm -f libcvariant.so.0 )"; \
rm -f "$(DESTDIR)$(libdir)/libcvariant.so.0"; }
%.pc: %.pc.in
$(AM_V_GEN)$(SED) \
-e 's,@includedir\@,$(includedir),g' \
-e 's,@libdir\@,$(libdir),g' \
-e 's,@VERSION\@,$(VERSION),g' \
$< > $@
pkgconfiglib_DATA += \
src/c-variant.pc
EXTRA_DIST += \
src/c-variant.pc.in
CLEANFILES += \
src/c-variant.pc
# ------------------------------------------------------------------------------
# test-api
default_tests += \
test-api
test_api_SOURCES = \
src/test-api.c
test_api_LDADD = \
libcvariant.so.0 # explicitly linked against public library
# ------------------------------------------------------------------------------
# test-generator
if HAVE_GMP
default_tests += \
test-generator
endif
test_generator_SOURCES = \
src/test-generator.c
test_generator_LDADD = \
libcvariant.a
# ------------------------------------------------------------------------------
# test-glib
if HAVE_GMP
if HAVE_GLIB
default_tests += \
test-glib
endif
endif
test_glib_SOURCES = \
src/test-glib.c
test_glib_LDADD = \
libcvariant.a \
$(GLIB_LIBS)
# ------------------------------------------------------------------------------
# test-perf
default_tests += \
test-perf
test_perf_SOURCES = \
src/test-perf.c
test_perf_LDADD = \
libcvariant.a
# ------------------------------------------------------------------------------
# test-reader
default_tests += \
test-reader
test_reader_SOURCES = \
src/test-reader.c
test_reader_LDADD = \
libcvariant.a
# ------------------------------------------------------------------------------
# test-signature
default_tests += \
test-signature
test_signature_SOURCES = \
src/test-signature.c
test_signature_LDADD = \
libcvariant.a
# ------------------------------------------------------------------------------
# test-writer
default_tests += \
test-writer
test_writer_SOURCES = \
src/test-writer.c
test_writer_LDADD = \
libcvariant.a
# ------------------------------------------------------------------------------
# test suite
AM_TESTS_ENVIRONMENT = LD_LIBRARY_PATH=$(abs_builddir)
check_PROGRAMS += $(default_tests)
TESTS += $(default_tests)
# ------------------------------------------------------------------------------¶
# check "make install" directory tree
install-tree: all
rm -rf $(abs_builddir)/install-tree
$(MAKE) install DESTDIR=$(abs_builddir)/install-tree
tree $(abs_builddir)/install-tree
.PHONY: install-tree