-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (38 loc) · 969 Bytes
/
Makefile
File metadata and controls
48 lines (38 loc) · 969 Bytes
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 parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
BINARY_NAME=goscaffold
all: test build
.PHONY: build
build:
$(GOBUILD) -o bin/$(BINARY_NAME) -v ./main.go
.PHONY: test
test:
$(GOTEST) -v $(shell find . -type f -name '*_test.go' -not -path "./example/*")
.PHONY: clean
clean:
$(GOCLEAN)
rm -f ./bin/$(BINARY_NAME)
.PHONY: run
run:
$(GOBUILD) -o bin/$(BINARY_NAME) -v ./main.go
./bin/$(BINARY_NAME)
.PHONY: deps
deps:
$(GOMOD) download
.PHONY: release
release: clean
GOOS=linux GOARCH=amd64 $(GOBUILD) -o bin/$(BINARY_NAME)-linux-amd64 -v
GOOS=windows GOARCH=amd64 $(GOBUILD) -o bin/$(BINARY_NAME)-windows-amd64.exe -v
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o bin/$(BINARY_NAME)-darwin-amd64 -v
# Testing one example
.PHONY: example1
example1:
bin/${BINARY_NAME} run ./example -c example/example.config.yaml
.PHONY: clean_example1
clean_example1:
rm -rf ./example/output