Skip to content

Commit 585f61b

Browse files
authored
Merge pull request #4 from codex-storage/feat/simpilify-makefile
feat: update makefile for updated rpath
2 parents af40887 + bcfb278 commit 585f61b

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

Makefile

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@ LIBS_DIR := $(abspath ./libs)
33

44
# Flags for CGO to find the headers and the shared library
55
UNAME_S := $(shell uname -s)
6-
ifeq ($(UNAME_S),Darwin)
7-
CGO_CFLAGS := -I$(LIBS_DIR)
8-
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path
9-
else
10-
CGO_CFLAGS := -I$(LIBS_DIR)
11-
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
12-
endif
6+
CGO_CFLAGS := -I$(LIBS_DIR)
7+
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
138

149
ifeq ($(OS),Windows_NT)
1510
BIN_NAME := example.exe
@@ -20,7 +15,7 @@ endif
2015
# Configuration for fetching the right binary
2116
OS ?= "linux"
2217
ARCH ?= "amd64"
23-
VERSION ?= "v0.0.20"
18+
VERSION ?= "v0.0.21"
2419
DOWNLOAD_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip"
2520

2621
all: run
@@ -30,21 +25,13 @@ fetch:
3025
curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${DOWNLOAD_URL}
3126
unzip -o -qq $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d $(LIBS_DIR)
3227
rm -f $(LIBS_DIR)/*.zip
33-
# Update the path to the shared library on macOS
34-
# ifeq ($(UNAME_S),Darwin)
35-
# install_name_tool -id @rpath/libcodex.dylib $(LIBS_DIR)/libcodex.dylib
36-
# endif
3728

3829
build:
3930
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_NAME) main.go
4031

4132
run:
4233
ifeq ($(OS),Windows_NT)
4334
pwsh -File $(CURDIR)/.github/scripts/run-windows.ps1 -BinaryName $(BIN_NAME)
44-
else ifeq ($(UNAME_S),Darwin)
45-
# Instead of relying on install_name_tool, we can define DYLD_LIBRARY_PATH
46-
# DYLD_LIBRARY_PATH=$(LIBS_DIR) ./$(BIN_NAME)
47-
./$(BIN_NAME)
4835
else
4936
./$(BIN_NAME)
5037
endif

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module example
22

33
go 1.25.1
44

5-
require github.com/codex-storage/codex-go-bindings v0.0.20
5+
require github.com/codex-storage/codex-go-bindings v0.0.21

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ github.com/codex-storage/codex-go-bindings v0.0.19 h1:zhEhwzcavvYdfkHpB5BH+PaqYv
2020
github.com/codex-storage/codex-go-bindings v0.0.19/go.mod h1:8yC11Vr1Mu5sqZyQ33GaSCr0uUIbQnGkm0aWqZj62Kg=
2121
github.com/codex-storage/codex-go-bindings v0.0.20 h1:vK9jU8vafSJkMpOEHdPiQ9S8owSGUaPGVUxb7hKaIck=
2222
github.com/codex-storage/codex-go-bindings v0.0.20/go.mod h1:8yC11Vr1Mu5sqZyQ33GaSCr0uUIbQnGkm0aWqZj62Kg=
23+
github.com/codex-storage/codex-go-bindings v0.0.21 h1:DAwXw2Xq7wyKyI5j3Jk8ZYBruFP9dOpqEeVMOyEsJxA=
24+
github.com/codex-storage/codex-go-bindings v0.0.21/go.mod h1:8yC11Vr1Mu5sqZyQ33GaSCr0uUIbQnGkm0aWqZj62Kg=

0 commit comments

Comments
 (0)