-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 709 Bytes
/
Makefile
File metadata and controls
38 lines (29 loc) · 709 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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=db_schema_enricher
BINARY_UNIX=$(BINARY_NAME)_unix
all: test build
build: deps
GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) $(GOBUILD) -o $(BINARY_NAME) -v .
chmod +x $(BINARY_NAME)
test: deps
$(GOTEST) -v ./...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_UNIX)
run: build
./$(BINARY_NAME) $(ARGS)
deps:
$(GOGET) -v ./...
# Cross compilation
build-linux: deps
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) -v .
chmod +x $(BINARY_UNIX)
install: build
go install ./cmd
.PHONY: all build test clean run deps build-linux install