3 ms·
The Makefile structure is the real king - the simple idea of targets, dependencies and using the plain old shell is very powerful and quite easy to understand (
by liampulles 4y ago
The Makefile structure is the real king - the simple idea of targets, dependencies and using the plain old shell is very powerful and quite easy to understand (until you get into some of the recursive, iterative bits at least). Very useful if you have custom CLIs and multiple languages in your repo too.
- xdennis 4y ago> the simple idea of targets That works very well for compiling C. But make is often abused for things that don't match that pattern at all, like a Python project when there are no intermediate targets and they are all .PHONY.
- Izkata 4y agoPython is actually one of the things I've found it to be great with, you can for example have all your "command" recipes depend on the virtualenv directory, and the virtualenv directory depend on your requirements / lock file. That way you don't have to worry about keeping the virtualenv up-to-date, it'll automatically do so any time the requirements file changes next time you try to do something, and it'll skip that step entirely if nothing changed. The only downside is that the last part requires a small addition, the install doesn't change the virtualenv dir's last-modified, so that recipe has to end with "touch $@".