8 ms·
Nice to see some love for make. Sure, make syntax sucks. It's arcane and hard to google much of what is going on. (Shower thought... a tool that lets you vie
by 01100011 3y ago
Nice to see some love for make.
Sure, make syntax sucks. It's arcane and hard to google much of what is going on. (Shower thought... a tool that lets you view a Makefile, giving explanatory tooltips for syntax elements would be great).
But make is widespread, ancient and eternal. It isn't going anywhere, despite decades of new tools trying to take its place. It does many jobs relatively well.
I'd go so far as to say that the platonic ideal of development is:
make # Build the project
make install # Install the project
make clean # Clean the project build dir(s)
and whatever new tool you use to actually build things should live behind make. You should have a really good reason to deviate from this. It's approachable and familiar to most devs(well, ok, older C/C++ devs). Sure, write your own custom tool that builds everything in a chroot jail or docker container, has sub tools for installing, running tests, etc... but please, put it behind a make frontend.
- ParetoOptimal 3y ago> the platonic ideal of development is: > make # Build the project > make install # Install the project > make clean # Clean the project build dir(s) IMO, that last step of cleaning is very not platonic ideal. However... maybe a reality of incremental development? The first step for me in a lot of cases is just trying a project to see if it's worth my time, typically that would just have been: cd /tmp git clone http://foo/some/project.git http://foo/some/project.git cd project # build steps, perhaps in a good case your make example above, a dockerfile, or nix flake These days though I'm ecstatic when I see a Nix flake because I can reduce that to: nix run github:some/project Then for development I could even avoid cloning things myself (and sometimes do) with: nix develop github:some/project cd /tmp unpackPhase Make some change: genericBuild I guesss all this to say my platonic ideal includes getting more busy work out of the way and at least in the case of building, not having to worry about cache affecting reproducibility. I guess all of the above is to try and express my different idea of platonic ideal here and how Nix gives it to me (and could perhaps to you, for a cost).
- layer8 3y agoIf nothing else, make clean is useful to recover disk space not needed anymore, which can be substantial. It’s like deleting a cache or a tmp directory. It can also help to fix the build process by resetting it if something got stuck in the wrong state, but that’s not necessarily the primary purpose.
- hawski 3y agoFor make there is much better option than googling: https://www.gnu.org/software/make/manual/make.html https://www.gnu.org/software/make/manual/make.html and hit Ctrl+F. You can even easily search for things like $<. Nothing else is really needed. And for BSD make the man page is all you need.
- alwillis 3y ago> But make is widespread, ancient and eternal. It isn't going anywhere, despite decades of new tools trying to take its place. It does many jobs relatively well. Agreed--make is eternal. One thing that'll probably be true: in a post-apocalyptic future, make will still be around and still be useful.
- matheusmoreira 3y ago> But make is widespread, ancient and eternal. Yeah. The GNU Make is literally everywhere, it's too useful and it's got too many good features. GNU Make is worth learning and using just because of this. Having to deal with non-make systems is seriously annoying. > It does many jobs relatively well. I wonder if anyone else other than me was insane enough to try and use GNU Make to manage dotfiles? I even blogged about it. https://www.matheusmoreira.com/articles/managing-dotfiles-with-make https://www.matheusmoreira.com/articles/managing-dotfiles-wi... Gotta be really careful with stuff like that. GNU Make is simultaneously a rather lisplike metaprogrammable language and a turing tarpit. I screwed up a personal project once because I got sidetracked essentially reinventing a fraction of autoconf in pure GNU Make code. Now I try to keep things as simple as possible. I still understand the makefile so I suppose it's simple enough.
- alwillis 3y ago> I wonder if anyone else other than me was insane enough to try and use GNU Make to manage dotfiles? Not a bad idea IMHO… thanks for the blog post. I'm tempted to try something similar.
- matheusmoreira 3y agoThe real makefile that I use and wrote about has some features that I didn't get around to describing in the blog post. Also has a ton of comments. https://github.com/matheusmoreira/.files/blob/master/GNUmakefile https://github.com/matheusmoreira/.files/blob/master/GNUmake... The metaprogramming template I described is used to implement XDG Base Directories. The links take the XDG variables into account while the real files live in their default locations inside the repository.
- bombcar 3y agogradle is just a makefile with bells on and you’ll never convince me otherwise