-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
42 lines (35 loc) · 1.35 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
.PHONY: ckeck install upload
BUILD_VERSION ?= $(shell cat VERSION)
BUILD_OUTPUT ?= gobrot
GO ?= GO111MODULE=on CGO_ENABLED=0 go
GOOS ?= $(shell $(GO) version | cut -d' ' -f4 | cut -d'/' -f1)
GOARCH ?= $(shell $(GO) version | cut -d' ' -f4 | cut -d'/' -f2)
run:
@$(GO) run main.go
build:
@$(GO) build -o $(BUILD_OUTPUT) main.go
clean:
@echo -n ">> CLEAN"
@$(GO) clean -i ./...
@rm -f esimov-*-*
@rm -rf dist/*
@printf '%s\n' '$(OK)'
crosscompile:
@echo -n ">> CROSSCOMPILE linux/amd64"
@GOOS=linux GOARCH=amd64 $(GO) build -o $(BUILD_OUTPUT)-$(BUILD_VERSION)-linux-amd64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE darwin/amd64"
@GOOS=darwin GOARCH=amd64 $(GO) build -o $(BUILD_OUTPUT)-$(BUILD_VERSION)-darwin-amd64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE windows/amd64"
@GOOS=windows GOARCH=amd64 $(GO) build -o $(BUILD_OUTPUT)-$(BUILD_VERSION)-windows-amd64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE linux/arm64"
@GOOS=linux GOARCH=arm64 $(GO) build -o $(BUILD_OUTPUT)-$(BUILD_VERSION)-linux-arm64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE darwin/arm64"
@GOOS=darwin GOARCH=arm64 $(GO) build -o $(BUILD_OUTPUT)-$(BUILD_VERSION)-darwin-arm64
@printf '%s\n' '$(OK)'
@echo -n ">> CROSSCOMPILE windows/arm64"
@GOOS=windows GOARCH=arm64 $(GO) build -o $(BUILD_OUTPUT)-$(BUILD_VERSION)-windows-arm64
@printf '%s\n' '$(OK)'