Skip to content

Commit 016dd0d

Browse files
committed
build: add Makefile
1 parent a0b0f17 commit 016dd0d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ All notable changes to this project will be documented in this file.
4242

4343
- *(cxx)* Fix failed to run github action job for xmake project - ([a145866](https://github.com/x-pt/template/commit/a145866ab3750cad3cfbdad841e7d69728ec4377))
4444
- *(cxx)* Update the ci config - ([f63e6df](https://github.com/x-pt/template/commit/f63e6dfab6059f144f203949c8283bd609a99654))
45+
- Enable the typos as default - ([a0b0f17](https://github.com/x-pt/template/commit/a0b0f1746752a079f7d3195c05bbfbf3c35eb73c))
4546
- Add much more info in changelog by cliff - ([23657ba](https://github.com/x-pt/template/commit/23657ba177cadc4c2bcbd018200f054a0b57c2a5))
4647
- Build xmake and cmake example - ([d295be9](https://github.com/x-pt/template/commit/d295be905384ac19a5c723091c2dd2f40a5aea20))
4748
- Fix the template input error - ([5d1a541](https://github.com/x-pt/template/commit/5d1a541752c931107f4ffa74e151cc9edc313b23))

Makefile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.PHONY: help cliff
2+
.DEFAULT_GOAL := help
3+
4+
# Update the changelog
5+
cliff:
6+
@git cliff -o CHANGELOG.md
7+
8+
# Show help
9+
help:
10+
@echo ""
11+
@echo "Usage:"
12+
@echo " make [target]"
13+
@echo ""
14+
@echo "Targets:"
15+
@awk '/^[a-zA-Z\-_0-9]+:/ \
16+
{ \
17+
helpMessage = match(lastLine, /^# (.*)/); \
18+
if (helpMessage) { \
19+
helpCommand = substr($$1, 0, index($$1, ":")-1); \
20+
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
21+
printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \
22+
} \
23+
} { lastLine = $$0 }' $(MAKEFILE_LIST)

0 commit comments

Comments
 (0)