-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
53 lines (37 loc) · 1.26 KB
/
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
48
49
50
51
52
53
APPS := mcdex/cmd/mcdex
VSN := $(shell git describe --long)
GOVSNFLAG := -ldflags "-X main.version=$(VSN)"
DOCKER_ARGS := -v $(shell pwd)/builds:/builds -w /mcdex mcdex
all:
go build $(GOVSNFLAG) $(APPS)
echo $(VSN) > mcdex.latest
deps:
go get -u ./cmd/mcdex
clean:
rm -rf bin builds
publish: release
aws --profile mcdex s3 cp builds/mcdex.darwin.x64 s3://files.mcdex.net/releases/osx/mcdex
aws --profile mcdex s3 cp builds/mcdex.linux.x64 s3://files.mcdex.net/releases/linux/mcdex
aws --profile mcdex s3 cp builds/mcdex.exe s3://files.mcdex.net/releases/win32/mcdex.exe
release: clean
mkdir builds
$(MAKE) darwin.x64 docker.windows docker.linux
windows:
$(shell cat windows.env) go build $(GOVSNFLAG) -x -v $(APPS)
mv mcdex.exe /builds
linux:
$(shell cat linux.x64.env) go build $(GOVSNFLAG) -x -v $(APPS)
mv mcdex /builds/mcdex.linux.x64
darwin.x64:
$(shell cat darwin.x64.env) go build $(GOVSNFLAG) -x -v $(APPS)
mv mcdex builds/mcdex.darwin.x64
shell: docker.init
docker run -ti $(DOCKER_ARGS) /bin/sh
docker.init:
docker build -t mcdex -f Dockerfile .
docker.windows: docker.init
docker run $(DOCKER_ARGS) make windows
docker.linux: docker.init
docker run $(DOCKER_ARGS) make linux
docker.shell: docker.init
docker run -ti $(DOCKER_ARGS) /bin/bash