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