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} \
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 # XXX hardcode path for Debian
58 pythondir = $(prefix)/lib/python3/dist-packages
59 pyexecdir = $(prefix)/lib/python$(PYTHON_VERSION)/lib-dynload
61 # Overwrite Python path
62 pkgpythondir = $(pythondir)/location
67 @INTLTOOL_POLICY_RULE@
69 # ------------------------------------------------------------------------------
71 AM_V_ASCIIDOC = $(AM_V_ASCIIDOC_$(V))
72 AM_V_ASCIIDOC_ = $(AM_V_ASCIIDOC_$(AM_DEFAULT_VERBOSITY))
73 AM_V_ASCIIDOC_0 = @echo " ASCIIDOC" $@;
75 AM_V_XSLT = $(AM_V_XSLT_$(V))
76 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
77 AM_V_XSLT_0 = @echo " XSLT " $@;
79 # ------------------------------------------------------------------------------
83 $(MAKE) -C po update-po
86 examples/private-key.pem \
87 examples/public-key.pem \
88 examples/python/create-database.py \
89 examples/python/read-database.py
91 pkginclude_HEADERS = \
100 src/loc/stringpool.h \
107 src_libloc_la_SOURCES = \
117 EXTRA_DIST += src/libloc.sym
119 src_libloc_la_CFLAGS = \
124 src_libloc_la_LDFLAGS = \
126 -version-info $(LIBLOC_CURRENT):$(LIBLOC_REVISION):$(LIBLOC_AGE)
128 if HAVE_LD_VERSION_SCRIPT
129 src_libloc_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/libloc.sym
131 src_libloc_la_LDFLAGS += -export-symbols $(top_srcdir)/src/libloc.sym
134 src_libloc_la_LIBADD = \
138 src_libloc_la_DEPENDENCIES = \
139 ${top_srcdir}/src/libloc.sym
150 dist_pkgpython_PYTHON = \
151 src/python/__init__.py \
152 src/python/database.py \
154 src/python/importer.py \
157 pyexec_LTLIBRARIES = \
158 src/python/_location.la
160 src_python__location_la_SOURCES = \
161 src/python/locationmodule.c \
162 src/python/locationmodule.h \
165 src/python/country.c \
166 src/python/country.h \
167 src/python/database.c \
168 src/python/database.h \
169 src/python/network.c \
170 src/python/network.h \
171 src/python/writer.c \
174 src_python__location_la_CFLAGS = \
178 src_python__location_la_LDFLAGS = \
184 src_python__location_la_LIBADD = \
188 # Compile & install bindings
189 all-local: $(foreach binding,$(BINDINGS),build-$(binding))
190 check-local: $(foreach binding,$(BINDINGS),check-$(binding))
191 install-exec-local: $(foreach binding,$(BINDINGS),install-$(binding))
192 clean-local: $(foreach binding,$(BINDINGS),clean-$(binding))
193 uninstall-local: $(foreach binding,$(BINDINGS),uninstall-$(binding))
197 src/perl/.gitignore \
198 src/perl/Location.xs \
200 src/perl/Makefile.PL \
201 src/perl/lib/Location.pm \
202 src/perl/t/Location.t \
207 @mkdir -p $(builddir)/src/perl/{lib,t}
208 @test -e $(builddir)/src/perl/Location.xs || ln -s --relative $(srcdir)/src/perl/Location.xs $(builddir)/src/perl/
209 @test -e $(builddir)/src/perl/MANIFEST || ln -s --relative $(srcdir)/src/perl/MANIFEST $(builddir)/src/perl/
210 @test -e $(builddir)/src/perl/Makefile.PL || ln -s --relative $(srcdir)/src/perl/Makefile.PL $(builddir)/src/perl/
211 @test -e $(builddir)/src/perl/lib/Location.pm || ln -s --relative $(srcdir)/src/perl/lib/Location.pm $(builddir)/src/perl/lib/
212 @test -e $(builddir)/src/perl/t/Location.t || ln -s --relative $(srcdir)/src/perl/t/Location.t $(builddir)/src/perl/t/
213 @test -e $(builddir)/src/perl/typemap || ln -s --relative $(srcdir)/src/perl/typemap $(builddir)/src/perl/
215 cd $(builddir)/src/perl && $(PERL) Makefile.PL PREFIX="$(prefix)" \
216 INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc"
217 cd $(builddir)/src/perl && $(MAKE) CC="$(CC)" LD="$(LD)" LD_RUN_PATH=
220 check-perl: testdata.db
221 cd $(builddir)/src/perl && $(MAKE) LD_LIBRARY_PATH="$(abs_builddir)/src/.libs" test \
222 database="../../$<" keyfile="$(abs_srcdir)/examples/public-key.pem"
226 cd $(builddir)/src/perl && $(MAKE) install
230 cd $(builddir)/src/perl && $(MAKE) distclean
232 .PHONY: uninstall-perl
235 $(DESTDIR)/$(prefix)/lib/*/perl/*/Location.pm \
236 $(DESTDIR)/$(prefix)/lib/*/perl/*/auto/Location \
237 $(DESTDIR)/$(prefix)/lib/*/perl/*/perllocal.pod \
238 $(DESTDIR)/$(prefix)/man/man3/Location.3pm
241 src/python/location-downloader \
242 src/python/location-exporter \
243 src/python/location-importer \
244 src/python/location-query
247 src/python/location-downloader.in \
248 src/python/location-exporter.in \
249 src/python/location-importer.in \
250 src/python/location-query.in
253 src/python/location-downloader \
254 src/python/location-exporter \
255 src/python/location-importer \
256 src/python/location-query
258 # ------------------------------------------------------------------------------
261 systemdsystemunit_DATA = \
262 src/systemd/location-downloader.service \
263 src/systemd/location-downloader.timer
266 $(systemdsystemunit_DATA)
269 $(systemdsystemunitdir)
273 src/systemd/location-downloader.service.in \
274 src/systemd/location-downloader.timer.in
276 # ------------------------------------------------------------------------------
278 dist_database_DATA = \
281 # ------------------------------------------------------------------------------
286 -DABS_SRCDIR=\"$(abs_srcdir)\"
290 src/test-stringpool \
300 testdata.db: examples/python/create-database.py
301 PYTHONPATH=$(abs_builddir)/src/python/.libs \
302 ABS_SRCDIR="$(abs_srcdir)" \
307 src/test-stringpool \
314 src_test_libloc_SOURCES = \
317 src_test_libloc_CFLAGS = \
320 src_test_libloc_LDADD = \
323 src_test_as_SOURCES = \
326 src_test_as_CFLAGS = \
329 src_test_as_LDADD = \
332 src_test_country_SOURCES = \
335 src_test_country_CFLAGS = \
338 src_test_country_LDADD = \
341 src_test_network_SOURCES = \
344 src_test_network_CFLAGS = \
347 src_test_network_LDADD = \
350 src_test_stringpool_SOURCES = \
351 src/test-stringpool.c
353 src_test_stringpool_CFLAGS = \
356 src_test_stringpool_LDADD = \
359 src_test_database_SOURCES = \
362 src_test_database_CFLAGS = \
365 src_test_database_LDADD = \
368 src_test_signature_SOURCES = \
371 src_test_signature_CFLAGS = \
374 src_test_signature_LDADD = \
377 # ------------------------------------------------------------------------------
380 man/location-downloader.8 \
383 MANPAGES_TXT = $(patsubst %.8,%.txt,$(MANPAGES))
384 MANPAGES_HTML = $(patsubst %.txt,%.html,$(MANPAGES_TXT))
385 MANPAGES_XML = $(patsubst %.txt,%.xml,$(MANPAGES_TXT))
388 man: $(MANPAGES) $(MANPAGES_HTML)
406 --stringparam man.output.quietly 1 \
407 --stringparam funcsynopsis.style ansi \
408 --stringparam man.th.extra1.suppress 1 \
409 --stringparam man.authors.section.enabled 1 \
410 --stringparam man.copyright.section.enabled 1
412 XSLTPROC_COMMAND_MAN = \
413 $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \
414 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
415 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
417 # Let XSLT find its source on Mac OS X
419 export XML_CATALOG_FILES = /usr/local/etc/xml/catalog
422 man/%.xml: man/%.txt man/asciidoc.conf
423 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
425 -f $(abs_srcdir)/man/asciidoc.conf \
426 -d manpage -b docbook -o $@ $<
429 $(XSLTPROC_COMMAND_MAN)
431 man/%.html: man/%.txt man/asciidoc.conf
432 $(AM_V_ASCIIDOC)$(MKDIR_P) $(dir $@) && \
434 -f $(abs_srcdir)/man/asciidoc.conf \
435 -b html5 -a icons -a theme=flask -o $@ $<
438 upload-man: $(MANPAGES_HTML)
439 rsync -avHz --delete --progress $(MANPAGES_HTML) ms@fs01.haj.ipfire.org:/pub/man-pages/$(PACKAGE_NAME)/
447 debian/libloc-dev.install \
448 debian/libloc.install \
449 debian/libloc.lintian-overrides \
450 debian/libloc.manpages \
451 debian/libloc-perl.install \
457 $(SHELL) debian/build.sh $(PACKAGE_NAME)-$(PACKAGE_VERSION) $(distdir).tar.xz