2017-05-12 20:24:18 +02:00
|
|
|
#! /usr/bin/make
|
|
|
|
|
2017-06-20 17:15:25 +02:00
|
|
|
WALLET_LIB_SRC := \
|
|
|
|
wallet/db.c \
|
2018-01-14 15:15:30 +01:00
|
|
|
wallet/invoices.c \
|
2018-03-02 14:56:39 +01:00
|
|
|
wallet/txfilter.c \
|
2017-06-20 17:15:25 +02:00
|
|
|
wallet/wallet.c \
|
|
|
|
wallet/walletrpc.c
|
2017-05-12 20:24:18 +02:00
|
|
|
|
2022-01-03 19:45:35 +01:00
|
|
|
WALLET_LIB_SRC_NOHDR := \
|
|
|
|
wallet/reservation.c \
|
|
|
|
wallet/db_queries_postgres.c \
|
|
|
|
wallet/db_queries_sqlite3.c
|
2020-07-15 07:31:49 +02:00
|
|
|
|
2022-01-03 19:45:35 +01:00
|
|
|
WALLET_DB_QUERIES := \
|
|
|
|
wallet/db_sqlite3_sqlgen.c \
|
|
|
|
wallet/db_postgres_sqlgen.c
|
2019-07-24 18:29:03 +02:00
|
|
|
|
2022-01-03 19:45:35 +01:00
|
|
|
WALLET_SRC := $(WALLET_LIB_SRC) $(WALLET_LIB_SRC_NOHDR)
|
2020-08-31 03:13:25 +02:00
|
|
|
WALLET_HDRS := $(WALLET_LIB_SRC:.c=.h)
|
2017-05-12 20:24:18 +02:00
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
WALLET_OBJS := $(WALLET_SRC:.c=.o)
|
2018-03-07 01:06:07 +01:00
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
# Make sure these depend on everything.
|
2022-01-03 19:45:35 +01:00
|
|
|
ALL_C_SOURCES += $(WALLET_SRC) $(WALLET_DB_QUERIES)
|
2020-08-31 03:13:25 +02:00
|
|
|
ALL_C_HEADERS += $(WALLET_HDRS)
|
2017-05-12 20:24:18 +02:00
|
|
|
|
2022-01-03 19:45:35 +01:00
|
|
|
# Query sets depend on the rewritten queries
|
|
|
|
wallet/db_queries_sqlite3.o: $(WALLET_DB_QUERIES)
|
|
|
|
wallet/db_queries_postgres.o: $(WALLET_DB_QUERIES)
|
2019-07-24 18:29:03 +02:00
|
|
|
|
|
|
|
# The following files contain SQL-annotated statements that we need to extact
|
2022-01-03 19:45:35 +01:00
|
|
|
WALLET_SQL_FILES := \
|
|
|
|
$(DB_SQL_FILES) \
|
2019-07-24 18:29:03 +02:00
|
|
|
wallet/db.c \
|
|
|
|
wallet/invoices.c \
|
|
|
|
wallet/wallet.c \
|
|
|
|
wallet/test/run-db.c \
|
|
|
|
wallet/test/run-wallet.c \
|
|
|
|
|
2022-01-03 19:45:35 +01:00
|
|
|
wallet/statements_gettextgen.po: $(WALLET_SQL_FILES) $(FORCE)
|
2021-09-22 06:15:13 +02:00
|
|
|
@if $(call SHA256STAMP_CHANGED); then \
|
2022-01-03 19:45:35 +01:00
|
|
|
$(call VERBOSE,"xgettext $@",xgettext -kNAMED_SQL -kSQL --add-location --no-wrap --omit-header -o $@ $(WALLET_SQL_FILES) && $(call SHA256STAMP,# ,)); \
|
2020-10-17 16:48:01 +02:00
|
|
|
fi
|
2019-07-24 18:29:03 +02:00
|
|
|
|
2021-05-21 07:16:05 +02:00
|
|
|
wallet/db_%_sqlgen.c: wallet/statements_gettextgen.po devtools/sql-rewrite.py $(FORCE)
|
2021-09-22 06:15:13 +02:00
|
|
|
@if $(call SHA256STAMP_CHANGED); then \
|
2021-05-26 07:40:01 +02:00
|
|
|
$(call VERBOSE,"sql-rewrite $@",devtools/sql-rewrite.py wallet/statements_gettextgen.po $* > $@ && $(call SHA256STAMP,//,)); \
|
2020-10-17 16:48:01 +02:00
|
|
|
fi
|
2019-07-24 18:29:03 +02:00
|
|
|
|
2021-12-02 17:31:12 +01:00
|
|
|
maintainer-clean: clean
|
|
|
|
clean: wallet-maintainer-clean
|
2020-08-31 03:21:16 +02:00
|
|
|
wallet-maintainer-clean:
|
2020-09-04 16:08:32 +02:00
|
|
|
$(RM) wallet/statements.po
|
2020-08-31 03:21:16 +02:00
|
|
|
$(RM) wallet/statements_gettextgen.po
|
2022-01-03 19:45:35 +01:00
|
|
|
$(RM) $(WALLET_DB_QUERIES)
|
2020-08-31 03:21:16 +02:00
|
|
|
|
2017-12-12 04:42:37 +01:00
|
|
|
include wallet/test/Makefile
|