-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (37 loc) · 1.05 KB
/
Copy pathMakefile
File metadata and controls
49 lines (37 loc) · 1.05 KB
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
BIN_NAME="chargemywifi"
BUILD_FOLDER="build"
create-build-folder:
mkdir -p build
all: exe bin app
exe: clean-exe create-build-folder
env \
GOOS=windows \
GOARCH=amd64 \
go build \
-ldflags "-X github.com/swathinsankaran/chargemywifi/pkg/model.OperatingSystem=0" -o $(BUILD_FOLDER)/$(BIN_NAME).exe -v .
bin: clean-bin create-build-folder
env \
GOOS=linux \
GOARCH=amd64 \
go build \
-ldflags "-X github.com/swathinsankaran/chargemywifi/pkg/model.OperatingSystem=1" -o $(BUILD_FOLDER)/$(BIN_NAME).bin -v .
app: clean-app create-build-folder
env \
GOOS=darwin \
GOARCH=amd64 \
go build \
-ldflags "-X github.com/swathinsankaran/chargemywifi/pkg/model.OperatingSystem=2" -o $(BUILD_FOLDER)/$(BIN_NAME).app -v .
clean:
rm -rf $(BUILD_FOLDER)
rm -f coverage.out
clean-exe:
rm -f $(BUILD_FOLDER)/$(BIN_NAME).exe
clean-bin:
rm -f $(BUILD_FOLDER)/$(BIN_NAME).bin
clean-app:
rm -f $(BUILD_FOLDER)/$(BIN_NAME).app
test:
go test -coverprofile=coverage.out -v ./...
go tool cover -func=coverage.out
coverage-html:
go tool cover -html=coverage.out