Skip to content

Commit

Permalink
Makefile: Making sure header vars are populated correctly
Browse files Browse the repository at this point in the history
The problem with wire headers not being generated in time before stuff
depended on it turns out to be related with inclusion order of
sub-makefiles. The inclusions must preceed the use of
LIGHTNINGD_HEADERS since they append to that variable.
  • Loading branch information
cdecker authored and rustyrussell committed Jan 13, 2017
1 parent 91209d4 commit b41d71d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lightningd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ LIGHTNINGD_HEADERS = \
$(GEN_HEADERS) \
$(CCAN_HEADERS) \
$(DAEMON_HEADERS) \
$(LIGHTNINGD_HSM_CONTROL_HEADERS) \
$(LIGHTNINGD_HANDSHAKE_CONTROL_HEADERS) \
$(LIBBASE58_HEADERS) \
$(LIBSODIUM_HEADERS)

$(LIGHTNINGD_OBJS) $(LIGHTNINGD_LIB_OBJS): $(LIGHTNINGD_HEADERS)

# These included makefiles add their headers to the LIGHTNINGD_HEADERS
# variable so the include must preceed any actual use of the variable.
include lightningd/hsm/Makefile
include lightningd/handshake/Makefile
include lightningd/gossip/Makefile

$(LIGHTNINGD_OBJS) $(LIGHTNINGD_LIB_OBJS): $(LIGHTNINGD_HEADERS)

check-source: $(LIGHTNINGD_SRC:%=check-src-include-order/%)
check-source: $(LIGHTNINGD_LIB_SRC:%=check-src-include-order/%)
check-source: $(LIGHTNINGD_CLI_SRC:%=check-src-include-order/%)
Expand Down
2 changes: 2 additions & 0 deletions lightningd/gossip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ LIGHTNINGD_HEADERS += $(LIGHTNINGD_GOSSIP_HEADERS)

$(LIGHTNINGD_GOSSIP_OBJS) $(LIGHTNINGD_GOSSIP_CLIENT_OBJS): $(LIGHTNINGD_HEADERS)

$(LIGHTNINGD_GOSSIP_CONTROL_OBJS) : $(LIGHTNINGD_GOSSIP_CONTROL_HEADERS)

lightningd/gossip-all: lightningd/lightningd_gossip $(LIGHTNINGD_GOSSIP_CLIENT_OBJS)

lightningd/lightningd_gossip: $(LIGHTNINGD_GOSSIP_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) $(LIGHTNINGD_LIB_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a
Expand Down
2 changes: 2 additions & 0 deletions lightningd/hsm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ LIGHTNINGD_HEADERS += $(LIGHTNINGD_HSM_HEADERS)

$(LIGHTNINGD_HSM_OBJS) $(LIGHTNINGD_HSM_CLIENT_OBJS): $(LIGHTNINGD_HEADERS)

$(LIGHTNINGD_HSM_CONTROL_OBJS) : $(LIGHTNINGD_HSM_CONTROL_HEADERS)

lightningd/hsm-all: lightningd/lightningd_hsm $(LIGHTNINGD_HSM_CLIENT_OBJS)

lightningd/lightningd_hsm: $(LIGHTNINGD_HSM_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a
Expand Down

0 comments on commit b41d71d

Please sign in to comment.