-
Notifications
You must be signed in to change notification settings - Fork 9
/
makefile
48 lines (42 loc) · 897 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
43
44
45
46
47
48
# Go
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=gotv_plus
DIST_DIR=build
SERVER_DIR=server
OS_Linux=linux
OS_Windows=windows
OS_Mac=darwin
ARCH_386=386
ARCH_AMD64=amd64
# Replacing "RM" command for Windows PowerShell.
RM = rm -rf
ifeq ($(OS),Windows_NT)
RM = Remove-Item -Recurse -Force
endif
# Replacing "MKDIR" command for Windows PowerShell.
MKDIR = mkdir -p
ifeq ($(OS),Windows_NT)
MKDIR = New-Item -ItemType Directory
endif
# Replacing "CP" command for Windows PowerShell.
CP = cp -R
ifeq ($(OS),Windows_NT)
CP = powershell -Command Copy-Item -Recurse -Force
endif
# Replacing "GOPATH" command for Windows PowerShell.
GOPATHDIR = $GOPATH
ifeq ($(OS),Windows_NT)
GOPATHDIR = $$env:GOPATH
endif
.DEFAULT_GOAL := build-all
test:
$(GOTEST) -v ./...
clean:
@$(GOCLEAN)
-@$(RM) $(DIST_DIR)/*
deps-go:
@$(GOGET)