6 ms·
Yeah, mine often just defers back to some shell scripts. But it's useful to enumerate them in the Makefile.
by drowsspa 2y ago
Yeah, mine often just defers back to some shell scripts. But it's useful to enumerate them in the Makefile.
- tom_ 2y agoIf you have a telltale prefix for any internal phony targets (I use "_"), then you can have the Makefile list all the interesting targets itself. Cat the Makefile, print every line matching "^\.PHONY:[[:space:]]*[^_]", then strip out the prefix. Leave any suffix, as you can put a trailing comment in, e.g., .PHONY:build_windows # build for Windows. Supply DEBUG=1 for a debug build I find this super useful. Even if you remember exactly what the target was called, it still gives you a nice list of words you can double click on to pull into the command line.