Skip to content

Commit ad0c731

Browse files
sangbidarustyrussell
authored andcommitted
makefile: fix glob expansion for macOS
when bash expands bitcoin/*.h, it returns the files in lexicographically sorted order by default this is not necessarily the case for macOS so it has be explicitly sorted. I get a fairly uninformative error like this: make: *** [check-bitcoin-makefile] Error 1 The error is now more informative and does not error on a clean branch on macOS: BITCOIN_HEADERS missing: bitcoin/signature.h bitcoin/tx_parts.h bitcoin/tx.h bitcoin/varint.h make: *** [check-bitcoin-makefile] Error 1
1 parent c758672 commit ad0c731

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

bitcoin/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ ALL_C_SOURCES += $(BITCOIN_SRC)
4747
check-makefile: check-bitcoin-makefile
4848

4949
check-bitcoin-makefile:
50-
@if [ "`echo bitcoin/*.h`" != "$(BITCOIN_HEADERS)" ]; then echo BITCOIN_HEADERS incorrect; exit 1; fi
50+
@MISSING="$(filter-out $(BITCOIN_HEADERS), $(wildcard bitcoin/*.h))"; \
51+
EXTRA="$(filter-out $(wildcard bitcoin/*.h), $(BITCOIN_HEADERS))"; \
52+
if [ -n "$$MISSING" ]; then \
53+
echo "BITCOIN_HEADERS missing: $$MISSING"; \
54+
exit 1; \
55+
fi; \
56+
if [ -n "$$EXTRA" ]; then \
57+
echo "BITCOIN_HEADERS has non-existent: $$EXTRA"; \
58+
exit 1; \
59+
fi
5160

5261
check-whitespace: check-whitespace/bitcoin/Makefile
5362

0 commit comments

Comments
 (0)