diff --git a/Makefile b/Makefile index d73cf64b0..1ca311028 100644 --- a/Makefile +++ b/Makefile @@ -241,7 +241,7 @@ check-makefile: check-daemon-makefile # Any mention of BOLT# must be followed by an exact quote, modulo whitepace. check-source-bolt: check-bolt - @if [ ! -d $(BOLTDIR) ]; then echo Not checking BOLT references: BOLTDIR $(BOLTDIR) does not exist >&2; else rm -rf .tmp.lightningrfc; git clone -q -b $(BOLTVERSION) $(BOLTDIR) .tmp.lightningrfc && ./check-bolt .tmp.lightningrfc $(CORE_SRC) $(BITCOIN_SRC) $(DAEMON_SRC) $(CORE_HEADERS) $(BITCOIN_HEADERS) $(DAEMON_HEADERS) $(TEST_PROGRAMS:=.c); fi + @if [ ! -d $(BOLTDIR) ]; then echo Not checking BOLT references: BOLTDIR $(BOLTDIR) does not exist >&2; else rm -rf .tmp.lightningrfc; git clone -q -b $(BOLTVERSION) $(BOLTDIR) .tmp.lightningrfc && ./check-bolt .tmp.lightningrfc $(CORE_SRC) $(BITCOIN_SRC) $(DAEMON_SRC) $(CORE_HEADERS) $(BITCOIN_HEADERS) $(DAEMON_HEADERS) $(WIRE_SRC) $(WIRE_HEADERS) $(TEST_PROGRAMS:=.c); fi check-bolt: check-bolt.o $(CCAN_OBJS) diff --git a/check-bolt.c b/check-bolt.c index 786e21f46..c71d820a9 100644 --- a/check-bolt.c +++ b/check-bolt.c @@ -41,7 +41,7 @@ static char *canonicalize(char *str) return str; } -static void get_files(const char *dir, const char *subdir, +static bool get_files(const char *dir, const char *subdir, struct bolt_file **files) { char *path = path_join(NULL, dir, subdir); @@ -50,7 +50,7 @@ static void get_files(const char *dir, const char *subdir, struct dirent *e; if (!d) - err(1, "Opening BOLT dir %s", path); + return false; while ((e = readdir(d)) != NULL) { int preflen; @@ -82,13 +82,16 @@ static void get_files(const char *dir, const char *subdir, e->d_name))); n++; } + return true; } static struct bolt_file *get_bolt_files(const char *dir) { struct bolt_file *bolts = tal_arr(NULL, struct bolt_file, 0); - get_files(dir, "bolts", &bolts); + if (!get_files(dir, ".", &bolts)) + err(1, "Opening BOLT dir %s", dir); + /* This currently does not exist. */ get_files(dir, "early-drafts", &bolts); return bolts; } diff --git a/wire/Makefile b/wire/Makefile index 79802219a..4a9872a0d 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -4,13 +4,13 @@ wire-wrongdir: $(MAKE) -C .. wire-all -WIRE_OBJS := wire/gen_wire.o \ - wire/fromwire.o \ - wire/towire.o - WIRE_HEADERS := wire/wire.h WIRE_GEN_HEADERS := wire/gen_wire.h WIRE_GEN_SRC := wire/gen_wire.c +WIRE_SRC := wire/fromwire.c \ + wire/towire.c + +WIRE_OBJS := $(WIRE_SRC:.c=.o) $(WIRE_GEN_SRC:.c=.o) # They may not have the bolts. BOLT_EXTRACT=$(BOLTDIR)/tools/extract-formats.py