Skip to content

Option to generate depfiles #343

@vinipsmaker

Description

@vinipsmaker

Hi,

GCC has an option to generate depfiles using a Makefile-like syntax. For instance:

// foo.c
#include "bar.h"

If you call gcc -MMD foo.c, it'll generate the following file:

foo.o: foo.c bar.h

ninja supports reading those depfiles and converting them to ninja's internal dependency format, and meson lets you specify a "depfile" argument to e.g. custom_target() or generator().

eli-schwartz

I'm using meson to describe the build of my project and I have a few files to be processed through re2c. Some of the files use the /*!include:re2c "my-re-defs.re" */ re2c's syntax and it'd be nice to have them automatically rebuilt when the included file changes. The build system can take care of this if re2c accepts an option to generate a second output (the depfile). Can we have an option to build a depfile alongside the main output?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions