forked from 281677160/MyUrls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (42 loc) · 1.54 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
BINARY_DEFAULT="build/myurls"
BINARY_LINUX="build/myurls-linux-amd64"
BINARY_DARWIN="build/myurls-darwin-amd64"
BINARY_WINDOWS="build/myurls-windows-x64"
BINARY_ARRCH64="build/myurls-arrch64"
GOFILES="main.go"
VERSION=1.0.0
BUILD=`date +%FT%T%z`
default:
@echo ${BINARY_DEFAULT}
@go build -o ${BINARY_DEFAULT} ${GOFILES}
all:
@echo ${BINARY_LINUX}
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_LINUX} ${GOFILES}
@echo ${BINARY_DARWIN}
@CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ${BINARY_DARWIN} ${GOFILES}
@echo ${BINARY_WINDOWS}
@CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ${BINARY_WINDOWS} ${GOFILES}
@echo ${BINARY_ARRCH64}
@CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ${BINARY_ARRCH64} ${GOFILES}
linux:
@echo ${BINARY_LINUX}
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_LINUX} ${GOFILES}
darwin:
@echo ${BINARY_DARWIN}
@CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ${BINARY_DARWIN} ${GOFILES}
windows:
@echo ${BINARY_WINDOWS}
@CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ${BINARY_WINDOWS} ${GOFILES}
aarch64:
@echo ${BINARY_ARRCH64}
@CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ${BINARY_ARRCH64} ${GOFILES}
install:
@go mod tidy
fmt:
@go fmt ./...
clean:
@if [ -f ${BINARY_DEFAULT} ] ; then rm ${BINARY_DEFAULT} ; fi
@if [ -f ${BINARY_LINUX} ] ; then rm ${BINARY_LINUX} ; fi
@if [ -f ${BINARY_DARWIN} ] ; then rm ${BINARY_DARWIN} ; fi
@if [ -f ${BINARY_WINDOWS} ] ; then rm ${BINARY_WINDOWS} ; fi
@if [ -f ${BINARY_ARRCH64} ] ; then rm ${BINARY_ARRCH64} ; fi