summaryrefslogtreecommitdiff
path: root/exports
diff options
context:
space:
mode:
authorStevenWdV <stevenwdv@gmail.com>2022-02-09 00:40:38 +0100
committerStevenWdV <stevenwdv@gmail.com>2022-02-09 00:40:38 +0100
commit2aad9b6ae61337ef94b05adc377a9ad2cbaa8eb8 (patch)
tree022c006cfac7a60fd0ab8896fac3991cf34b8fce /exports
parentb60ecf2fe5ddfe506e02093286b3931873187e91 (diff)
Add Android wrapper, remove plain Java Maven wrapper.
Fix some overrides in Makefiles.
Diffstat (limited to 'exports')
-rw-r--r--exports/Makefile7
-rw-r--r--exports/common.mk6
2 files changed, 9 insertions, 4 deletions
diff --git a/exports/Makefile b/exports/Makefile
index cfb9604..3dcf2f0 100644
--- a/exports/Makefile
+++ b/exports/Makefile
@@ -1,14 +1,17 @@
-.PHONY: build copy-to clean
+.PHONY: build clean
include common.mk
ifeq ($(LIB_SUFFIX),.so)
# Add SONAME as cgo does not currently do this. Mostly for Android, see https://stackoverflow.com/a/48291044
-export CGO_LDFLAGS := $(CGO_LDFLAGS) -Wl,-soname,$(LIB_FILE)
+export override CGO_LDFLAGS += -Wl,-soname,$(LIB_FILE)
endif
# Creates targets like 'lib/linux/amd64/libeduvpn_common.so'
build: lib/$(GOOS)/$(GOARCH)/$(LIB_FILE)
+ifdef COPY_LIB_TO
+ install $< -Dt $(COPY_LIB_TO)
+endif
# Build shared library and remove lib prefix (if any) from header name
# GOOS and GOARCH envvars are set by common.mk
diff --git a/exports/common.mk b/exports/common.mk
index f2757c2..bc5a3d6 100644
--- a/exports/common.mk
+++ b/exports/common.mk
@@ -23,7 +23,7 @@ LIB_NAME ?= eduvpn_common
# Library file name
LIB_FILE ?= $(LIB_PREFIX)$(LIB_NAME)$(LIB_SUFFIX)
-# Get exports/ directory when included from a wrapper
+# Get relative exports/ directory when included from a wrapper
EXPORTS_PATH = $(dir $(lastword $(MAKEFILE_LIST)))
# Remove trailing slash
EXPORTS_PATH := $(EXPORTS_PATH:/=)
@@ -38,7 +38,9 @@ else
export LD_LIBRARY_PATH := $(abspath $(EXPORTS_LIB_SUBFOLDER_PATH)):$(LD_LIBRARY_PATH)
endif
-.try_build_lib:
+.try-build-lib:
ifneq ($(wildcard $(EXPORTS_PATH)/Makefile),)
$(MAKE) -C $(EXPORTS_PATH)
+else
+$(info Skipping building library as exports/Makefile was not found)
endif