From 39153f31222e60704d8cdd35c16041a68148eee5 Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Tue, 16 Apr 2019 12:32:30 -0700 Subject: [PATCH] wire-gen: use staging file for generated wire csvs for now we straight copy the `extracted_peer_wire_csv` over into the file that is used to generate the .c/.h files; in the future we'll use this destination file as a way to modify the `gen_peer_wire_csv`s from a patch. --- wire/Makefile | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/wire/Makefile b/wire/Makefile index e928efcd4..6dc17aeed 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -34,17 +34,23 @@ extract-bolt-csv: bolt-precheck @echo '#include ' > wire/extracted_onion_wire_csv @$(BOLT_EXTRACT) --message-fields --message-types $(LOCAL_BOLTDIR)/04*.md >> wire/extracted_onion_wire_csv -wire/gen_peer_wire.h: $(WIRE_GEN) wire/extracted_peer_wire_csv - $(WIRE_GEN) --bolt --header $@ wire_type < wire/gen_peer_wire_csv > $@ +wire/gen_peer_wire_csv: wire/extracted_peer_wire_csv + @cp $< $@ -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_onion_wire_csv: wire/extracted_onion_wire_csv + @cp $< $@ -wire/gen_onion_wire.h: $(WIRE_GEN) wire/gen_onion_wire_csv - $(WIRE_GEN) --bolt --header $@ onion_type < wire/gen_onion_wire_csv > $@ +wire/gen_peer_wire.h: wire/gen_peer_wire_csv $(WIRE_GEN) + $(WIRE_GEN) --bolt --header $@ wire_type < $< > $@ -wire/gen_onion_wire.c: $(WIRE_GEN) wire/gen_onion_wire_csv - $(WIRE_GEN) --bolt ${@:.c=.h} onion_type < wire/gen_onion_wire_csv > $@ +wire/gen_peer_wire.c: wire/gen_peer_wire_csv $(WIRE_GEN) + $(WIRE_GEN) --bolt ${@:.c=.h} wire_type < $< > $@ + +wire/gen_onion_wire.h: wire/gen_onion_wire_csv $(WIRE_GEN) + $(WIRE_GEN) --bolt --header $@ onion_type < $< > $@ + +wire/gen_onion_wire.c: wire/gen_onion_wire_csv $(WIRE_GEN) + $(WIRE_GEN) --bolt ${@:.c=.h} onion_type < $< > $@ check-source: $(WIRE_SRC:%=check-src-include-order/%) $(WIRE_HEADERS_NOGEN:%=check-hdr-include-order/%) @@ -62,6 +68,6 @@ wire-maintainer-clean: wire-all: $(WIRE_OBJS) $(WIRE_ONION_OBJS) wire-clean: - $(RM) $(WIRE_OBJS) $(WIRE_ONION_OBJS) $(WIRE_GEN_SRC) $(WIRE_GEN_ONION_SRC) $(WIRE_GEN_HEADERS) + $(RM) $(WIRE_OBJS) $(WIRE_ONION_OBJS) $(WIRE_GEN_SRC) $(WIRE_GEN_ONION_SRC) $(WIRE_GEN_HEADERS) wire/gen_*_wire_csv include wire/test/Makefile