bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #64571] Add option to print targets


From: David A. Wheeler
Subject: [bug #64571] Add option to print targets
Date: Mon, 8 Jan 2024 14:23:25 -0500 (EST)

Follow-up Comment #16, bug#64571 (group make):

I think it's important to identify "what is the use case" before adding
options. I think there are two different use cases that are getting conflated.
I suggest supporting two different options for the two cases.

1. "Give me the list of targets of this makefile, e.g., for better
autocompletion". I think using JSON or even CSV for this use case would be a
terrible idea. I strongly recommend a special option that simply gives a list
of targets, one per line, enabling easy processing. Trivial tools can handle
this format, and including any other data about the targets would just slow
down interactive processing without being useful.

2. "Provide full post-processed make database to support complex analysis".
Here I think JSON or CSV is plausible, with JSON being more flexible (and thus
probably the better choice). You can implement a simple "dump JSON" or use a
more complex format language. The trade-off is simple: a format language lets
you only output the data that matters, but now you have to devise and
implement the format language. In this case, I think the format language is
NOT worth it - just do a JSON data dump. If you need to process the make
database in detail, you're going to need to do some fancier processing anyway;
the format language will never be enough. It's *much* easier and more
future-proof if you don't implement the format language. Modern systems can
process huge makefiles without fuss. JSON processing is widely available, so
while POSIX by itself doesn't have tools for it, I don't think that's a
problem. Tools like jq are widely available, and you can build your own if you
want to. You *could* add the format language later if I'm wrong, and you can't
eliminate the format language later if I'm right.

So: Just add two options:

1. Dump all targets, one per line.
2. Dump entire processed database in JSON format.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64571>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]