2017-08-29 06:12:04 +02:00
|
|
|
#! /usr/bin/make
|
|
|
|
|
|
|
|
# Designed to be run one level up
|
|
|
|
hsmd-wrongdir:
|
|
|
|
$(MAKE) -C .. lightningd/hsm-all
|
|
|
|
|
|
|
|
default: hsmd-all
|
|
|
|
|
2018-09-03 05:40:00 +02:00
|
|
|
LIGHTNINGD_HSM_SRC := hsmd/hsmd.c \
|
2018-09-20 05:06:42 +02:00
|
|
|
hsmd/gen_hsm_wire.c
|
|
|
|
LIGHTNINGD_HSM_HEADERS := hsmd/gen_hsm_wire.h
|
2017-08-29 06:12:04 +02:00
|
|
|
LIGHTNINGD_HSM_OBJS := $(LIGHTNINGD_HSM_SRC:.c=.o)
|
|
|
|
|
|
|
|
# Common source we use.
|
|
|
|
HSMD_COMMON_OBJS := \
|
2019-02-20 12:31:48 +01:00
|
|
|
common/amount.o \
|
2019-07-30 07:25:12 +02:00
|
|
|
common/bigsize.o \
|
2017-08-29 06:12:04 +02:00
|
|
|
common/bip32.o \
|
2018-03-29 04:06:45 +02:00
|
|
|
common/daemon.o \
|
2017-08-29 06:12:04 +02:00
|
|
|
common/daemon_conn.o \
|
2018-01-02 16:34:08 +01:00
|
|
|
common/derive_basepoints.o \
|
2017-08-29 06:12:04 +02:00
|
|
|
common/funding_tx.o \
|
2018-02-08 02:25:12 +01:00
|
|
|
common/gen_status_wire.o \
|
2017-10-26 05:03:19 +02:00
|
|
|
common/hash_u5.o \
|
2017-08-29 06:12:04 +02:00
|
|
|
common/key_derive.o \
|
2018-11-21 22:45:37 +01:00
|
|
|
common/memleak.o \
|
2017-08-29 06:12:04 +02:00
|
|
|
common/msg_queue.o \
|
2019-04-08 11:58:32 +02:00
|
|
|
common/node_id.o \
|
2017-08-29 06:12:04 +02:00
|
|
|
common/permute_tx.o \
|
|
|
|
common/status.o \
|
2018-02-08 02:25:12 +01:00
|
|
|
common/status_wire.o \
|
2018-01-08 11:01:09 +01:00
|
|
|
common/subdaemon.o \
|
2017-10-22 15:32:46 +02:00
|
|
|
common/type_to_string.o \
|
2017-08-29 06:12:04 +02:00
|
|
|
common/utils.o \
|
|
|
|
common/utxo.o \
|
|
|
|
common/version.o \
|
|
|
|
common/withdraw_tx.o
|
|
|
|
|
|
|
|
# For checking
|
2018-09-20 05:06:42 +02:00
|
|
|
LIGHTNINGD_HSM_ALLSRC_NOGEN := $(filter-out hsmd/gen_%, $(LIGHTNINGD_HSM_SRC) $(LIGHTNINGD_HSM_SRC))
|
|
|
|
LIGHTNINGD_HSM_ALLHEADERS_NOGEN := $(filter-out hsmd/gen_%, $(LIGHTNINGD_HSM_HEADERS))
|
2017-08-29 06:12:04 +02:00
|
|
|
|
2018-09-20 05:06:42 +02:00
|
|
|
$(LIGHTNINGD_HSM_OBJS): $(LIGHTNINGD_HEADERS)
|
2017-08-29 06:12:04 +02:00
|
|
|
|
|
|
|
# Make sure these depend on everything.
|
2018-09-20 05:06:42 +02:00
|
|
|
ALL_OBJS += $(LIGHTNINGD_HSM_OBJS)
|
2017-08-29 06:12:04 +02:00
|
|
|
ALL_PROGRAMS += lightningd/lightning_hsmd
|
2018-09-20 05:06:42 +02:00
|
|
|
ALL_GEN_HEADERS += hsmd/gen_hsm_wire.h
|
2017-08-29 06:12:04 +02:00
|
|
|
|
2018-09-20 05:06:42 +02:00
|
|
|
hsmd-all: lightningd/lightning_hsmd
|
2017-08-29 06:12:04 +02:00
|
|
|
|
|
|
|
lightningd/lightning_hsmd: $(LIGHTNINGD_HSM_OBJS) $(LIGHTNINGD_LIB_OBJS) $(HSMD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS)
|
|
|
|
|
|
|
|
hsmd/gen_hsm_wire.h: $(WIRE_GEN) hsmd/hsm_wire.csv
|
2019-07-24 00:51:11 +02:00
|
|
|
$(WIRE_GEN) --page header $@ hsm_wire_type < hsmd/hsm_wire.csv > $@
|
2017-08-29 06:12:04 +02:00
|
|
|
|
|
|
|
hsmd/gen_hsm_wire.c: $(WIRE_GEN) hsmd/hsm_wire.csv
|
2019-07-24 00:51:11 +02:00
|
|
|
$(WIRE_GEN) --page impl ${@:.c=.h} hsm_wire_type < hsmd/hsm_wire.csv > $@
|
2017-08-29 06:12:04 +02:00
|
|
|
|
|
|
|
check-source: $(LIGHTNINGD_HSM_ALLSRC_NOGEN:%=check-src-include-order/%) $(LIGHTNINGD_HSM_ALLHEADERS_NOGEN:%=check-hdr-include-order/%)
|
2018-09-20 05:06:42 +02:00
|
|
|
check-source-bolt: $(LIGHTNINGD_HSM_SRC:%=bolt-check/%)
|
2017-08-29 06:12:04 +02:00
|
|
|
|
|
|
|
check-whitespace: $(LIGHTNINGD_HSM_ALLSRC_NOGEN:%=check-whitespace/%) $(LIGHTNINGD_HSM_ALLHEADERS_NOGEN:%=check-whitespace/%)
|
|
|
|
|
|
|
|
clean: lightningd/hsm-clean
|
|
|
|
|
|
|
|
lightningd/hsm-clean:
|
2017-11-23 04:03:07 +01:00
|
|
|
$(RM) $(LIGHTNINGD_HSM_OBJS) hsmd/gen_*
|
2017-08-29 06:12:04 +02:00
|
|
|
|
2017-11-30 17:07:38 +01:00
|
|
|
-include hsmd/test/Makefile
|