2016-11-29 20:51:50 +01:00
|
|
|
#! /usr/bin/make
|
|
|
|
|
|
|
|
# Designed to be run one level up
|
|
|
|
wire-wrongdir:
|
|
|
|
$(MAKE) -C .. wire-all
|
|
|
|
|
2018-09-14 00:43:12 +02:00
|
|
|
WIRE_HEADERS_NOGEN := wire/onion_defs.h \
|
|
|
|
wire/peer_wire.h \
|
2017-04-01 12:25:59 +02:00
|
|
|
wire/wire.h \
|
2017-01-10 05:52:20 +01:00
|
|
|
wire/wire_sync.h \
|
|
|
|
wire/wire_io.h
|
2017-01-06 04:10:35 +01:00
|
|
|
WIRE_GEN_HEADERS := wire/gen_peer_wire.h wire/gen_onion_wire.h
|
2017-01-04 04:39:20 +01:00
|
|
|
WIRE_GEN_SRC := wire/gen_peer_wire.c
|
2017-01-06 04:10:35 +01:00
|
|
|
WIRE_GEN_ONION_SRC := wire/gen_onion_wire.c
|
2017-01-10 05:51:20 +01:00
|
|
|
WIRE_SRC := wire/wire_sync.c \
|
2017-01-10 05:52:20 +01:00
|
|
|
wire/wire_io.c \
|
2017-01-10 05:51:20 +01:00
|
|
|
wire/fromwire.c \
|
2017-04-01 12:25:59 +02:00
|
|
|
wire/peer_wire.c \
|
2017-01-04 04:39:20 +01:00
|
|
|
wire/towire.c
|
2017-08-28 18:13:01 +02:00
|
|
|
WIRE_HEADERS := $(WIRE_HEADERS_NOGEN) $(WIRE_GEN_HEADERS)
|
2017-01-04 04:39:20 +01:00
|
|
|
|
|
|
|
WIRE_OBJS := $(WIRE_SRC:.c=.o) $(WIRE_GEN_SRC:.c=.o)
|
2017-01-06 04:10:35 +01:00
|
|
|
WIRE_ONION_OBJS := $(WIRE_GEN_ONION_SRC:.c=.o)
|
2017-08-28 18:13:01 +02:00
|
|
|
|
|
|
|
ALL_OBJS += $(WIRE_OBJS) $(WIRE_ONION_OBJS)
|
2017-08-29 06:12:04 +02:00
|
|
|
ALL_GEN_HEADERS += $(WIRE_GEN_HEADERS)
|
2016-11-29 20:51:50 +01:00
|
|
|
|
|
|
|
# They may not have the bolts.
|
2018-09-14 00:59:22 +02:00
|
|
|
BOLT_EXTRACT=$(LOCAL_BOLTDIR)/tools/extract-formats.py
|
2017-01-06 04:10:35 +01:00
|
|
|
|
2019-04-18 08:27:30 +02:00
|
|
|
# Explicit command to re-extract CSV from BOLTs.
|
|
|
|
extract-bolt-csv: bolt-precheck
|
|
|
|
@$(BOLT_EXTRACT) --message-fields --message-types $(LOCAL_BOLTDIR)/0[127]*.md > wire/extracted_peer_wire_csv
|
|
|
|
@echo '#include <wire/onion_defs.h>' > wire/extracted_onion_wire_csv
|
|
|
|
@$(BOLT_EXTRACT) --message-fields --message-types $(LOCAL_BOLTDIR)/04*.md >> wire/extracted_onion_wire_csv
|
2018-09-14 00:59:22 +02:00
|
|
|
|
2019-04-18 08:27:30 +02:00
|
|
|
wire/gen_peer_wire.h: $(WIRE_GEN) wire/extracted_peer_wire_csv
|
2017-09-28 05:41:19 +02:00
|
|
|
$(WIRE_GEN) --bolt --header $@ wire_type < wire/gen_peer_wire_csv > $@
|
2016-11-29 20:51:50 +01:00
|
|
|
|
2019-04-18 08:27:30 +02:00
|
|
|
wire/gen_peer_wire.c: $(WIRE_GEN) wire/extracted_peer_wire_csv
|
2017-09-28 05:41:19 +02:00
|
|
|
$(WIRE_GEN) --bolt ${@:.c=.h} wire_type < wire/gen_peer_wire_csv > $@
|
2016-11-29 20:51:50 +01:00
|
|
|
|
2017-01-06 04:10:35 +01:00
|
|
|
wire/gen_onion_wire.h: $(WIRE_GEN) wire/gen_onion_wire_csv
|
2017-09-28 05:41:19 +02:00
|
|
|
$(WIRE_GEN) --bolt --header $@ onion_type < wire/gen_onion_wire_csv > $@
|
2017-01-06 04:10:35 +01:00
|
|
|
|
|
|
|
wire/gen_onion_wire.c: $(WIRE_GEN) wire/gen_onion_wire_csv
|
2017-09-28 05:41:19 +02:00
|
|
|
$(WIRE_GEN) --bolt ${@:.c=.h} onion_type < wire/gen_onion_wire_csv > $@
|
2017-01-06 04:10:35 +01:00
|
|
|
|
2017-08-28 18:13:01 +02:00
|
|
|
check-source: $(WIRE_SRC:%=check-src-include-order/%) $(WIRE_HEADERS_NOGEN:%=check-hdr-include-order/%)
|
2017-01-04 04:39:20 +01:00
|
|
|
|
2017-08-28 18:13:01 +02:00
|
|
|
check-source-bolt: $(WIRE_SRC:%=bolt-check/%) $(WIRE_HEADERS_NOGEN:%=bolt-check/%)
|
2017-01-04 04:39:20 +01:00
|
|
|
|
2017-08-28 18:13:01 +02:00
|
|
|
check-whitespace: $(WIRE_SRC:%=check-whitespace/%) $(WIRE_HEADERS_NOGEN:%=check-whitespace/%) check-whitespace/wire/Makefile
|
2017-01-04 04:39:20 +01:00
|
|
|
|
2016-11-29 20:51:50 +01:00
|
|
|
clean: wire-clean
|
|
|
|
|
2017-01-10 05:53:20 +01:00
|
|
|
maintainer-clean: wire-maintainer-clean
|
|
|
|
|
|
|
|
wire-maintainer-clean:
|
|
|
|
$(RM) wire/gen_*_csv
|
|
|
|
|
|
|
|
wire-all: $(WIRE_OBJS) $(WIRE_ONION_OBJS)
|
2016-11-30 14:43:26 +01:00
|
|
|
|
2016-11-29 20:51:50 +01:00
|
|
|
wire-clean:
|
2017-03-02 13:21:39 +01:00
|
|
|
$(RM) $(WIRE_OBJS) $(WIRE_ONION_OBJS) $(WIRE_GEN_SRC) $(WIRE_GEN_ONION_SRC) $(WIRE_GEN_HEADERS)
|
2016-11-29 20:51:50 +01:00
|
|
|
|
2017-01-04 04:39:20 +01:00
|
|
|
include wire/test/Makefile
|