-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
57 lines (49 loc) · 3.36 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# =========================================================================== #
# MIT License Copyright (c) 2022 Kris Nóva <[email protected]> #
# #
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ #
# ┃ ███╗ ██╗ ██████╗ ██╗ ██╗ █████╗ ┃ #
# ┃ ████╗ ██║██╔═████╗██║ ██║██╔══██╗ ┃ #
# ┃ ██╔██╗ ██║██║██╔██║██║ ██║███████║ ┃ #
# ┃ ██║╚██╗██║████╔╝██║╚██╗ ██╔╝██╔══██║ ┃ #
# ┃ ██║ ╚████║╚██████╔╝ ╚████╔╝ ██║ ██║ ┃ #
# ┃ ╚═╝ ╚═══╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ┃ #
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ #
# #
# This machine kills fascists. #
# #
# =========================================================================== #
all: compile
#version ?= 0.0.1
executable ?= nova
#org ?= kris-nova
#authorname ?= Kris Nóva
#authoremail ?= [email protected]
#license ?= MIT
#year ?= 2022
#copyright ?= Copyright (c) $(year)
compile: ## Compile for the local architecture ⚙
@cargo build --release
install: ## Install the program to /usr/bin 🎉
@echo "Installing..."
@cargo install --path .
cp -v ./target/release/$(executable) /usr/bin/$(executable)
#test: clean compile install ## 🤓 Run go tests
# @echo "Testing..."
# go test -v ./...
clean: ## Clean your artifacts 🧼
@echo "Cleaning..."
@cargo clean
@rm -rvf target/*
@rm -rvf $(executable)
#.PHONY: release
#release: ## Make the binaries for a GitHub release 📦
# mkdir -p release
# GOOS="linux" GOARCH="amd64" go build -ldflags "-X 'github.com/$(org)/$(target).Version=$(version)'" -o release/$(target)-linux-amd64 cmd/*.go
# GOOS="linux" GOARCH="arm" go build -ldflags "-X 'github.com/$(org)/$(target).Version=$(version)'" -o release/$(target)-linux-arm cmd/*.go
# GOOS="linux" GOARCH="arm64" go build -ldflags "-X 'github.com/$(org)/$(target).Version=$(version)'" -o release/$(target)-linux-arm64 cmd/*.go
# GOOS="linux" GOARCH="386" go build -ldflags "-X 'github.com/$(org)/$(target).Version=$(version)'" -o release/$(target)-linux-386 cmd/*.go
# GOOS="darwin" GOARCH="amd64" go build -ldflags "-X 'github.com/$(org)/$(target).Version=$(version)'" -o release/$(target)-darwin-amd64 cmd/*.go
.PHONY: help
help: ## 🤔 Show help messages for make targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'