File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -28,24 +28,24 @@ all: run
2828
2929fetch :
3030 @echo " Fetching libcodex from GitHub Actions: ${LATEST_URL} "
31- @ curl -fSL --create-dirs -o $(LIBS_DIR ) /codex-${OS} -${ARCH} .zip ${LATEST_URL}
31+ curl -fSL --create-dirs -o $(LIBS_DIR ) /codex-${OS} -${ARCH} .zip ${LATEST_URL}
3232 unzip -o -qq $(LIBS_DIR ) /codex-${OS} -${ARCH} .zip -d $(LIBS_DIR )
3333 rm -f $(LIBS_DIR ) /* .zip
34+ # Update the path to the shared library on macOS
3435ifeq ($(UNAME_S ) ,Darwin)
3536 install_name_tool -id @rpath/libcodex.dylib $(LIBS_DIR)/libcodex.dylib
3637endif
38+
3739build :
38- @echo " CGO_CFLAGS=$( CGO_CFLAGS) "
39- @echo " CGO_LDFLAGS=$( CGO_LDFLAGS) "
40- ls -l $(LIBS_DIR )
41- go env CGO_LDFLAGS
4240 CGO_ENABLED=1 CGO_CFLAGS=" $( CGO_CFLAGS) " CGO_LDFLAGS=" $( CGO_LDFLAGS) " go build -o $(BIN_NAME ) main.go
41+
4342run :
4443ifeq ($(OS ) ,Windows_NT)
4544 pwsh -Command "Copy-Item libs\libcodex.dll ."
4645 pwsh -Command ".\$(BIN_NAME)"
4746else ifeq ($(UNAME_S),Darwin)
48- # DYLD_LIBRARY_PATH=$(LIBS_DIR) ./$(BIN_NAME)
47+ # Instead of relying on install_name_tool, we can define DYLD_LIBRARY_PATH
48+ # DYLD_LIBRARY_PATH=$(LIBS_DIR) ./$(BIN_NAME)
4949 ./$(BIN_NAME)
5050else
5151 ./$(BIN_NAME)
You can’t perform that action at this time.
0 commit comments