-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
35 lines (27 loc) · 792 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
NAME = docker2exe
OUTPUT = dist
VERSION = v0.2.1
SOURCES = $(wildcard *.go)
TARGETS = darwin/amd64 darwin/arm64 linux/amd64 windows/amd64
OS = $(shell go env GOOS)
ARCH = $(shell go env GOARCH)
os = $(word 1, $(subst /, ,$@))
arch = $(word 2, $(subst /, ,$@))
.PHONY: all
all: $(TARGETS)
.PHONY: clean
clean:
$(RM) -rf dist
.PHONY: test
test: all
dist/docker2exe-$(OS)-$(ARCH) --name test --image alpine
dist/test-$(OS)-$(ARCH) echo OK
dist/docker2exe-$(OS)-$(ARCH) --name test-embed --image alpine --embed
dist/test-embed-$(OS)-$(ARCH) echo OK
.PHONY: release
release: clean all
gh release create $(VERSION) dist/docker2exe-* --generate-notes
$(OUTPUT):
mkdir $(OUTPUT)
$(TARGETS): $(SOURCES) $(OUTPUT)
GOOS=$(os) GOARCH=$(arch) go build -o "$(OUTPUT)/$(NAME)-$(os)-$(arch)"