-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
35 lines (28 loc) · 860 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
EXECUTABLE=outliner
WINDOWS=$(EXECUTABLE)_windows.exe
LINUX=$(EXECUTABLE)_linux
DARWIN=$(EXECUTABLE)_darwin
VERSION=$(shell cat VERSION)
XPKG="github.com/jyny/outliner/command"
all : build shell_completion
cp ./build/outliner_$(shell go env GOOS) ./outliner
@echo build version: $(VERSION)
shell_completion :
mkdir -p build
go run completion/gen.go
build : mod embedded fmt
env GOOS=linux GOARCH=amd64 go build -o ./build/$(LINUX) -ldflags="-X $(XPKG).version=$(VERSION)" .
env GOOS=darwin GOARCH=amd64 go build -o ./build/$(DARWIN) -ldflags="-X $(XPKG).version=$(VERSION)" .
env GOOS=windows GOARCH=amd64 go build -o ./build/$(WINDOWS) -ldflags="-X $(XPKG).version=$(VERSION)" .
embedded :
@cd pkg/deployer/ssh; \
go run gen/gen.go; \
cd ../../../
fmt :
gofmt -w ./
mod :
go mod download
.PHONY : clean
clean:
rm -r ./build
rm outliner