-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (30 loc) · 951 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
36
37
38
39
# Go parameters
GOCMD?=go
GO_VERSION=$(shell go list -m -f "{{.GoVersion}}")
LIBPAKTOOLS_VERSION=$(shell ./scripts/version.sh)
PACKAGE_BASE=github.com/paketo-buildpacks/libpak-tools
OUTDIR=$(HOME)/go/bin
LDFLAGS="-s -w"
all: test libpak-tools
out:
mkdir -p $(OUTDIR)
libpak-tools: out
@echo "> Building libpak-tools..."
go build -ldflags=$(LDFLAGS) -o $(OUTDIR)/libpak-tools main.go
install-goimports:
@echo "> Installing goimports..."
cd tools && $(GOCMD) install golang.org/x/tools/cmd/goimports
format: install-goimports
@echo "> Formating code..."
@goimports -l -w -local ${PACKAGE_BASE} .
install-golangci-lint:
@echo "> Installing golangci-lint..."
cd tools && $(GOCMD) install github.com/golangci/golangci-lint/cmd/golangci-lint
lint: install-golangci-lint
@echo "> Linting code..."
@golangci-lint run -c golangci.yaml
test: format lint
$(GOCMD) test -parallel=1 -count=1 -v ./...
clean:
rm -rf ./bin/
rm -rf ./binaries/