google / emboss

Emboss is a tool for generating code that reads and writes binary data structures.
Apache License 2.0
68 stars 21 forks source link

Support generating an import depfile (.d) like GCC & Clang -MD option #68

Open BenjaminLawson opened 1 year ago

BenjaminLawson commented 1 year ago

When using the GN build system, we need to specify all imported emboss files (including recursively imported files) as inputs to the action target that runs embossc. It would be simpler and more maintainable to use a depfile that was generated by emboss. The format of the depfile is a Makefile like the ones generated by GCC and Clang when the -MD option is used.

I haven't tried, but I think this format might work:

a.emb: b.emb c.emb
BenjaminLawson commented 1 year ago

What I'm not sure of is what gn expects the rule name to be. It might need to be "my_script.py" or "target_name" instead of "a.emb".

BenjaminLawson commented 1 year ago

It looks like the rule name needs to be the name of the output file (e.g. a.emb.h: b.emb).