diff --git a/Makefile b/Makefile index a965338..e4ff0bb 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,15 @@ # Destination folder for the downloaded libraries LIBS_DIR := $(abspath ./libs) +UNAME_S := $(shell uname -s) # Flags for CGO to find the headers and the shared library -CGO_CFLAGS := -I$(LIBS_DIR) -CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) +ifeq ($(UNAME_S),Darwin) + CGO_CFLAGS := -I$(LIBS_DIR) + CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path/libs +else + CGO_CFLAGS := -I$(LIBS_DIR) + CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) +endif ifeq ($(OS),Windows_NT) BIN_NAME := example.exe