{"id":17984400,"url":"https://github.com/adoyle-h/makefile-utils","last_synced_at":"2025-03-25T20:32:08.324Z","repository":{"id":149887561,"uuid":"604165570","full_name":"adoyle-h/makefile-utils","owner":"adoyle-h","description":"A series of makefile targets for enhancing your Makefile.","archived":false,"fork":false,"pushed_at":"2024-05-11T12:50:53.000Z","size":72,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T17:51:24.160Z","etag":null,"topics":["automation","make","makefile","shell","tools"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adoyle-h.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"adoyle_h","liberapay":"adoyle","custom":["https://media.githubusercontent.com/media/adoyle-h/_imgs/master/sponsor.png"]}},"created_at":"2023-02-20T13:26:02.000Z","updated_at":"2024-05-11T12:50:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"8403b176-15fd-46fb-a657-1b4ab81252ff","html_url":"https://github.com/adoyle-h/makefile-utils","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adoyle-h%2Fmakefile-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adoyle-h%2Fmakefile-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adoyle-h%2Fmakefile-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adoyle-h%2Fmakefile-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adoyle-h","download_url":"https://codeload.github.com/adoyle-h/makefile-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245540345,"owners_count":20632144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","make","makefile","shell","tools"],"created_at":"2024-10-29T18:21:13.501Z","updated_at":"2025-03-25T20:32:07.720Z","avatar_url":"https://github.com/adoyle-h.png","language":"Makefile","readme":"# Makefile Utils\n\nThe makefile-utils is helpful for developing with `make` command.\nIt provides a series of Makefile Targets for enhancing your Makefile.\n\n[English](./README.md) | [中文](./README.zh.md)\n\n## Feature\n\n![make-help.png](https://media.githubusercontent.com/media/adoyle-h/_imgs/master/github/makefile-utils/make-help.png)\n\n## Versioning\n\nRead [tags][] for versions.\nThe versions follow the rules of [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).\n\n## Installation\n\nYou can install it by `curl` or `git`.\n\n### Curl\n\n```sh\nVERSION=v0.4.1\ncurl -LO \"https://github.com/adoyle-h/makefile-utils/releases/download/$VERSION/makefile-utils.tgz{,.md5}\"\n\n# Check files integrity\nmd5sum -c ./*.md5\n\ntar -xzf ./makefile-utils.tgz\n```\n\n### Git\n\n```sh\nVERSION=v0.4.1\ngit clone --depth 1 --branch \"$VERSION\" https://github.com/adoyle-h/makefile-utils.git\n```\n\n## Usage\n\u003c!-- editorconfig-checker-disable --\u003e\n\n```sh\ncd makefile-utils\nmake init OUTPUT=your_project\n```\n\nor\n\n```sh\ncd makefile-utils\nsudo ln -s $PWD/bin/makefile-utils /usr/local/bin/\nmakefile-utils init your_project\n```\n\nIt will do:\n\n1. Create 'makefile-utils' directory in your project.\n2. Add `include ./makefile-utils/*.mk` to your Makefile. You can delete these files that you won't use.\n3. Add `.DEFAULT_GOAL := help` to your Makefile if `.DEFAULT_GOAL` not defined in Makefile.\n  - Then run `make` equals to `make help`.\n  - You can skip it via `make init OUTPUT=your_project DEFAULT_TARGET=` or `makefile-utils init your_project ''`.\n4. Add `/makefile-utils/*` and `!/makefile-utils/*.mk` to your .gitignore if this file existed.\n5. Add `[{Makefile,*.mk}] indent_style = tab` to your .editorconfig if this file existed.\n\nNow `cd` to your project and run `make help` to show usage.\n\n### make help\n\nBy default, it only shows target name. Add `@desc {description}` **at the previous line of target** for printing description.\n\nIt does not print target defined with makefile functions like `$(target):`. But you can add `@target {name} {description}` in Makefile.\n\n### make semver-*\n\n`make semver-major` only print next major version. And also the `make semver-minor` and `make semver-patch`.\n\nYou can call the target in other targets.\nFor example, to replace `VERSION=v...` in README file.\n\n```make\n# @target bump-major  bump major version (x)\n# @target bump-minor  bump minor version (y)\n# @target bump-patch  bump patch version (z)\nBUMP_TARGETS := $(addprefix bump-,major minor patch)\n.PHONY: $(BUMP_TARGETS)\n$(BUMP_TARGETS):\n\t@$(MAKE) $(subst bump-,semver-,$@) \u003e VERSION\n\t@sed -i.bak -E \"s/^VERSION=.+/VERSION=v$$(cat VERSION)/\" README.md\n\t@rm README.md.bak VERSION\n```\n\n### make CHANGELOG\n\nTo generate a CHANGELOG file and update it.\n\nDo not run `make CHANGELOG` directly. Add below codes in your Makefile.\n\n```sh\n.PHONY: changelog\nchangelog:\n\t$(MAKE) CHANGELOG NEXT_VERSION=$(shell cat VERSION)\n```\n\nTo update the CHANGELOG, just `echo \"0.1.0\" \u003e VERSION` and run `make changelog`.\n\nYou can preview [the example of generated CHANGELOG](./CHANGELOG.md).\nRead [the Makefile of makefile-utils](./Makefile) for reference.\n\nYou can change the output of CHANGELOG file.\n\n```sh\n.PHONY: changelog\nchangelog:\n\t$(MAKE) CHANGELOG NEXT_VERSION=0.1.0 OUTPUT=change_log.md\n```\n\n### make md5\n\nTo generate .md5 file for each files in the specified directory.\n\nDefaults to the files in `./dist`. But you can change it by `make md5 DIST=./dist`.\n\n### make md5-check\n\nChecks the md5 of the file in the specified directory.\n\nDefaults to the files in `./dist`. But you can change it by `make md5 DIST=./dist`.\n\n### make md-check-links\n\nCheck dead links in markdown files with [lychee](https://github.com/lycheeverse/lychee).\n\nCopy the [`lychee.toml`](./lychee.toml) to your project.\n\nYou can exclude urls by [`.lycheeignore`](https://github.com/lycheeverse/lychee#ignoring-links). [example](https://github.com/lycheeverse/lychee/blob/7e0b9e2c68118202ad75ffd3de0e113c5d5b7137/fixtures/ignore/.lycheeignore).\n\nTo avoid getting rate-limited while checking GitHub links. You can set `GITHUB_TOKEN=xxx make md-check-links`.\nThe github token can be generated in your [GitHub account settings page](https://github.com/settings/tokens).\nA personal token with no extra permissions is enough to be able to check public repos links.\n\n### More makefile target...\n\nMore handy makefile targets will be added later.\n\nWelcome to talk requirements with me in [Discussion](https://github.com/adoyle-h/makefile-utils/discussions).\n\n## Suggestion, Bug Reporting, Contributing\n\n**Before opening new Issue/Discussion/PR and posting any comments**, please read [Contributing Guidelines](https://gcg.adoyle.me/CONTRIBUTING).\n\n## Copyright and License\n\nCopyright 2023 ADoyle (adoyle.h@gmail.com). Some Rights Reserved.\nThe project is licensed under the **Apache License Version 2.0**.\n\nSee the [LICENSE][] file for the specific language governing permissions and limitations under the License.\n\nSee the [NOTICE][] file distributed with this work for additional information regarding copyright ownership.\n\n## Other Projects\n\n- [Other shell projects](https://github.com/adoyle-h?tab=repositories\u0026q=\u0026type=source\u0026language=shell\u0026sort=stargazers) created by me.\n\n\n\u003c!-- links --\u003e\n\n[tags]: https://github.com/adoyle-h/makefile-utils/tags\n[LICENSE]: ./LICENSE\n[NOTICE]: ./NOTICE\n","funding_links":["https://patreon.com/adoyle_h","https://liberapay.com/adoyle","https://media.githubusercontent.com/media/adoyle-h/_imgs/master/sponsor.png"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadoyle-h%2Fmakefile-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadoyle-h%2Fmakefile-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadoyle-h%2Fmakefile-utils/lists"}