The 21st century way might be some combination of watchexec[1] and just[2] but you can't assume the availability of these tools.
You can almost assume the availability of make but a lot of distros (hello, Ubuntu) omit basic build tools.
Admittedly I used an LLM recently to write me a Makefile because my brain doesn't have the capacity to remember all make's idiosyncrasies every few years that I touch a Makefile. Once the file is done, it's done, and it was easy to pare down from the verbosity that the LLM coughed up.
I also wanted targets for intermediate build files (long story) so that would have required excessive poring over the man page.
The 21st century way might be some combination of watchexec[1] and just[2] but you can't assume the availability of these tools.
You can almost assume the availability of make but a lot of distros (hello, Ubuntu) omit basic build tools.
Admittedly I used an LLM recently to write me a Makefile because my brain doesn't have the capacity to remember all make's idiosyncrasies every few years that I touch a Makefile. Once the file is done, it's done, and it was easy to pare down from the verbosity that the LLM coughed up.
I also wanted targets for intermediate build files (long story) so that would have required excessive poring over the man page.
[1]: https://github.com/kurtbuilds/checkexec [2]: https://github.com/casey/just