-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (41 loc) · 994 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
GO111MODULE := on
CGO_ENABLED := 1
export
TARGETS := darwin/amd64,linux/amd64
GO_VERSION := 1.11.5
BASH_VERSION := 5.0
SHELL := /usr/bin/env bash
.PHONY: all
all: goenable plugins
.PHONY: dist
dist: out
cd /tmp; GO111MODULE=auto go get -u github.com/johnstarich/xgo # avoid updating go.mod files
xgo \
--buildmode=c-shared \
--deps="http://ftpmirror.gnu.org/bash/bash-${BASH_VERSION}.tar.gz" \
--depsargs="--disable-nls" \
--dest=out \
--go="${GO_VERSION}" \
--image="johnstarich/xgo:1.11-nano" \
--targets="${TARGETS}" \
.
set -e; \
if [[ -d out/github.com ]]; then \
mv -fv out/github.com/johnstarich/* out/; \
rm -rf out/github.com; \
fi
go run ./cmd/rename_binaries.go ./out
.PHONY: plugins
plugins: out
set -ex; \
for d in $$(ls examples); do \
go build -v -o out/"$$d" -buildmode=plugin ./examples/"$$d"; \
done
out:
mkdir out
.PHONY: clean
clean:
rm -rf out
.PHONY: goenable
goenable: out
go build -v -o out/goenable.so -buildmode=c-shared .