diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-03-22 11:52:28 +0100 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-03-22 13:30:41 +0100 |
| commit | 9bab3c87825b4284b3e6f2be3fa9e89da7723116 (patch) | |
| tree | 6049f03402f23168c5000e9843a979935cd0996d /exports | |
| parent | f94e6471268c12b7b5c7fd1c8b8800dac3848d6c (diff) | |
All: Refactor makefile & building
Diffstat (limited to 'exports')
| -rw-r--r-- | exports/common.mk | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/exports/common.mk b/exports/common.mk deleted file mode 100644 index 646c9c1..0000000 --- a/exports/common.mk +++ /dev/null @@ -1,49 +0,0 @@ -# Prevent executing `go env ...` multiple times for the same property -# export is needed for this and also to pass the values on to the Go compiler -ifndef GOOS -export GOOS := $(shell go env GOHOSTOS) -endif -ifndef GOARCH -export GOARCH := $(shell 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 - -# Get relative exports/ directory when included from a wrapper, without trailing slash -override EXPORTS_PATH = $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) - -# Current version -VERSION := $(shell grep -o 'const Version = "[^"]*' "${EXPORTS_PATH}"/../internal/version/version.go | cut -d '"' -f 2) - -# Library name without prefixes/suffixes -LIB_NAME ?= eduvpn_common -LIB_NAME_VERSION ?= $(LIB_NAME)-$(VERSION) -# Library file name -LIB_FILE ?= $(LIB_PREFIX)$(LIB_NAME_VERSION)$(LIB_SUFFIX) - -EXPORTS_LIB_PATH ?= $(EXPORTS_PATH)/lib -EXPORTS_LIB_SUBFOLDER_PATH ?= $(EXPORTS_LIB_PATH)/$(GOOS)/$(GOARCH) - -# Add library to dynamic linker path for running tests -ifeq (Windows_NT,$(OS)) -export PATH := $(abspath $(EXPORTS_LIB_SUBFOLDER_PATH)):$(PATH) -else -export LD_LIBRARY_PATH := $(abspath $(EXPORTS_LIB_SUBFOLDER_PATH)):$(LD_LIBRARY_PATH) -export DYLD_FALLBACK_LIBRARY_PATH := $(abspath $(EXPORTS_LIB_SUBFOLDER_PATH)):$(DYLD_FALLBACK_LIBRARY_PATH) -endif - -.try-build-lib: -ifneq ($(wildcard $(EXPORTS_PATH)/Makefile),) - $(MAKE) -C $(EXPORTS_PATH) -else -$(info Skipping building library as exports/Makefile was not found) -endif |
