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
|
|
|
|
2020-07-15 07:31:49 +02:00
|
|
|
WALLET_LIB_SRC_NOHDR := \
|
|
|
|
wallet/reservation.c
|
|
|
|
|
2019-07-24 18:29:03 +02:00
|
|
|
WALLET_DB_DRIVERS := \
|
2019-09-02 18:32:15 +02:00
|
|
|
wallet/db_postgres.c \
|
2019-07-24 18:29:03 +02:00
|
|
|
wallet/db_sqlite3.c
|
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
WALLET_SRC := $(WALLET_LIB_SRC) $(WALLET_LIB_SRC_NOHDR) $(WALLET_DB_DRIVERS)
|
|
|
|
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)
|
|
|
|
$(WALLET_OBJS): $(WALLET_HDRS) $(LIGHTNINGD_HEADERS)
|
2018-03-07 01:06:07 +01:00
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
# Make sure these depend on everything.
|
2020-08-31 03:21:16 +02:00
|
|
|
ALL_C_SOURCES += $(WALLET_SRC) wallet/db_sqlite3_sqlgen.c wallet/db_postgres_sqlgen.c
|
2020-08-31 03:13:25 +02:00
|
|
|
ALL_C_HEADERS += $(WALLET_HDRS)
|
2017-05-12 20:24:18 +02:00
|
|
|
|
2019-09-02 18:32:15 +02:00
|
|
|
# Each database driver depends on its rewritten statements.
|
2020-08-31 03:21:16 +02:00
|
|
|
wallet/db_sqlite3.o: wallet/db_sqlite3_sqlgen.c
|
|
|
|
wallet/db_postgres.o: wallet/db_postgres_sqlgen.c
|
2019-07-24 18:29:03 +02:00
|
|
|
|
|
|
|
# The following files contain SQL-annotated statements that we need to extact
|
|
|
|
SQL_FILES := \
|
|
|
|
wallet/db.c \
|
|
|
|
wallet/invoices.c \
|
|
|
|
wallet/wallet.c \
|
|
|
|
wallet/test/run-db.c \
|
|
|
|
wallet/test/run-wallet.c \
|
|
|
|
|
2020-08-31 03:21:16 +02:00
|
|
|
wallet/statements_gettextgen.po: $(SQL_FILES) FORCE
|
2020-10-17 16:48:01 +02:00
|
|
|
@if $(call SHA256STAMP_CHANGED); then if [ "$$NO_PYTHON" == 1 ]; then echo "Error: NO_PYTHON on $@"; exit 1; fi; \
|
|
|
|
$(call VERBOSE,"xgettext $@",xgettext -kNAMED_SQL -kSQL --add-location --no-wrap --omit-header -o $@ $(SQL_FILES) && $(call SHA256STAMP,# )); \
|
|
|
|
fi
|
2019-07-24 18:29:03 +02:00
|
|
|
|
2020-08-31 03:21:16 +02:00
|
|
|
wallet/db_%_sqlgen.c: wallet/statements_gettextgen.po devtools/sql-rewrite.py FORCE
|
2020-10-17 16:48:01 +02:00
|
|
|
@if $(call SHA256STAMP_CHANGED); then if [ "$$NO_PYTHON" == 1 ]; then echo "Error: NO_PYTHON on $@"; exit 1; fi; \
|
|
|
|
$(call VERBOSE,"sql-rewrite $@",devtools/sql-rewrite.py wallet/statements_gettextgen.po $* > $@ && $(call SHA256STAMP,//)); \
|
|
|
|
fi
|
2019-07-24 18:29:03 +02:00
|
|
|
|
2020-09-04 16:08:32 +02:00
|
|
|
maintainer-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
|
2020-09-04 16:08:32 +02:00
|
|
|
$(RM) wallet/db_sqlite3_sqlgen.c
|
|
|
|
$(RM) wallet/db_postgres_sqlgen.c
|
2020-08-31 03:21:16 +02:00
|
|
|
|
2017-12-12 04:42:37 +01:00
|
|
|
include wallet/test/Makefile
|