-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 750 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (28 loc) · 750 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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GORUN=$(GOCMD) run
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BUILD_DIR=build/
APPNAME=GOCA
BINARY_NAME=goca
BINARY_UNIX=$(BINARY_NAME)_unix
SRC=$(wildcard goca/*.go)
all: test build
build: $(SRC)
$(GOBUILD) $(LDFLAGS) -o $(BUILD_DIR)$(BINARY_NAME) -v $^
test:
GOCA_TEST_SERVER="https://test.goca.io" $(GOTEST) -v -race -cover -count 1 ./...
test-local:
GOCA_TEST_SERVER="http://localhost:5000" $(GOTEST) -v -race -cover -count 1 ./...
clean:
$(GOCLEAN)
rm -rf $(BUILD_DIR)
deps:
$(GOGET) -t -v ./...
# Cross compilation
build-linux: $(SRC)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) -v $^
.PHONY: all build test clean run deps build-linux