-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
44 lines (35 loc) · 1.25 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
BINARY_DEFAULT="build/bitly.service"
BINARY_LINUX="build/linux-amd64-bitly.service"
BINARY_DARWIN="build/darwin-amd64-bitly.service"
BINARY_WINDOWS="build/windows-amd64-bitly.service"
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}
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}
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