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