2022-07-19 07:07:26 +02:00
|
|
|
#! /usr/bin/make
|
|
|
|
|
|
|
|
BOOKKEEPER_PLUGIN_SRC := \
|
2022-07-19 07:09:26 +02:00
|
|
|
plugins/bkpr/account.c \
|
2022-07-19 09:34:35 +02:00
|
|
|
plugins/bkpr/account_entry.c \
|
2022-07-19 07:07:26 +02:00
|
|
|
plugins/bkpr/bookkeeper.c \
|
2022-07-19 09:34:35 +02:00
|
|
|
plugins/bkpr/channel_event.c \
|
2022-07-19 07:09:26 +02:00
|
|
|
plugins/bkpr/db.c \
|
|
|
|
plugins/bkpr/recorder.c
|
2022-07-19 07:07:26 +02:00
|
|
|
|
|
|
|
BOOKKEEPER_DB_QUERIES := \
|
|
|
|
plugins/bkpr/db_sqlite3_sqlgen.c \
|
|
|
|
plugins/bkpr/db_postgres_sqlgen.c
|
|
|
|
|
|
|
|
BOOKKEEPER_SRC := $(BOOKKEEPER_PLUGIN_SRC) $(BOOKKEEPER_DB_QUERIES)
|
2022-07-19 07:09:26 +02:00
|
|
|
BOOKKEEPER_HEADER := \
|
|
|
|
plugins/bkpr/account.h \
|
2022-07-19 09:34:35 +02:00
|
|
|
plugins/bkpr/account_entry.h \
|
2022-07-19 07:09:26 +02:00
|
|
|
plugins/bkpr/chain_event.h \
|
|
|
|
plugins/bkpr/channel_event.h \
|
|
|
|
plugins/bkpr/db.h \
|
|
|
|
plugins/bkpr/onchain_fee.h \
|
|
|
|
plugins/bkpr/recorder.h
|
|
|
|
|
2022-07-19 07:07:26 +02:00
|
|
|
BOOKKEEPER_OBJS := $(BOOKKEEPER_SRC:.c=.o)
|
|
|
|
|
|
|
|
$(BOOKKEEPER_OBJS): $(PLUGIN_LIB_HEADER) $(BOOKKEEPER_HEADER)
|
|
|
|
|
2022-07-19 07:56:04 +02:00
|
|
|
PLUGIN_ALL_SRC += $(BOOKKEEPER_SRC) $(BOOKKEEPER_DB_QUERIES)
|
|
|
|
PLUGIN_ALL_HEADER += $(BOOKKEEPER_HEADER)
|
|
|
|
C_PLUGINS += plugins/bookkeeper
|
|
|
|
PLUGINS += plugins/bookkeeper
|
2022-07-19 07:07:26 +02:00
|
|
|
|
|
|
|
plugins/bookkeeper: bitcoin/chainparams.o common/coin_mvt.o $(BOOKKEEPER_OBJS) $(PLUGIN_LIB_OBJS) $(JSMN_OBJTS) $(PLUGIN_COMMON_OBJS) $(WIRE_OBJS) $(DB_OBJS)
|
|
|
|
|
|
|
|
# The following files contain SQL-annotated statements that we need to extact
|
|
|
|
BOOKKEEPER_SQL_FILES := \
|
|
|
|
$(DB_SQL_FILES) \
|
2022-07-19 07:09:26 +02:00
|
|
|
plugins/bkpr/db.c \
|
|
|
|
plugins/bkpr/recorder.c
|
2022-07-19 07:07:26 +02:00
|
|
|
|
|
|
|
plugins/bkpr/statements_gettextgen.po: $(BOOKKEEPER_SQL_FILES) $(FORCE)
|
|
|
|
@if $(call SHA256STAMP_CHANGED_ALL); then \
|
|
|
|
$(call VERBOSE,"xgettext $@",xgettext -kNAMED_SQL -kSQL --add-location --no-wrap --omit-header -o $@ $(BOOKKEEPER_SQL_FILES) && $(call SHA256STAMP_ALL,# ,)); \
|
|
|
|
fi
|
|
|
|
|
|
|
|
plugins/bkpr/db_%_sqlgen.c: plugins/bkpr/statements_gettextgen.po devtools/sql-rewrite.py $(BOOKKEEPER_SQL_FILES) $(FORCE)
|
|
|
|
@if $(call SHA256STAMP_CHANGED); then \
|
|
|
|
$(call VERBOSE,"sql-rewrite $@",devtools/sql-rewrite.py plugins/bkpr/statements_gettextgen.po $* > $@ && $(call SHA256STAMP,//,)); \
|
|
|
|
fi
|
|
|
|
|
|
|
|
maintainer-clean: clean
|
|
|
|
clean: bkpr-maintainer-clean
|
|
|
|
bkpr-maintainer-clean:
|
|
|
|
$(RM) plugins/bkpr/statements.po
|
|
|
|
$(RM) plugins/bkpr/statements_gettextgen.po
|
|
|
|
$(RM) $(BOOKKEEPER_DB_QUERIES)
|
2022-07-19 07:08:26 +02:00
|
|
|
|
|
|
|
include plugins/bkpr/test/Makefile
|