4 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
5 AM_MAKEFLAGS = --no-print-directory
10 OS = $(shell uname -s)
17 -include $(top_builddir)/config.h \
18 -DSYSCONFDIR=\""$(sysconfdir)"\" \
21 AM_CFLAGS = ${my_CFLAGS} \
25 AM_LDFLAGS = ${my_LDFLAGS}
27 # leaving a space here to work around automake's conditionals
29 AM_LDFLAGS += -Wl,-dead_strip
40 DISTCHECK_CONFIGURE_FLAGS = \
41 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
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' \
54 databasedir = $(localstatedir)/lib/location
55 pkgconfigdir = $(libdir)/pkgconfig
57 # Overwrite Python path
58 pkgpythondir = $(pythondir)/location
63 @INTLTOOL_POLICY_RULE@
65 # ------------------------------------------------------------------------------
67 AM_V_ASCIIDOC = $(AM_V_ASCIIDOC_$(V))
68 AM_V_ASCIIDOC_ = $(AM_V_ASCIIDOC_$(AM_DEFAULT_VERBOSITY))
69 AM_V_ASCIIDOC_0 = @echo " ASCIIDOC" $@;
71 AM_V_XSLT = $(AM_V_XSLT_$(V))
72 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
73 AM_V_XSLT_0 = @echo " XSLT " $@;
75 # ------------------------------------------------------------------------------
78 update-po: po/POTFILES.in
79 $(MAKE) -C po update-po
81 po/POTFILES.in: Makefile
82 find $(abs_srcdir)/src -type f \( -name '*.in' -o -name '*.py' \) \
83 \! -exec git check-ignore -q {} \; -print | \
84 sed -e "s@$(abs_srcdir)/@@g" | LC_ALL=C sort > $@
87 examples/private-key.pem \
88 examples/public-key.pem \
89 examples/python/create-database.py \
90 examples/python/read-database.py
92 pkginclude_HEADERS = \
95 src/libloc/as-list.h \
97 src/libloc/country.h \
98 src/libloc/country-list.h \
99 src/libloc/database.h \
100 src/libloc/format.h \
101 src/libloc/network.h \
102 src/libloc/network-list.h \
103 src/libloc/private.h \
104 src/libloc/stringpool.h \
105 src/libloc/resolv.h \
111 src_libloc_la_SOURCES = \
124 EXTRA_DIST += src/libloc.sym
126 src_libloc_la_CFLAGS = \
131 src_libloc_la_LDFLAGS = \
133 -version-info $(LIBLOC_CURRENT):$(LIBLOC_REVISION):$(LIBLOC_AGE)
135 if HAVE_LD_VERSION_SCRIPT
136 src_libloc_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/libloc.sym
138 src_libloc_la_LDFLAGS += -export-symbols $(top_srcdir)/src/libloc.sym
141 src_libloc_la_LIBADD = \
145 src_libloc_la_DEPENDENCIES = \
146 ${top_srcdir}/src/libloc.sym
148 noinst_LTLIBRARIES = \
149 src/libloc-internal.la
151 src_libloc_internal_la_SOURCES = \
152 $(src_libloc_la_SOURCES)
154 src_libloc_internal_la_CFLAGS = \
155 $(src_libloc_la_CFLAGS)
157 src_libloc_internal_la_LDFLAGS = \
158 $(filter-out -version-info %,$(src_libloc_la_LDFLAGS))
160 src_libloc_internal_la_LIBADD = \
161 $(src_libloc_la_LIBADD)
163 src_libloc_internal_la_DEPENDENCIES = \
164 $(src_libloc_la_DEPENDENCIES)
175 dist_pkgpython_PYTHON = \
176 src/python/database.py \
177 src/python/downloader.py \
178 src/python/export.py \
180 src/python/importer.py \
184 src/python/__init__.py
187 src/python/__init__.py.in
190 src/python/__init__.py
192 pyexec_LTLIBRARIES = \
193 src/python/_location.la
195 src_python__location_la_SOURCES = \
196 src/python/locationmodule.c \
197 src/python/locationmodule.h \
200 src/python/country.c \
201 src/python/country.h \
202 src/python/database.c \
203 src/python/database.h \
204 src/python/network.c \
205 src/python/network.h \
206 src/python/writer.c \
209 src_python__location_la_CFLAGS = \
213 src_python__location_la_LDFLAGS = \
219 src_python__location_la_LIBADD = \
223 # Compile & install bindings
224 all-local: $(foreach binding,$(BINDINGS),build-$(binding))
225 check-local: $(foreach binding,$(BINDINGS),check-$(binding))
226 install-exec-local: $(foreach binding,$(BINDINGS),install-$(binding))
227 clean-local: $(foreach binding,$(BINDINGS),clean-$(binding))
228 uninstall-local: $(foreach binding,$(BINDINGS),uninstall-$(binding))
232 src/perl/.gitignore \
233 src/perl/Location.xs \
235 src/perl/Makefile.PL \
236 src/perl/lib/Location.pm \
237 src/perl/t/Location.t \
242 @mkdir -p $(builddir)/src/perl/{lib,t}
243 @test -e $(builddir)/src/perl/Location.xs || ln -s --relative $(srcdir)/src/perl/Location.xs $(builddir)/src/perl/
244 @test -e $(builddir)/src/perl/MANIFEST || ln -s --relative $(srcdir)/src/perl/MANIFEST $(builddir)/src/perl/
245 @test -e $(builddir)/src/perl/Makefile.PL || ln -s --relative $(srcdir)/src/perl/Makefile.PL $(builddir)/src/perl/
246 @test -e $(builddir)/src/perl/lib/Location.pm || ln -s --relative $(srcdir)/src/perl/lib/Location.pm $(builddir)/src/perl/lib/
247 @test -e $(builddir)/src/perl/t/Location.t || ln -s --relative $(srcdir)/src/perl/t/Location.t $(builddir)/src/perl/t/
248 @test -e $(builddir)/src/perl/typemap || ln -s --relative $(srcdir)/src/perl/typemap $(builddir)/src/perl/
250 cd $(builddir)/src/perl && $(PERL) Makefile.PL PREFIX="$(prefix)" \
251 INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc"
252 cd $(builddir)/src/perl && $(MAKE) LD_RUN_PATH=
255 check-perl: testdata.db
256 cd $(builddir)/src/perl && $(MAKE) LD_LIBRARY_PATH="$(abs_builddir)/src/.libs" test \
257 database="../../$<" keyfile="$(abs_srcdir)/examples/public-key.pem"
261 cd $(builddir)/src/perl && $(MAKE) install DESTIDR=$(DESTDIR)
265 cd $(builddir)/src/perl && $(MAKE) distclean
267 .PHONY: uninstall-perl
270 $(DESTDIR)/$(prefix)/lib/*/perl/*/Location.pm \
271 $(DESTDIR)/$(prefix)/lib/*/perl/*/auto/Location \
272 $(DESTDIR)/$(prefix)/lib/*/perl/*/perllocal.pod \
273 $(DESTDIR)/$(prefix)/man/man3/Location.3pm
276 src/python/location \
277 src/python/location-importer
280 src/python/location.in \
281 src/python/location-importer.in
284 src/python/location \
285 src/python/location-importer
287 # ------------------------------------------------------------------------------
290 systemdsystemunit_DATA = \
291 src/systemd/location-update.service \
292 src/systemd/location-update.timer
295 $(systemdsystemunit_DATA)
298 $(systemdsystemunitdir)
302 src/systemd/location-update.service.in \
303 src/systemd/location-update.timer.in
305 # ------------------------------------------------------------------------------
307 dist_database_DATA = \
310 # ------------------------------------------------------------------------------
315 -DABS_SRCDIR=\"$(abs_srcdir)\"
319 src/libloc-internal.la
323 src/test-stringpool \
333 testdata.db: examples/python/create-database.py
334 PYTHONPATH=$(abs_builddir)/src/python/.libs \
335 ABS_SRCDIR="$(abs_srcdir)" \
340 src/test-stringpool \
344 src/test-network-list \
348 src_test_libloc_SOURCES = \
351 src_test_libloc_CFLAGS = \
354 src_test_libloc_LDADD = \
357 src_test_as_SOURCES = \
360 src_test_as_CFLAGS = \
363 src_test_as_LDADD = \
366 src_test_country_SOURCES = \
369 src_test_country_CFLAGS = \
372 src_test_country_LDADD = \
375 src_test_network_SOURCES = \
378 src_test_network_CFLAGS = \
381 src_test_network_LDADD = \
384 src_test_network_list_SOURCES = \
385 src/test-network-list.c
387 src_test_network_list_CFLAGS = \
390 src_test_network_list_LDADD = \
393 src_test_stringpool_SOURCES = \
394 src/test-stringpool.c
396 src_test_stringpool_CFLAGS = \
399 src_test_stringpool_LDADD = \
402 src_test_database_SOURCES = \
405 src_test_database_CFLAGS = \
408 src_test_database_LDADD = \
411 src_test_signature_SOURCES = \
414 src_test_signature_CFLAGS = \
417 src_test_signature_LDADD = \
420 # ------------------------------------------------------------------------------
425 MANPAGES_TXT = $(patsubst %.8,%.txt,$(MANPAGES))
426 MANPAGES_HTML = $(patsubst %.txt,%.html,$(MANPAGES_TXT))
427 MANPAGES_XML = $(patsubst %.txt,%.xml,$(MANPAGES_TXT))
430 man: $(MANPAGES) $(MANPAGES_HTML)
448 --stringparam man.output.quietly 1 \
449 --stringparam funcsynopsis.style ansi \
450 --stringparam man.th.extra1.suppress 1 \
451 --stringparam man.authors.section.enabled 1 \
452 --stringparam man.copyright.section.enabled 1
454 XSLTPROC_COMMAND_MAN = \
455 $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \
456 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
457 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
459 # Let XSLT find its source on Mac OS X
461 export XML_CATALOG_FILES = /usr/local/etc/xml/catalog
464 man/%.xml: man/%.txt man/asciidoc.conf
465 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
467 -f $(abs_srcdir)/man/asciidoc.conf \
468 -d manpage -b docbook -o $@ $<
471 $(XSLTPROC_COMMAND_MAN)
473 man/%.html: man/%.txt man/asciidoc.conf
474 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
476 -f $(abs_srcdir)/man/asciidoc.conf \
477 -b html5 -a icons -a theme=flask -o $@ $<
480 upload-man: $(MANPAGES_HTML)
481 rsync -avHz --delete --progress $(MANPAGES_HTML) ms@fs01.haj.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/
489 debian/location.install \
490 debian/location.manpages \
491 debian/location-python.install \
492 debian/libloc1.install \
493 debian/libloc-dev.install \
499 $(SHELL) debian/build.sh $(PACKAGE_NAME)-$(PACKAGE_VERSION) $(distdir).tar.xz