diff --git a/Makefile b/Makefile index 46ef0e9..314404c 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,16 @@ # 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 # Configuration for fetching the right binary OS ?= "linux"