python: Raise proper error when database does not exist
[people/ms/libloc.git] / Makefile.am
CommitLineData
46aded9a
MT
1EXTRA_DIST =
2CLEANFILES =
3ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
4AM_MAKEFLAGS = --no-print-directory
5
6AM_CPPFLAGS = \
7 -include $(top_builddir)/config.h \
8 -DSYSCONFDIR=\""$(sysconfdir)"\" \
9 -I${top_srcdir}/src
10
11AM_CFLAGS = ${my_CFLAGS} \
46aded9a
MT
12 -ffunction-sections \
13 -fdata-sections
14
15AM_LDFLAGS = \
16 -Wl,--gc-sections \
17 -Wl,--as-needed
18
19LIBLOC_CURRENT=0
20LIBLOC_REVISION=0
21LIBLOC_AGE=0
22
23SED_PROCESS = \
24 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
25 -e 's,@VERSION\@,$(VERSION),g' \
26 -e 's,@prefix\@,$(prefix),g' \
27 -e 's,@exec_prefix\@,$(exec_prefix),g' \
28 -e 's,@libdir\@,$(libdir),g' \
29 -e 's,@includedir\@,$(includedir),g' \
73d1b258 30 -e 's,@databasedir\@,$(databasedir),g' \
46aded9a
MT
31 < $< > $@ || rm $@
32
73d1b258 33databasedir = $(datadir)/location
46aded9a
MT
34pkgconfigdir = $(libdir)/pkgconfig
35
73d1b258 36%: %.in Makefile
46aded9a
MT
37 $(SED_PROCESS)
38
e51e1dec
MT
39EXTRA_DIST += \
40 examples/python/create-database.py \
41 examples/python/read-database.py
42
46aded9a 43pkginclude_HEADERS = \
c182393f 44 src/loc/libloc.h \
9fc7f001
MT
45 src/loc/as.h \
46 src/loc/database.h \
47 src/loc/format.h \
48 src/loc/network.h \
49 src/loc/private.h \
50 src/loc/stringpool.h \
c182393f 51 src/loc/writer.h
46aded9a
MT
52
53lib_LTLIBRARIES = \
54 src/libloc.la
55
9fc7f001 56src_libloc_la_SOURCES = \
62b83e6d 57 src/libloc.c \
a5db3e49 58 src/as.c \
2601e83e 59 src/database.c \
3b5f4af2 60 src/network.c \
62b83e6d 61 src/stringpool.c \
c182393f 62 src/writer.c
46aded9a
MT
63
64EXTRA_DIST += src/libloc.sym
65
18e2b14c
MT
66src_libloc_la_CFLAGS = \
67 $(AM_CFLAGS) \
1a3cb1b4 68 -DLIBLOC_PRIVATE \
18e2b14c
MT
69 -fvisibility=hidden
70
46aded9a
MT
71src_libloc_la_LDFLAGS = \
72 $(AM_LDFLAGS) \
73 -version-info $(LIBLOC_CURRENT):$(LIBLOC_REVISION):$(LIBLOC_AGE) \
74 -Wl,--version-script=$(top_srcdir)/src/libloc.sym
75
76src_libloc_la_DEPENDENCIES = \
77 ${top_srcdir}/src/libloc.sym
78
79pkgconfig_DATA = \
80 src/libloc.pc
81
82EXTRA_DIST += \
83 src/libloc.pc.in
84
85CLEANFILES += \
86 src/libloc.pc
87
a2ab8ddf 88pyexec_LTLIBRARIES = \
18e2b14c
MT
89 src/python/location.la
90
91src_python_location_la_SOURCES = \
9cdf6c53 92 src/python/locationmodule.c \
62ffafdd 93 src/python/locationmodule.h \
fadebc89
MT
94 src/python/as.c \
95 src/python/as.h \
9cdf6c53 96 src/python/database.c \
d688e569 97 src/python/database.h \
39967361
MT
98 src/python/network.c \
99 src/python/network.h \
d688e569
MT
100 src/python/writer.c \
101 src/python/writer.h
18e2b14c
MT
102
103src_python_location_la_CFLAGS = \
104 $(AM_CFLAGS) \
105 $(PYTHON_CFLAGS)
106
107src_python_location_la_LDFLAGS = \
108 $(AM_LDFLAGS) \
109 -shared \
110 -module \
111 -avoid-version
112
113src_python_location_la_LIBADD = \
114 src/libloc.la \
115 $(PYTHON_LIBS)
116
5118a4b8
MT
117bin_SCRIPTS = \
118 src/python/location-query
119
73d1b258
MT
120EXTRA_DIST += \
121 src/python/location-query.in
122
123CLEANFILES += \
124 src/python/location-query
125
30ac38a1
MT
126TESTS_CFLAGS = \
127 $(AM_CFLAGS) \
128 -DLIBLOC_PRIVATE
129
46aded9a 130TESTS = \
62b83e6d 131 src/test-libloc \
2601e83e 132 src/test-stringpool \
a5db3e49 133 src/test-database \
3b5f4af2
MT
134 src/test-as \
135 src/test-network
46aded9a 136
f3bf970a
MT
137CLEANFILES += \
138 test.db
139
46aded9a 140check_PROGRAMS = \
62b83e6d 141 src/test-libloc \
2601e83e 142 src/test-stringpool \
a5db3e49 143 src/test-database \
3b5f4af2
MT
144 src/test-as \
145 src/test-network
46aded9a
MT
146
147src_test_libloc_SOURCES = \
148 src/test-libloc.c
149
30ac38a1
MT
150src_test_libloc_CFLAGS = \
151 $(TESTS_CFLAGS)
152
46aded9a
MT
153src_test_libloc_LDADD = \
154 src/libloc.la
62b83e6d 155
a5db3e49
MT
156src_test_as_SOURCES = \
157 src/test-as.c
158
30ac38a1
MT
159src_test_as_CFLAGS = \
160 $(TESTS_CFLAGS)
161
a5db3e49
MT
162src_test_as_LDADD = \
163 src/libloc.la
164
3b5f4af2
MT
165src_test_network_SOURCES = \
166 src/test-network.c
167
30ac38a1
MT
168src_test_network_CFLAGS = \
169 $(TESTS_CFLAGS)
170
3b5f4af2
MT
171src_test_network_LDADD = \
172 src/libloc.la
173
62b83e6d
MT
174src_test_stringpool_SOURCES = \
175 src/test-stringpool.c
176
30ac38a1
MT
177src_test_stringpool_CFLAGS = \
178 $(TESTS_CFLAGS)
179
62b83e6d
MT
180src_test_stringpool_LDADD = \
181 src/libloc.la
2601e83e
MT
182
183src_test_database_SOURCES = \
184 src/test-database.c
185
30ac38a1
MT
186src_test_database_CFLAGS = \
187 $(TESTS_CFLAGS)
188
2601e83e
MT
189src_test_database_LDADD = \
190 src/libloc.la