Skip to main content

Generate project and meta Makefiles with a Python API

Project description

mkmake

PyPI version

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 TestProject opt into dependency private headers for unit-test-only coupling.
  • Configure build variants through debug and test generation 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_depends is test-only and should be used sparingly.
  • Every private_depends entry must also be present in depends.
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkmake-0.2.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkmake-0.2.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

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

Hashes for mkmake-0.2.0.tar.gz
Algorithm Hash digest
SHA256 62d5d63a41a9aa549cd9a2a78a62a3301ad78cc956101594283945a68b338f26
MD5 9850f4541c5a28ff088bff44c7f2fcaa
BLAKE2b-256 98019731ae7523669754676725b682c50ec07f5973b0246d8aa41d98bf548e73

See more details on using hashes here.

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

Hashes for mkmake-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22f47edddae4233e9dd2b34f54a4f5ecb74c555007d88f5323a14fb2411e9446
MD5 bc241f60e20463c7e24ea202598cdab9
BLAKE2b-256 5640746aa55769b9c19a515bfc7381da7b65c592acca03168efe7d952dba1d84

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page