summaryrefslogtreecommitdiff
path: root/Makefile
blob: 30b96458308a51dcb69c6e944d883a2b0d540db3 (plain)
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
58
59
60
# gfold
# https://nickgerace.dev
#
# Note: this Makefile is not required to work with this repository.
# It is an optional helper.

MAKEPATH:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
NAME:=gfold
VERSION:=0.5.2

all: build

run:
	@cd $(MAKEPATH); cargo run -- ..

run-recursive:
	@cd $(MAKEPATH); cargo run -- .. -r

install:
	cargo install --git https://github.com/nickgerace/gfold --tag $(VERSION)

install-local:
	cargo install --path $(MAKEPATH)

build: pre-build
	cd $(MAKEPATH); cargo build

build-release: pre-build
	cd $(MAKEPATH); cargo build --release

pre-build:
	cd $(MAKEPATH); cargo fmt
	cd $(MAKEPATH); cargo clippy
	cd $(MAKEPATH); cargo test

tree:
	cd $(MAKEPATH); cargo tree

tag:
	cd $(MAKEPATH); git tag $(VERSION)
	cd $(MAKEPATH); git push --tags origin main

fixme:
	@cd $(MAKEPATH); grep -r \
		--exclude-dir={target,.git} \
		--exclude=Cargo.lock \
		--exclude=CHANGELOG.md \
		--color=always \
		FIXME $(MAKEPATH)

release:
	@printf "Change version at the following locations...\n"
	@printf "    Makefile: $(shell grep $(VERSION) $(MAKEPATH)/Makefile)\n"
	@printf "    README.md: $(shell grep $(VERSION) $(MAKEPATH)/README.md)\n"
	@printf "    CHANGELOG.md: $(shell grep $(VERSION) $(MAKEPATH)/CHANGELOG.md)\n"
	@printf "    Cargo.toml: $(shell grep $(VERSION) $(MAKEPATH)/Cargo.toml)\n"
	@printf "Uncomment the unreleased string in CHANGELOG.md...\n"
	@printf "    <!--The latest version contains all changes.-->\n"
	@printf "Then, run the following command...\n"
	@printf "    time make build-release\n"