]>
Commit | Line | Data |
---|---|---|
1 | EXTRA_DIST = | |
2 | CLEANFILES = | |
3 | ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} | |
4 | AM_MAKEFLAGS = --no-print-directory | |
5 | ||
6 | SUBDIRS = . po | |
7 | BINDINGS = | |
8 | ||
9 | OS = $(shell uname -s) | |
10 | ||
11 | if ENABLE_PERL | |
12 | BINDINGS += perl | |
13 | endif | |
14 | ||
15 | AM_CPPFLAGS = \ | |
16 | -include $(top_builddir)/config.h \ | |
17 | -DSYSCONFDIR=\""$(sysconfdir)"\" \ | |
18 | -I${top_srcdir}/src | |
19 | ||
20 | AM_CFLAGS = ${my_CFLAGS} \ | |
21 | -ffunction-sections \ | |
22 | -fdata-sections | |
23 | ||
24 | AM_LDFLAGS = | |
25 | ||
26 | # leaving a space here to work around automake's conditionals | |
27 | ifeq ($(OS),Darwin) | |
28 | AM_LDFLAGS += -Wl,-dead_strip | |
29 | else | |
30 | AM_LDFLAGS += \ | |
31 | -Wl,--as-needed \ | |
32 | -Wl,--gc-sections | |
33 | endif | |
34 | ||
35 | LIBLOC_CURRENT=0 | |
36 | LIBLOC_REVISION=0 | |
37 | LIBLOC_AGE=0 | |
38 | ||
39 | SED_PROCESS = \ | |
40 | $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \ | |
41 | -e 's,@VERSION\@,$(VERSION),g' \ | |
42 | -e 's,@prefix\@,$(prefix),g' \ | |
43 | -e 's,@exec_prefix\@,$(exec_prefix),g' \ | |
44 | -e 's,@libdir\@,$(libdir),g' \ | |
45 | -e 's,@includedir\@,$(includedir),g' \ | |
46 | -e 's,@databasedir\@,$(databasedir),g' \ | |
47 | < $< > $@ || rm $@ | |
48 | ||
49 | databasedir = $(datadir)/location | |
50 | pkgconfigdir = $(libdir)/pkgconfig | |
51 | ||
52 | %: %.in Makefile | |
53 | $(SED_PROCESS) | |
54 | ||
55 | @INTLTOOL_POLICY_RULE@ | |
56 | ||
57 | # ------------------------------------------------------------------------------ | |
58 | ||
59 | AM_V_ASCIIDOC = $(AM_V_ASCIIDOC_$(V)) | |
60 | AM_V_ASCIIDOC_ = $(AM_V_ASCIIDOC_$(AM_DEFAULT_VERBOSITY)) | |
61 | AM_V_ASCIIDOC_0 = @echo " ASCIIDOC" $@; | |
62 | ||
63 | AM_V_XSLT = $(AM_V_XSLT_$(V)) | |
64 | AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY)) | |
65 | AM_V_XSLT_0 = @echo " XSLT " $@; | |
66 | ||
67 | # ------------------------------------------------------------------------------ | |
68 | ||
69 | .PHONY: update-po | |
70 | update-po: | |
71 | $(MAKE) -C po update-po | |
72 | ||
73 | EXTRA_DIST += \ | |
74 | examples/python/create-database.py \ | |
75 | examples/python/read-database.py | |
76 | ||
77 | pkginclude_HEADERS = \ | |
78 | src/loc/libloc.h \ | |
79 | src/loc/as.h \ | |
80 | src/loc/compat.h \ | |
81 | src/loc/country.h \ | |
82 | src/loc/database.h \ | |
83 | src/loc/format.h \ | |
84 | src/loc/network.h \ | |
85 | src/loc/private.h \ | |
86 | src/loc/stringpool.h \ | |
87 | src/loc/writer.h | |
88 | ||
89 | lib_LTLIBRARIES = \ | |
90 | src/libloc.la | |
91 | ||
92 | src_libloc_la_SOURCES = \ | |
93 | src/libloc.c \ | |
94 | src/as.c \ | |
95 | src/country.c \ | |
96 | src/database.c \ | |
97 | src/network.c \ | |
98 | src/stringpool.c \ | |
99 | src/writer.c | |
100 | ||
101 | EXTRA_DIST += src/libloc.sym | |
102 | ||
103 | src_libloc_la_CFLAGS = \ | |
104 | $(AM_CFLAGS) \ | |
105 | -DLIBLOC_PRIVATE \ | |
106 | -fvisibility=hidden | |
107 | ||
108 | src_libloc_la_LDFLAGS = \ | |
109 | $(AM_LDFLAGS) \ | |
110 | -version-info $(LIBLOC_CURRENT):$(LIBLOC_REVISION):$(LIBLOC_AGE) | |
111 | ||
112 | if HAVE_LD_VERSION_SCRIPT | |
113 | src_libloc_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/libloc.sym | |
114 | else | |
115 | src_libloc_la_LDFLAGS += -export-symbols $(top_srcdir)/src/libloc.sym | |
116 | endif | |
117 | ||
118 | src_libloc_la_DEPENDENCIES = \ | |
119 | ${top_srcdir}/src/libloc.sym | |
120 | ||
121 | pkgconfig_DATA = \ | |
122 | src/libloc.pc | |
123 | ||
124 | EXTRA_DIST += \ | |
125 | src/libloc.pc.in | |
126 | ||
127 | CLEANFILES += \ | |
128 | src/libloc.pc | |
129 | ||
130 | pyexec_LTLIBRARIES = \ | |
131 | src/python/location.la | |
132 | ||
133 | src_python_location_la_SOURCES = \ | |
134 | src/python/locationmodule.c \ | |
135 | src/python/locationmodule.h \ | |
136 | src/python/as.c \ | |
137 | src/python/as.h \ | |
138 | src/python/country.c \ | |
139 | src/python/country.h \ | |
140 | src/python/database.c \ | |
141 | src/python/database.h \ | |
142 | src/python/network.c \ | |
143 | src/python/network.h \ | |
144 | src/python/writer.c \ | |
145 | src/python/writer.h | |
146 | ||
147 | src_python_location_la_CFLAGS = \ | |
148 | $(AM_CFLAGS) \ | |
149 | $(PYTHON_CFLAGS) | |
150 | ||
151 | src_python_location_la_LDFLAGS = \ | |
152 | $(AM_LDFLAGS) \ | |
153 | -shared \ | |
154 | -module \ | |
155 | -avoid-version | |
156 | ||
157 | src_python_location_la_LIBADD = \ | |
158 | src/libloc.la \ | |
159 | $(PYTHON_LIBS) | |
160 | ||
161 | # Compile & install bindings | |
162 | all-local: $(foreach binding,$(BINDINGS),build-$(binding)) | |
163 | check-local: $(foreach binding,$(BINDINGS),check-$(binding)) | |
164 | install-exec-local: $(foreach binding,$(BINDINGS),install-$(binding)) | |
165 | clean-local: $(foreach binding,$(BINDINGS),clean-$(binding)) | |
166 | uninstall-local: $(foreach binding,$(BINDINGS),uninstall-$(binding)) | |
167 | ||
168 | # Perl Bindings | |
169 | EXTRA_DIST += \ | |
170 | src/perl/.gitignore \ | |
171 | src/perl/Location.xs \ | |
172 | src/perl/MANIFEST \ | |
173 | src/perl/Makefile.PL \ | |
174 | src/perl/lib/Location.pm \ | |
175 | src/perl/t/Location.t \ | |
176 | src/perl/typemap | |
177 | ||
178 | .PHONY: build-perl | |
179 | build-perl: | |
180 | @mkdir -p $(builddir)/src/perl/{lib,t} | |
181 | @test -e $(builddir)/src/perl/Location.xs || ln -s --relative $(srcdir)/src/perl/Location.xs $(builddir)/src/perl/ | |
182 | @test -e $(builddir)/src/perl/MANIFEST || ln -s --relative $(srcdir)/src/perl/MANIFEST $(builddir)/src/perl/ | |
183 | @test -e $(builddir)/src/perl/Makefile.PL || ln -s --relative $(srcdir)/src/perl/Makefile.PL $(builddir)/src/perl/ | |
184 | @test -e $(builddir)/src/perl/lib/Location.pm || ln -s --relative $(srcdir)/src/perl/lib/Location.pm $(builddir)/src/perl/lib/ | |
185 | @test -e $(builddir)/src/perl/t/Location.t || ln -s --relative $(srcdir)/src/perl/t/Location.t $(builddir)/src/perl/t/ | |
186 | @test -e $(builddir)/src/perl/typemap || ln -s --relative $(srcdir)/src/perl/typemap $(builddir)/src/perl/ | |
187 | ||
188 | cd $(builddir)/src/perl && $(PERL) Makefile.PL PREFIX="$(prefix)" \ | |
189 | INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc" | |
190 | cd $(builddir)/src/perl && $(MAKE) | |
191 | ||
192 | .PHONY: check-perl | |
193 | check-perl: testdata.db | |
194 | cd $(builddir)/src/perl && $(MAKE) test database="../../$<" | |
195 | ||
196 | .PHONY: install-perl | |
197 | install-perl: | |
198 | cd $(builddir)/src/perl && $(MAKE) install | |
199 | ||
200 | .PHONY: clean-perl | |
201 | clean-perl: | |
202 | cd $(builddir)/src/perl && $(MAKE) distclean | |
203 | ||
204 | .PHONY: uninstall-perl | |
205 | uninstall-perl: | |
206 | rm -rvf \ | |
207 | $(DESTDIR)/$(prefix)/lib/*/perl/*/Location.pm \ | |
208 | $(DESTDIR)/$(prefix)/lib/*/perl/*/auto/Location \ | |
209 | $(DESTDIR)/$(prefix)/lib/*/perl/*/perllocal.pod \ | |
210 | $(DESTDIR)/$(prefix)/man/man3/Location.3pm | |
211 | ||
212 | bin_SCRIPTS = \ | |
213 | src/python/location-downloader \ | |
214 | src/python/location-query | |
215 | ||
216 | EXTRA_DIST += \ | |
217 | src/python/location-downloader.in \ | |
218 | src/python/location-query.in | |
219 | ||
220 | CLEANFILES += \ | |
221 | src/python/location-downloader \ | |
222 | src/python/location-query | |
223 | ||
224 | # ------------------------------------------------------------------------------ | |
225 | ||
226 | TESTS_CFLAGS = \ | |
227 | $(AM_CFLAGS) \ | |
228 | -DLIBLOC_PRIVATE | |
229 | ||
230 | TESTS = \ | |
231 | src/test-libloc \ | |
232 | src/test-stringpool \ | |
233 | src/test-database \ | |
234 | src/test-as \ | |
235 | src/test-network \ | |
236 | src/test-country | |
237 | ||
238 | CLEANFILES += \ | |
239 | test.db \ | |
240 | testdata.db | |
241 | ||
242 | testdata.db: examples/python/create-database.py | |
243 | PYTHONPATH=$(abs_builddir)/src/python/.libs $(PYTHON) $< $@ | |
244 | ||
245 | check_PROGRAMS = \ | |
246 | src/test-libloc \ | |
247 | src/test-stringpool \ | |
248 | src/test-database \ | |
249 | src/test-as \ | |
250 | src/test-network \ | |
251 | src/test-country | |
252 | ||
253 | src_test_libloc_SOURCES = \ | |
254 | src/test-libloc.c | |
255 | ||
256 | src_test_libloc_CFLAGS = \ | |
257 | $(TESTS_CFLAGS) | |
258 | ||
259 | src_test_libloc_LDADD = \ | |
260 | src/libloc.la | |
261 | ||
262 | src_test_as_SOURCES = \ | |
263 | src/test-as.c | |
264 | ||
265 | src_test_as_CFLAGS = \ | |
266 | $(TESTS_CFLAGS) | |
267 | ||
268 | src_test_as_LDADD = \ | |
269 | src/libloc.la | |
270 | ||
271 | src_test_country_SOURCES = \ | |
272 | src/test-country.c | |
273 | ||
274 | src_test_country_CFLAGS = \ | |
275 | $(TESTS_CFLAGS) | |
276 | ||
277 | src_test_country_LDADD = \ | |
278 | src/libloc.la | |
279 | ||
280 | src_test_network_SOURCES = \ | |
281 | src/test-network.c | |
282 | ||
283 | src_test_network_CFLAGS = \ | |
284 | $(TESTS_CFLAGS) | |
285 | ||
286 | src_test_network_LDADD = \ | |
287 | src/libloc.la | |
288 | ||
289 | src_test_stringpool_SOURCES = \ | |
290 | src/test-stringpool.c | |
291 | ||
292 | src_test_stringpool_CFLAGS = \ | |
293 | $(TESTS_CFLAGS) | |
294 | ||
295 | src_test_stringpool_LDADD = \ | |
296 | src/libloc.la | |
297 | ||
298 | src_test_database_SOURCES = \ | |
299 | src/test-database.c | |
300 | ||
301 | src_test_database_CFLAGS = \ | |
302 | $(TESTS_CFLAGS) | |
303 | ||
304 | src_test_database_LDADD = \ | |
305 | src/libloc.la | |
306 | ||
307 | # ------------------------------------------------------------------------------ | |
308 | ||
309 | MANPAGES = \ | |
310 | man/location-query.8 | |
311 | ||
312 | MANPAGES_TXT = $(patsubst %.8,%.txt,$(MANPAGES)) | |
313 | MANPAGES_HTML = $(patsubst %.txt,%.html,$(MANPAGES_TXT)) | |
314 | MANPAGES_XML = $(patsubst %.txt,%.xml,$(MANPAGES_TXT)) | |
315 | ||
316 | .PHONY: man | |
317 | man: $(MANPAGES) $(MANPAGES_HTML) | |
318 | ||
319 | if ENABLE_MANPAGES | |
320 | man_MANS = \ | |
321 | $(MANPAGES) | |
322 | endif | |
323 | ||
324 | CLEANFILES += \ | |
325 | $(MANPAGES) \ | |
326 | $(MANPAGES_HTML) \ | |
327 | $(MANPAGES_XML) | |
328 | ||
329 | EXTRA_DIST += \ | |
330 | man/asciidoc.conf \ | |
331 | $(MANPAGES_TXT) | |
332 | ||
333 | XSLTPROC_FLAGS = \ | |
334 | --nonet \ | |
335 | --stringparam man.output.quietly 1 \ | |
336 | --stringparam funcsynopsis.style ansi \ | |
337 | --stringparam man.th.extra1.suppress 1 \ | |
338 | --stringparam man.authors.section.enabled 1 \ | |
339 | --stringparam man.copyright.section.enabled 1 | |
340 | ||
341 | XSLTPROC_COMMAND_MAN = \ | |
342 | $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \ | |
343 | $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \ | |
344 | http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< | |
345 | ||
346 | man/%.xml: man/%.txt man/asciidoc.conf | |
347 | $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \ | |
348 | $(ASCIIDOC) \ | |
349 | -f $(abs_srcdir)/man/asciidoc.conf \ | |
350 | -d manpage -b docbook -o $@ $< | |
351 | ||
352 | man/%.8: man/%.xml | |
353 | $(XSLTPROC_COMMAND_MAN) | |
354 | ||
355 | man/%.html: man/%.txt man/asciidoc.conf | |
356 | $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \ | |
357 | $(ASCIIDOC) \ | |
358 | -f $(abs_srcdir)/man/asciidoc.conf \ | |
359 | -b html5 -a icons -a theme=flask -o $@ $< | |
360 | ||
361 | .PHONY: upload-man | |
362 | upload-man: $(MANPAGES_HTML) | |
363 | rsync -avHz --delete --progress $(MANPAGES_HTML) ms@fs01.haj.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/ |