Generate project and meta Makefiles with a Python API
Project description
mkmake
mkmake is a Python package for generating Makefiles for multiple related C projects from code.
Installation
pip install mkmake
Features
- Generate project and meta Makefiles from Python project definitions.
- Model mixed project types with a shared API (
CProject,YYProject,TestProject). - Discover and wire header dependencies for C projects.
- Inject dependency include paths and library linkage across project boundaries.
- Let
TestProjectopt into dependency private headers for unit-test-only coupling. - Configure build variants through
debugandtestgeneration flags.
Quick Start
from mkmake import make_projects
from mkmake.projects import CProject, TestProject, YYProject
Define projects in a dictionary, then call make_projects(...) with build flags:
projects = {
"core": CProject("core", output_name="libcore.a"),
"parser": YYProject("parser", output_name="libparser.a", depends=["core"]),
"tests": TestProject("tests", test_command="python3 {0} {1}", depends=["core", "parser"]),
}
make_projects(projects, debug=True, test=True)
If test code needs a dependency's private headers from src/include, opt in explicitly:
"tests": TestProject(
"tests",
test_command="python3 {0} {1}",
depends=["core", "parser"],
private_depends=["core"],
)
Notes:
private_dependsis test-only and should be used sparingly.- Every
private_dependsentry must also be present independs. - On header basename collisions, local project headers remain authoritative.
Full usage example: examples/generic_make.py
Limitations
- package-only API surface
- no CLI in package code
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkmake-0.2.0.tar.gz.
File metadata
- Download URL: mkmake-0.2.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62d5d63a41a9aa549cd9a2a78a62a3301ad78cc956101594283945a68b338f26
|
|
| MD5 |
9850f4541c5a28ff088bff44c7f2fcaa
|
|
| BLAKE2b-256 |
98019731ae7523669754676725b682c50ec07f5973b0246d8aa41d98bf548e73
|
File details
Details for the file mkmake-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mkmake-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22f47edddae4233e9dd2b34f54a4f5ecb74c555007d88f5323a14fb2411e9446
|
|
| MD5 |
bc241f60e20463c7e24ea202598cdab9
|
|
| BLAKE2b-256 |
5640746aa55769b9c19a515bfc7381da7b65c592acca03168efe7d952dba1d84
|