Skip to content

Commit 9ce61c2

Browse files
committed
Update makefile
1 parent 6d23c70 commit 9ce61c2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Destination folder for the downloaded libraries
22
LIBS_DIR := $(abspath ./libs)
33

4-
UNAME_S := $(shell uname -s)
54
# Flags for CGO to find the headers and the shared library
5+
UNAME_S := $(shell uname -s)
66
ifeq ($(UNAME_S),Darwin)
77
CGO_CFLAGS := -I$(LIBS_DIR)
88
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path/libs
@@ -21,14 +21,17 @@ endif
2121
OS ?= "linux"
2222
ARCH ?= "amd64"
2323
VERSION ?= "v0.0.17"
24-
LATEST_URL := "https://github.com/codex-storage/codex-go-bindings/releases/latest/download/codex-${OS}-${ARCH}.zip"
25-
VERSIONED_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip"
24+
DOWNLOAD_URL ?= "https://github.com/codex-storage/codex-go-bindings/releases/latest/download/codex-${OS}-${ARCH}.zip"
25+
26+
ifneq ($(VERSION),)
27+
DOWNLOAD_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip"
28+
endif
2629

2730
all: run
2831

2932
fetch:
30-
@echo "Fetching libcodex from GitHub Actions: ${LATEST_URL}"
31-
curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${LATEST_URL}
33+
@echo "Fetching libcodex from GitHub Actions from: ${DOWNLOAD_URL}"
34+
curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${DOWNLOAD_URL}
3235
unzip -o -qq $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d $(LIBS_DIR)
3336
rm -f $(LIBS_DIR)/*.zip
3437
# Update the path to the shared library on macOS

0 commit comments

Comments
 (0)