aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/Makefile.am
blob: 07c0bf68afd408c9165e12c30d05f5ffdf7786e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# This Makefile.am is in the public domain
AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/pq/ $(POSTGRESQL_CPPFLAGS)

if USE_COVERAGE
  AM_CFLAGS = --coverage -O0
  XLIB = -lgcov
endif

pkgcfgdir = $(prefix)/share/taler/config.d/

pkgcfg_DATA = \
  exchangedb.conf \
  exchangedb-postgres.conf

sqldir = $(prefix)/share/taler/sql/exchange/

sqlinputs = \
  common-0001.sql \
  drop-common.sql \
  exchange-0001-part.sql \
  drop0001-exchange-part.sql \
  shard-0001-part.sql \
  drop0001-shard-part.sql

sql_DATA = \
  benchmark-0000.sql \
  benchmark-0001.sql \
  exchange-0000.sql \
  exchange-0001.sql \
  drop0001.sql \
  shard-0000.sql \
  shard-0001.sql \
  shard-drop0001.sql


BUILT_SOURCES = \
  shard-0000.sql \
  shard-0001.sql \
  exchange-0001.sql \
  drop0001.sql \
  shard-drop0001.sql

CLEANFILES = \
  shard-0000.sql \
  shard-0001.sql \
  exchange-0001.sql \
  drop0001.sql \
  shard-drop0001.sql

exchange-0001.sql: common-0001.sql exchange-0001-part.sql
	chmod +w $@ || true
	cat common-0001.sql exchange-0001-part.sql >$@
	chmod -w $@

shard-0001.sql: common-0001.sql shard-0001-part.sql
	chmod +w $@ || true
	cat common-0001.sql shard-0001-part.sql >$@
	chmod -w $@

shard-0000.sql: exchange-0000.sql
	chmod +w $@ || true
	cp exchange-0000.sql $@
	chmod -w $@

drop0001.sql: drop-common.sql drop0001-exchange-part.sql
	chmod +w $@ || true
	cat drop-common.sql drop0001-exchange-part.sql >$@
	chmod -w $@

shard-drop0001.sql: drop-common.sql drop0001-shard-part.sql
	chmod +w $@ || true
	cat drop-common.sql drop0001-shard-part.sql >$@
	chmod -w $@

EXTRA_DIST = \
  exchangedb.conf \
  exchangedb-postgres.conf \
  plugin_exchangedb_common.c \
  irbt_callbacks.c \
  lrbt_callbacks.c \
  bench-db-postgres.conf \
  test-exchange-db-postgres.conf \
  $(sqlinputs) \
  $(sql_DATA)

plugindir = $(libdir)/taler

if HAVE_POSTGRESQL
plugin_LTLIBRARIES = \
  libtaler_plugin_exchangedb_postgres.la
endif

libtaler_plugin_exchangedb_postgres_la_SOURCES = \
  plugin_exchangedb_postgres.c
libtaler_plugin_exchangedb_postgres_la_LIBADD = \
  $(LTLIBINTL)
libtaler_plugin_exchangedb_postgres_la_LDFLAGS = \
  $(TALER_PLUGIN_LDFLAGS) \
  $(top_builddir)/src/pq/libtalerpq.la \
  $(top_builddir)/src/json/libtalerjson.la \
  $(top_builddir)/src/util/libtalerutil.la \
  -lpq \
  -lpthread \
  -lgnunetpq \
  -lgnunetutil \
  -ljansson \
  $(XLIB)

lib_LTLIBRARIES = \
  libtalerexchangedb.la

libtalerexchangedb_la_SOURCES = \
  exchangedb_accounts.c \
  exchangedb_plugin.c \
  exchangedb_transactions.c
libtalerexchangedb_la_LIBADD = \
  $(top_builddir)/src/bank-lib/libtalerbank.la \
  $(top_builddir)/src/util/libtalerutil.la \
  -lgnunetutil \
  $(XLIB)
libtalerexchangedb_la_LDFLAGS = \
  $(POSTGRESQL_LDFLAGS) \
  -version-info 1:0:0 \
  -no-undefined


check_PROGRAMS = \
  test-exchangedb-postgres \
  bench-db-postgres

AM_TESTS_ENVIRONMENT=export TALER_PREFIX=$${TALER_PREFIX:-@libdir@};export PATH=$${TALER_PREFIX:-@prefix@}/bin:$$PATH;
TESTS = \
  test-exchangedb-postgres

test_exchangedb_postgres_SOURCES = \
  test_exchangedb.c
test_exchangedb_postgres_LDADD = \
  libtalerexchangedb.la \
  $(top_builddir)/src/json/libtalerjson.la \
  $(top_builddir)/src/util/libtalerutil.la \
  $(top_builddir)/src/pq/libtalerpq.la \
  -ljansson \
  -lgnunetjson \
  -lgnunetutil \
  $(XLIB)

bench_db_postgres_SOURCES = \
  bench_db.c
bench_db_postgres_LDADD = \
  libtalerexchangedb.la \
  $(top_builddir)/src/util/libtalerutil.la \
  $(top_builddir)/src/pq/libtalerpq.la \
  -lgnunetpq \
  -lgnunetutil \
  $(XLIB)

EXTRA_test_exchangedb_postgres_DEPENDENCIES = \
  libtaler_plugin_exchangedb_postgres.la