Skip to content

Commit b9efe4e

Browse files
committed
fix(Makefile): update libwaku target
1 parent 2e8d50e commit b9efe4e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ GO_CMD_BUILDS := $(addprefix build/bin/, $(GO_CMD_NAMES))
109109
# Location of symlinks to derivations that should not be garbage collected
110110
export _NIX_GCROOTS = ./.nix-gcroots
111111

112+
# Location of waku-go-bindings and nwaku
113+
WAKU_GO_BINDINGS_DIR := $(shell go list -m -f '{{.Dir}}' github.com/waku-org/waku-go-bindings)
114+
NWAKU_DIR := $(WAKU_GO_BINDINGS_DIR)/third_party/nwaku
115+
LIBWAKU := $(NWAKU_DIR)/libwaku.$(LIBWAKU_EXT)
116+
112117
#----------------
113118
# Nix targets
114119
#----------------
@@ -163,19 +168,18 @@ nix-purge: ##@nix Completely remove Nix setup, including /nix directory
163168
all: $(GO_CMD_NAMES)
164169

165170
.PHONY: $(GO_CMD_NAMES) $(GO_CMD_PATHS) $(GO_CMD_BUILDS)
166-
$(GO_CMD_BUILDS): generate
171+
$(GO_CMD_BUILDS): generate $(LIBWAKU)
167172
$(GO_CMD_BUILDS): ##@build Build any Go project from cmd folder
168173
go build -mod=vendor -v \
169174
-tags '$(BUILD_TAGS)' $(BUILD_FLAGS) \
170175
-o ./$@ ./cmd/$(notdir $@)
171176
@echo "Compilation done."
172177
@echo "Run \"build/bin/$(notdir $@) -h\" to view available commands."
173178

174-
LIBWAKU := $(CURDIR)/vendor/github.com/waku-org/waku-go-bindings/third_party/nwaku/build/libwaku.$(LIBWAKU_EXT)
175179
$(LIBWAKU):
176180
ifeq ($(USE_NWAKU),true)
177-
@echo "Building libwaku"
178-
$(MAKE) -C $(CURDIR)/vendor/github.com/waku-org/waku-go-bindings/waku SHELL=/bin/bash
181+
@echo "Building libwaku in $(NWAKU_DIR)"
182+
$(MAKE) -C "$(WAKU_GO_BINDINGS_DIR)/waku"
179183
endif
180184

181185
statusgo: ##@build Build status-go as status-backend server

0 commit comments

Comments
 (0)