← All projects
Project record1 mention
Originally shared on Hacker News

JSON Serialisation of GNU Makefiles

This is an experimental GNU Make feature (the feature/jprint branch of gmake-experimental) that adds a --print-data-base-json option to dump make's internal database of targets and rules as JSON, including every target and all the options on those targets. It is intended to enable tools that rewrite makefiles (simplifying them, finding duplication, and applying transforms) and tools that translate makefiles into other build formats. Directory targets are not yet handled; the plan is to update to the latest gmake version and handle directories.

Last shared For developers working with Makefiles and build systems
01 / The problem

What it addresses

Existing build tools are inflexible outside their tailored examples, and existing makefiles cannot easily be converted to other build systems, hindering migration to a better build system and simplification of duplicated makefile logic.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. JSON Serialisation of GNU Makefiles

    This is an experimental GNU Make feature (the feature/jprint branch of gmake-experimental) that adds a --print-data-base-json option to dump make's internal database of targets and rules as JSON, including every target and all the options on those targets. It is intended to enable tools that rewrite makefiles (simplifying them, finding duplication, and applying transforms) and tools that translate makefiles into other build formats. Directory targets are not yet handled; the plan is to update to the latest gmake version and handle directories.

    Problem: Existing build tools are inflexible outside their tailored examples, and existing makefiles cannot easily be converted to other build systems, hindering migration to a better build system and simplification of duplicated makefile logic.

    Audience: developers working with Makefiles and build systems

    Posted by @t43562 · Original source ↗

    Source text · @t43562 · · Source ↗

    JSON Serialisation of GNU Makefiles: I got quite far then and now, one year later, I'm hoping I will have the time to finish off the difficult bits: it's a way to get GNU Make to print out its internal database of targets and rules as JSON.