-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (37 loc) · 1.03 KB
/
Makefile
File metadata and controls
42 lines (37 loc) · 1.03 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
# Project parameters
PACKAGE=github.com/ragecryx/bob
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=bob_builder
all: test build
build:
$(GOBUILD) -o $(BINARY_NAME) -v
test:
$(GOTEST) -v ./...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_UNIX)
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)
deps:
$(GOGET) github.com/stretchr/testify/assert
$(GOGET) github.com/sirupsen/logrus
$(GOGET) gopkg.in/yaml.v2
$(GOGET) gopkg.in/src-d/go-git.v4
$(GOGET) github.com/gorilla/mux
$(GOGET) github.com/yosssi/ace
# Cross compilation
build-windows:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)_win_amd64
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)_linux_amd64
build-osx:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)_osx_amd64
docker-build:
docker run --rm -it -v "$(GOPATH)":/go -w /go/src/$(PACKAGE) golang:latest go build -o "$(BINARY_UNIX)" -v