From 5f888b89bc3949931a00768fe085d49c0fb38ee7 Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Thu, 16 Oct 2025 15:59:40 +1100 Subject: [PATCH] update for updated rpath - @rpath removed libs/ so we no longer need to specify the root path as the cwd - now macos and linux use the same flags - remove comments --- Makefile | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 791e00a..850c2ca 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,8 @@ LIBS_DIR := $(abspath ./libs) # Flags for CGO to find the headers and the shared library UNAME_S := $(shell uname -s) -ifeq ($(UNAME_S),Darwin) - CGO_CFLAGS := -I$(LIBS_DIR) - CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path -else - CGO_CFLAGS := -I$(LIBS_DIR) - CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) -endif +CGO_CFLAGS := -I$(LIBS_DIR) +CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) ifeq ($(OS),Windows_NT) BIN_NAME := example.exe @@ -30,10 +25,6 @@ fetch: 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) rm -f $(LIBS_DIR)/*.zip -# Update the path to the shared library on macOS -# ifeq ($(UNAME_S),Darwin) -# install_name_tool -id @rpath/libcodex.dylib $(LIBS_DIR)/libcodex.dylib -# endif build: CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_NAME) main.go