-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (21 loc) · 917 Bytes
/
Makefile
File metadata and controls
26 lines (21 loc) · 917 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
MKFILE_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
.DEFAULT_GOAL := help
SHELL := /bin/bash
MAKEFLAGS += --no-print-directory
PLATFROM := $(go env GOOS)
.PHONY: build
build: ## run go build and go install
@go build -v -o build/lf-cli && go install
.PHONY: build/all
build/all: ## Run `go build` to create binaries for different OS
@export GOOS=linux; export GOARCH=amd64; go build -v -o build/linux/lf-cli_linux_amd64
@export GOOS=darwin; export GOARCH=amd64; go build -v -o build/macos/lf-cli_macos_amd64
.PHONY: test
test: ## run tests
@go test ./internal
.PHONY: test/verbose
test/verbose: ## run tests with verbose output
@go test -v ./internal
.PHONY: help
help: ## Makefile Help Page
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[\/\%a-zA-Z_-]+:.*?##/ { printf " \033[36m%-21s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)