summaryrefslogtreecommitdiff
path: root/exports/platform.mk
diff options
context:
space:
mode:
Diffstat (limited to 'exports/platform.mk')
-rw-r--r--exports/platform.mk23
1 files changed, 23 insertions, 0 deletions
diff --git a/exports/platform.mk b/exports/platform.mk
new file mode 100644
index 0000000..60f47ee
--- /dev/null
+++ b/exports/platform.mk
@@ -0,0 +1,23 @@
+ifndef GOOS
+export GOOS != go env GOHOSTOS
+endif
+ifndef GOARCH
+export GOARCH != go env GOHOSTARCH
+endif
+
+ifeq (windows,$(GOOS))
+LIB_PREFIX =
+LIB_SUFFIX = .dll
+else ifeq (darwin,$(GOOS))
+LIB_PREFIX = lib
+LIB_SUFFIX = .dylib
+else
+LIB_PREFIX = lib
+LIB_SUFFIX = .so
+endif
+
+ifeq (Windows_NT,$(OS))
+export PATH := $(abspath ../../exports/$(GOOS)/$(GOARCH)):$(PATH)
+else
+export LD_LIBRARY_PATH := $(abspath ../../exports/$(GOOS)/$(GOARCH)):$(LD_LIBRARY_PATH)
+endif