-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (24 loc) · 822 Bytes
/
Makefile
File metadata and controls
35 lines (24 loc) · 822 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
PATH := ./bin:$(PATH)
export NAME=linuxaid-cli
export VERSION=$(shell ./scripts/latest-tag.sh)
export MAINTAINER=Ashish Jaiswal <ashish@obmondo.com>
SOURCES := linuxaid
.PHONY: all dep build clean test format vet lint
all: build
lint: ## Lint the files
@golangci-lint run --issues-exit-code=1
format: ## Format the files
@go fmt ./...
vet: ## Vet the files
@go vet ./...
test: ## Run unittests
@go test -v ./...
dep: ## Get the dependencies
@go get -v ./...
clean: ## Remove previous build
@go clean
build: $(SOURCES)
$(SOURCES): dep
CGO_ENABLED=0 go build -v -ldflags="-X main.Version=$(VERSION) -s -w" -o $(SOURCES)-install ./cmd/$(SOURCES)-install
CGO_ENABLED=0 go build -v -ldflags="-X main.Version=$(VERSION) -s -w" -o $(SOURCES)-cli ./cmd/$(SOURCES)-cli
chmod +x $(SOURCES)-install $(SOURCES)-cli