2017-05-12 20:24:18 +02:00
|
|
|
#! /usr/bin/make
|
|
|
|
|
|
|
|
# Designed to be run one level up
|
|
|
|
wallet-wrongdir:
|
|
|
|
$(MAKE) -C .. lightningd-all
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
|
WALLET_LIB_OBJS := $(WALLET_LIB_SRC:.c=.o) $(WALLET_DB_DRIVERS:.c=.o)
|
2017-05-12 20:24:18 +02:00
|
|
|
WALLET_LIB_HEADERS := $(WALLET_LIB_SRC:.c=.h)
|
|
|
|
|
2018-03-07 01:06:07 +01:00
|
|
|
# Make sure these depend on everything.
|
2018-09-11 22:21:48 +02:00
|
|
|
ALL_OBJS += $(WALLET_LIB_OBJS)
|
|
|
|
|
|
|
|
$(WALLET_LIB_OBJS): $(LIGHTNINGD_HEADERS_NOGEN) $(WALLET_LIB_HEADERS)
|
2018-03-07 01:06:07 +01:00
|
|
|
|
2017-05-12 20:24:18 +02:00
|
|
|
check-whitespace: $(WALLET_LIB_SRC:%=check-whitespace/%) $(WALLET_LIB_HEADERS:%=check-whitespace/%)
|
2018-03-07 01:06:07 +01:00
|
|
|
check-source: $(WALLET_LIB_SRC:%=check-src-include-order/%)
|
|
|
|
check-source: $(WALLET_LIB_HEADERS:%=check-hdr-include-order/%)
|
|
|
|
check-source-bolt: $(WALLET_LIB_SRC:%=bolt-check/%) $(WALLET_LIB_HEADERS:%=bolt-check/%)
|
2017-05-12 20:24:18 +02:00
|
|
|
|
|
|
|
clean: wallet-clean
|
|
|
|
|
2019-09-02 18:32:15 +02:00
|
|
|
# Each database driver depends on its rewritten statements.
|
2019-07-24 18:29:03 +02:00
|
|
|
wallet/db_sqlite3.c: wallet/gen_db_sqlite3.c
|
2019-09-02 18:32:15 +02:00
|
|
|
wallet/db_postgres.c: wallet/gen_db_postgres.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 \
|
|
|
|
|
|
|
|
wallet/statements.po: $(SQL_FILES)
|
|
|
|
xgettext -kNAMED_SQL -kSQL --add-location --no-wrap --omit-header -o $@ $(SQL_FILES)
|
|
|
|
|
2019-09-02 18:32:15 +02:00
|
|
|
wallet/gen_db_%.c: wallet/statements.po devtools/sql-rewrite.py
|
|
|
|
devtools/sql-rewrite.py wallet/statements.po $* > wallet/gen_db_$*.c
|
2019-07-24 18:29:03 +02:00
|
|
|
|
2017-05-12 20:24:18 +02:00
|
|
|
wallet-clean:
|
|
|
|
$(RM) $(WALLET_LIB_OBJS)
|
2019-07-24 18:29:03 +02:00
|
|
|
$(RM) wallet/statements.po
|
|
|
|
$(RM) wallet/gen_db_sqlite3.c
|
2019-09-02 18:32:15 +02:00
|
|
|
$(RM) wallet/gen_db_postgres.c
|
2017-12-12 04:42:37 +01:00
|
|
|
|
|
|
|
include wallet/test/Makefile
|