summaryrefslogtreecommitdiff
path: root/exports/Makefile
blob: fdedba25903fa6c0d3f47bd58a9d86c52bd37adf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.PHONY: build clean

lib_suffix_linux   = .so
lib_suffix_windows = .dll
lib_suffix_darwin  = .dylib

GOOS      ?= $(shell go env GOHOSTOS)
GOARCH    ?= $(shell go env GOHOSTARCH)
LIB_SUFFIX = $(lib_suffix_$(GOOS))

# Creates targets like 'linux/amd64/eduvpn_verify.so'
build: $(GOOS)/$(GOARCH)/eduvpn_verify$(LIB_SUFFIX)

$(GOOS)/$(GOARCH)/eduvpn_verify$(LIB_SUFFIX): exports.go ../verify.go
	CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $@ -buildmode=c-shared $<

clean:
	rm -rf ../exports/*/