mirror of
https://github.com/logos-storage/logos-storage-go-bindings-example.git
synced 2026-01-07 07:53:07 +00:00
Update makefile
This commit is contained in:
parent
6d23c70508
commit
9ce61c2fcf
13
Makefile
13
Makefile
@ -1,8 +1,8 @@
|
|||||||
# Destination folder for the downloaded libraries
|
# Destination folder for the downloaded libraries
|
||||||
LIBS_DIR := $(abspath ./libs)
|
LIBS_DIR := $(abspath ./libs)
|
||||||
|
|
||||||
UNAME_S := $(shell uname -s)
|
|
||||||
# Flags for CGO to find the headers and the shared library
|
# Flags for CGO to find the headers and the shared library
|
||||||
|
UNAME_S := $(shell uname -s)
|
||||||
ifeq ($(UNAME_S),Darwin)
|
ifeq ($(UNAME_S),Darwin)
|
||||||
CGO_CFLAGS := -I$(LIBS_DIR)
|
CGO_CFLAGS := -I$(LIBS_DIR)
|
||||||
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path/libs
|
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path/libs
|
||||||
@ -21,14 +21,17 @@ endif
|
|||||||
OS ?= "linux"
|
OS ?= "linux"
|
||||||
ARCH ?= "amd64"
|
ARCH ?= "amd64"
|
||||||
VERSION ?= "v0.0.17"
|
VERSION ?= "v0.0.17"
|
||||||
LATEST_URL := "https://github.com/codex-storage/codex-go-bindings/releases/latest/download/codex-${OS}-${ARCH}.zip"
|
DOWNLOAD_URL ?= "https://github.com/codex-storage/codex-go-bindings/releases/latest/download/codex-${OS}-${ARCH}.zip"
|
||||||
VERSIONED_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip"
|
|
||||||
|
ifneq ($(VERSION),)
|
||||||
|
DOWNLOAD_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip"
|
||||||
|
endif
|
||||||
|
|
||||||
all: run
|
all: run
|
||||||
|
|
||||||
fetch:
|
fetch:
|
||||||
@echo "Fetching libcodex from GitHub Actions: ${LATEST_URL}"
|
@echo "Fetching libcodex from GitHub Actions from: ${DOWNLOAD_URL}"
|
||||||
curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${LATEST_URL}
|
curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${DOWNLOAD_URL}
|
||||||
unzip -o -qq $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d $(LIBS_DIR)
|
unzip -o -qq $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d $(LIBS_DIR)
|
||||||
rm -f $(LIBS_DIR)/*.zip
|
rm -f $(LIBS_DIR)/*.zip
|
||||||
# Update the path to the shared library on macOS
|
# Update the path to the shared library on macOS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user