Core functions for makefiles (module management, help)
Makefile technology has some drawbacks but it is reliable, language agnostic and available by default on most platform.
This project aims to standardize most common functionalities. Simply copy and include core.mk in your project and start building your project !
- 📦 Simple dependency manager (using git submodule)
- ✓ No extra dependency
- ✓ Lightweight implementation
- ✓ Compatible dependency maintainer bot (Renovate)
- ℹ️ Automatic help generator, based on comments
- ⚒️ Everything is customizable using
Makefile.local
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Captive-Studio/makefile-core/main/install.sh)"1. Copy core.mk to your project
my-project/
├─ .modules/
│ ├─ core.mk <- COPY https://raw.githubusercontent.com/Captive-Studio/makefile-core/main/core.mk
├─ Makefile2. Include .modules/core.mk in your Makefile
# At the start of Makefile
include .modules/core.mk3. Test that everything is working
> make help
Display all available targets and flags
To document a target, add a comment starting with ##
## Do something
my_target:Will display
> make help
...
Targets :
...
my_target Do something
...Add a makefile module (as git submodule). If a ./module.mk is found it will be automatically included.
Example :
> make self-add url=https://github.com/ianstormtaylor/makefile-assert
# It will add /.modules/makefile-assert git submoduleUpdate all makefile modules
Example :
> make self-updatePrint every declared variables (often for debugging)
Example :
> make print-variablesPrint a given variable
Example :
> make print-VAR
# This will display the value of $(VAR)Override any behavior by creating Makefile.local
my-project/
├─ .modules/
│ ├─ ...
├─ Makefile
├─ Makefile.local <- Will overrideTODO
These repository were inspirations to build makefile-core :
MIT © Captive Studio