summaryrefslogtreecommitdiff
path: root/exports/Makefile
blob: 912e930211cdd9b74476d5ec11acf7eecefca34e (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

OS         = $(shell go env GOHOSTOS)
ARCH       = $(shell go env GOHOSTARCH)
LIB_SUFFIX = $(lib_suffix_$(OS))

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

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

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