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 14:15:30 +00:00
|
|
|
wallet/invoices.c \
|
2023-03-30 15:45:53 +10:30
|
|
|
wallet/psbt_fixup.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 12:45:35 -06:00
|
|
|
WALLET_LIB_SRC_NOHDR := \
|
2022-03-01 12:24:18 -06:00
|
|
|
wallet/reservation.c
|
2020-07-15 15:01:49 +09:30
|
|
|
|
2022-01-03 12:45:35 -06:00
|
|
|
WALLET_DB_QUERIES := \
|
|
|
|
wallet/db_sqlite3_sqlgen.c \
|
|
|
|
wallet/db_postgres_sqlgen.c
|
2019-07-24 18:29:03 +02:00
|
|
|
|
2022-03-01 12:24:18 -06:00
|
|
|
WALLET_SRC := $(WALLET_LIB_SRC) $(WALLET_LIB_SRC_NOHDR) $(WALLET_DB_QUERIES)
|
2020-08-31 10:43:25 +09:30
|
|
|
WALLET_HDRS := $(WALLET_LIB_SRC:.c=.h)
|
2017-05-12 20:24:18 +02:00
|
|
|
|
2020-08-31 10:43:25 +09:30
|
|
|
WALLET_OBJS := $(WALLET_SRC:.c=.o)
|
2018-03-07 10:36:07 +10:30
|
|
|
|
2023-01-16 13:54:48 +10:30
|
|
|
# This really should be a subdir of lightningd/. We depend on their headers!
|
|
|
|
$(WALLET_OBJS): $(LIGHTNINGD_SRC:.c=.h)
|
|
|
|
|
2020-08-31 10:43:25 +09:30
|
|
|
# Make sure these depend on everything.
|
2022-01-03 12:45:35 -06:00
|
|
|
ALL_C_SOURCES += $(WALLET_SRC) $(WALLET_DB_QUERIES)
|
2020-08-31 10:43:25 +09:30
|
|
|
ALL_C_HEADERS += $(WALLET_HDRS)
|
2017-05-12 20:24:18 +02:00
|
|
|
|
2019-07-24 18:29:03 +02:00
|
|
|
# The following files contain SQL-annotated statements that we need to extact
|
2022-01-03 12:45:35 -06: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 12:45:35 -06:00
|
|
|
wallet/statements_gettextgen.po: $(WALLET_SQL_FILES) $(FORCE)
|
2022-09-06 07:15:04 +09:30
|
|
|
@if $(call SHA256STAMP_CHANGED); then \
|
|
|
|
$(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 14:46:05 +09:30
|
|
|
wallet/db_%_sqlgen.c: wallet/statements_gettextgen.po devtools/sql-rewrite.py $(FORCE)
|
2021-09-22 13:45:13 +09:30
|
|
|
@if $(call SHA256STAMP_CHANGED); then \
|
2021-05-26 15:10:01 +09:30
|
|
|
$(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 11:31:12 -05:00
|
|
|
maintainer-clean: clean
|
|
|
|
clean: wallet-maintainer-clean
|
2020-08-31 10:51:16 +09:30
|
|
|
wallet-maintainer-clean:
|
2020-09-04 16:08:32 +02:00
|
|
|
$(RM) wallet/statements.po
|
2020-08-31 10:51:16 +09:30
|
|
|
$(RM) wallet/statements_gettextgen.po
|
2022-01-03 12:45:35 -06:00
|
|
|
$(RM) $(WALLET_DB_QUERIES)
|
2020-08-31 10:51:16 +09:30
|
|
|
|
2017-12-12 14:12:37 +10:30
|
|
|
include wallet/test/Makefile
|