4 ms·
I’m sorry: why not just use make? This is a serious, not sarcastic question. When developing I use make to invoke my program; that ensures everything is rebui
by gumby 6y ago
I’m sorry: why not just use make? This is a serious, not sarcastic question.
When developing I use make to invoke my program; that ensures everything is rebuilt.
- anderspitman 6y agoDoes make have watch functionality built in? Sometimes I use make and entr together. entr detects filesystem changes and make efficiently rebuilds. But nowadays a lot of languages have their own build tools besides make, and entr works directly with any of them.
- johncoltrane 6y agoHere is another way to look at it: $ while sleep 2; do make -s build; done What files are interesting is already encoded in your Makefile and make is pretty good at figuring out if a given file changed or not so, instead of duplicating efforts, run make every second or two and let it figure out what needs to be done. It won't eat your memory or pool of file pointers and your CPU will barely feel it.
- anderspitman 6y agoThat's a solid approach if your dependencies are already managed by make, but languages like Rust and Go do their own dependency management, and Rust in particular is pretty slow to compile. I wouldn't want it running every 2 seconds.
- gumby 6y agoWell it knows from the filesystem which files have changed. If you mean “invoke as soon as a file has changed”: I certainly don’t want that behavior as many code changes require multiple files to be edited and there’s no automatic way to understand as the change hasn’t been written yet.
- thiht 6y agoBecause make doesn't do this?