5 ms·
The tool you want is remake: http://bashdb.sourceforge.net/remake/ http://bashdb.sourceforge.net/remake/ This is GNU Make + a few patches. So it's 100% compati
by dima55 6y ago
The tool you want is remake: http://bashdb.sourceforge.net/remake/ http://bashdb.sourceforge.net/remake/
This is GNU Make + a few patches. So it's 100% compatible. And you get an interactive debugger, and lots more stuff. For instance, to list out the commands:
remake --targets
No idea why this hasn't been merged upstream.
Your larger point really stands, though: if you're just running commands, you shouldn't be using Make. But it is abused in that way often, so...
- matthewbauer 6y agoHow does it deal with wildcard rules? I would bet it gets complicated when you start having chained wildcard rules that have also side effects.
- dima55 6y agoThere's --targets and --tasks to handle such things, but it really depends on the Makefile in question. If you really want to know how it behaves, apt install remake.
- jackewiehose 6y ago> remake --targets; No idea why this hasn't been merged upstream I would think because it's useless. The targets in a Makefile are very often just internal and aren't always meant to be run by the user.
- dima55 6y agoIt has an interactive debugger, which is not useless. Clearly.
- jackewiehose 6y agoI was just referring to the --targets option which I thought was meant as an answer to the missing standard help.
- rixed 6y agoMany shell autocompleters would read the makefile to complete target names though, suggesting it is not useless. Anyway, one could always have a 'help' target that prints a short documentation. This also avoid listing internal targets.
- jackewiehose 6y agoYes, I remember using zsh and in my experience this was barely useful since most Makefiles are auto-generated with hundreds or thousands of targets. > one could always have a 'help' target that prints a short documentation Sure, that's fine. But the point is that if you have an unknown Makefile you can't (or shouldn't) just execute it without knowing what it will do. Makefiles should be treated as individual programs just like any other executable and there's no guaranteed standard way to get help from it.