-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
42 lines (33 loc) · 888 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
36
37
38
39
40
41
42
# the program fails to load the WakeByAddressSingle, WakeByAddressAll and WaitOnAddress symbols from kernel32.dll.
# View Details: https://github.com/golang/go/issues/61058
BINARY_NAME=main
PLATFORM=Windows
ifeq ($(OS), Windows_NT)
PLATFORM=window
BINARY_NAME=main.exe
else
ifeq ($(shell uname), Darwin)
PLATFORM=mac
else
PLATFORM=linux
endif
endif
all: ${PLATFORM} run
window:
set CGO_ENABLED=0
set GOOS=windows
set GOARCH=amd64
go build -race -o ${BINARY_NAME} -ldflags "-s -w" cmd/main.go
mac:
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -race -o ${BINARY_NAME} -ldflags '-s -w' cmd/main.go
linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -race -o ${BINARY_NAME} -ldflags '-s -w' cmd/main.go
run:
./${BINARY_NAME} server:http -m release
debug:
go run ./cmd/main.go
gorm:
go run ./cmd/main.go gorm:gen -c model
clean:
go clean
rm ${BINARY_NAME}