@ -25,12 +25,12 @@ WALLET_OBJS := $(WALLET_SRC:.c=.o)
$(WALLET_OBJS) : $( WALLET_HDRS ) $( LIGHTNINGD_HEADERS )
# Make sure these depend on everything.
ALL_C_SOURCES += $( WALLET_SRC)
ALL_C_SOURCES += $( WALLET_SRC) wallet/db_sqlite3_sqlgen.c wallet/db_postgres_sqlgen.c
ALL_C_HEADERS += $( WALLET_HDRS)
# Each database driver depends on its rewritten statements.
wallet/db_sqlite3.o : wallet /gen_ db_sqlite 3.c
wallet/db_postgres.o : wallet /gen_ db_postgres .c
wallet/db_sqlite3.o : wallet /db_sqlite 3_sqlgen .c
wallet/db_postgres.o : wallet /db_postgres_sqlgen .c
# The following files contain SQL-annotated statements that we need to extact
SQL_FILES := \
@ -40,11 +40,11 @@ SQL_FILES := \
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)
wallet/statements_gettextgen .po : $( SQL_FILES ) FORCE
@if $( call SHA256STAMP_CHANGED,) ; then $( call VERBOSE," xgettext $@ " , xgettext -kNAMED_SQL -kSQL --add-location --no-wrap --omit-header -o $@ $( SQL_FILES) && $( call SHA256STAMP,,# ) ) ; fi
wallet/gen_ db_%.c : wallet /statements .po devtools /sql -rewrite .py
devtools/sql-rewrite.py wallet/statements.po $* > wallet/gen_db_$* .c
wallet/db_%_sqlgen .c : wallet /statements_gettextgen .po devtools /sql -rewrite .py FORCE
@if $( call SHA256STAMP_CHANGED,) ; then $( call VERBOSE," sql-rewrite $@ " , devtools/sql-rewrite.py wallet/statements.po $* > $@ && $( call SHA256STAMP,,//) ) ; fi
clean : wallet_clean
wallet-clean :
@ -52,4 +52,8 @@ wallet-clean:
$( RM) wallet/gen_db_sqlite3.c
$( RM) wallet/gen_db_postgres.c
maintainer-clean : wallet_maintainer -clean
wallet-maintainer-clean :
$( RM) wallet/statements_gettextgen.po
i n c l u d e w a l l e t / t e s t / M a k e f i l e