Rules.mk
Pre-defined rules to include in your Makefile (Golang, Docker, ...)
Install / Use
/learn @moul/Rules.mkREADME
rules.mk
:warning: This project is no longer maintained :warning:
Project Status
After years of using and maintaining this project, I've come to realize that this approach adds more complexity than value. While the idea of having a shared Makefile library seemed appealing initially, in practice it:
- Makes debugging harder when things go wrong
- Adds an extra layer of abstraction that obscures what's actually happening
- Creates a dependency that needs to be maintained and updated
- Can break existing projects when updated
I now recommend using smaller, focused tools that can be called from Makefiles instead of relying on Makefile libraries. This approach is more modular, easier to understand, and provides better error messages.
The project will remain available for those who find it useful, but I won't be adding new features or fixing bugs.
Usage
Install
- Copy
rules.mkto your repo (wget https://raw.githubusercontent.com/moul/rules.mk/master/rules.mk) - Configure your project variables and import
rules.mkfrom your MakefileGOPKG = moul.io/golang-repo-template # optional GOBINS = . ./cmd/secondary-app # optional DOCKER_IMAGE = moul/golang-repo-template # optional NPM_PACKAGES = . # optional include rules.mk # required - Profit
Minimal config
include rules.mk
Update
- Run
make bumpdeps - Profit
Examples
See the ./test directory
make help at the root of this repo
General commands:
bumpdeps
generate
test
make help in test/docker
General commands:
build
test
make help in test/go-binary
General commands:
build
bumpdeps
fmt
generate
install
lint
release
test
tidy
unittest
verify
make help in test/go-binary-and-docker
General commands:
build
bumpdeps
fmt
generate
install
lint
release
test
tidy
unittest
verify
make help in test/go-library
General commands:
build
bumpdeps
fmt
generate
lint
test
tidy
unittest
verify
License
© 2019-2020 Manfred Touron - Apache-2.0 License
Related Skills
node-connect
354.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
354.0kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
prose
354.0kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
