mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
Makefile: don't generate CSVs unless explicitly told to.
ANd rename them: every other "gen" file can be discarded and rebuilt. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -244,6 +244,17 @@ parts of the code:
|
|||||||
This has to be the *first* field of the structure, or else `dev-memleak`
|
This has to be the *first* field of the structure, or else `dev-memleak`
|
||||||
command will think your structure has leaked.
|
command will think your structure has leaked.
|
||||||
|
|
||||||
|
|
||||||
|
Protocol Modifications
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
The source tree contains CSV files extracted from the v1.0 BOLT
|
||||||
|
specifications (wire/extracted_peer_wire_csv and
|
||||||
|
wire/extracted_onion_wire_csv). You can regenerate these by setting
|
||||||
|
`BOLTDIR` and `BOLTVERSION` appropriately, and running `make
|
||||||
|
extract-bolt-csv`.
|
||||||
|
|
||||||
|
|
||||||
Further Information
|
Further Information
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
|||||||
@@ -28,18 +28,16 @@ ALL_GEN_HEADERS += $(WIRE_GEN_HEADERS)
|
|||||||
# They may not have the bolts.
|
# They may not have the bolts.
|
||||||
BOLT_EXTRACT=$(LOCAL_BOLTDIR)/tools/extract-formats.py
|
BOLT_EXTRACT=$(LOCAL_BOLTDIR)/tools/extract-formats.py
|
||||||
|
|
||||||
ifeq ($(DEVELOPER),1)
|
# Explicit command to re-extract CSV from BOLTs.
|
||||||
wire/gen_peer_wire_csv: bolt-precheck
|
extract-bolt-csv: bolt-precheck
|
||||||
@set -e; if [ -d $(LOCAL_BOLTDIR) ]; then for f in $(LOCAL_BOLTDIR)/0[127]*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then $(BOLT_EXTRACT) --message-fields --message-types $(LOCAL_BOLTDIR)/0[127]*.md > $@; break; fi; done; fi
|
@$(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
|
||||||
|
|
||||||
wire/gen_onion_wire_csv: bolt-precheck
|
wire/gen_peer_wire.h: $(WIRE_GEN) wire/extracted_peer_wire_csv
|
||||||
@set -e; if [ -f $(BOLT_EXTRACT) ]; then for f in $(LOCAL_BOLTDIR)/04*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then echo '#include <wire/onion_defs.h>' > $@ && $(BOLT_EXTRACT) --message-fields --message-types $(LOCAL_BOLTDIR)/04*.md >> $@; break; fi; done; fi
|
|
||||||
endif
|
|
||||||
|
|
||||||
wire/gen_peer_wire.h: $(WIRE_GEN) wire/gen_peer_wire_csv
|
|
||||||
$(WIRE_GEN) --bolt --header $@ wire_type < wire/gen_peer_wire_csv > $@
|
$(WIRE_GEN) --bolt --header $@ wire_type < wire/gen_peer_wire_csv > $@
|
||||||
|
|
||||||
wire/gen_peer_wire.c: $(WIRE_GEN) wire/gen_peer_wire_csv
|
wire/gen_peer_wire.c: $(WIRE_GEN) wire/extracted_peer_wire_csv
|
||||||
$(WIRE_GEN) --bolt ${@:.c=.h} wire_type < wire/gen_peer_wire_csv > $@
|
$(WIRE_GEN) --bolt ${@:.c=.h} wire_type < wire/gen_peer_wire_csv > $@
|
||||||
|
|
||||||
wire/gen_onion_wire.h: $(WIRE_GEN) wire/gen_onion_wire_csv
|
wire/gen_onion_wire.h: $(WIRE_GEN) wire/gen_onion_wire_csv
|
||||||
|
|||||||
Reference in New Issue
Block a user