-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (27 loc) · 1.05 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
# NAME is set to the name of the current directory ($PWD)
NAME := $(notdir $(shell pwd))
DISTDIR := ./dist
default: build
build:
go build
buildall: buildwin buildlinux builddarwin
buildwin:
env GOOS=windows GOARCH=amd64 go build -o ${DISTDIR}/${NAME}_windows_amd64.exe
zip -j -9 ${DISTDIR}/${NAME}_windows_amd64.zip ${DISTDIR}/${NAME}_windows_amd64.exe
env GOOS=windows GOARCH=386 go build -o ${DISTDIR}/${NAME}_windows_386.exe
zip -j -9 ${DISTDIR}/${NAME}_windows_386.zip ${DISTDIR}/${NAME}_windows_386.exe
buildlinux:
env GOOS=linux GOARCH=386 go build -o ${DISTDIR}/${NAME}_linux_386
zip -j -9 ${DISTDIR}/${NAME}_linux_386.zip ${DISTDIR}/${NAME}_linux_386
env GOOS=linux GOARCH=amd64 go build -o ${DISTDIR}/${NAME}_linux_amd64
zip -j -9 ${DISTDIR}/${NAME}_linux_amd64.zip ${DISTDIR}/${NAME}_linux_amd64
builddarwin:
env GOOS=darwin GOARCH=amd64 go build -o ${DISTDIR}/${NAME}_darwin_amd64
zip -j -9 ${DISTDIR}/${NAME}_darwin_amd64.zip ${DISTDIR}/${NAME}_darwin_amd64
brun: build
./${NAME}
clean:
rm -f ./${NAME}
rm ${DISTDIR}/*
test:
@echo ${NAME}