6 ms·
It's a great habit. I use that same concept extensively for all my projects, whatever the language/stack, though I prefer to use Makefiles since I feel like it
by Galanwe 6y ago
It's a great habit.
I use that same concept extensively for all my projects, whatever the language/stack, though I prefer to use Makefiles since I feel like it creates a more cohesive result. Very easy to chain, depend and read in the CI too.
- dahfizz 6y ago+1 for make. Its an amazing and underrated tool.
- jscheel 6y agoIt took me forever to come around on make, but I absolutely love it for things like this now.
- narwally 6y agoAny recommendations on learning to use make more effectively outside of just reading the docs? I feel like this is a glaring gap in my knowledge as I really only know the basics.
- makapuf 6y agoI'd say gnu make (dont use any other make) can be learned from the documentation, it readable. Also, it's super simple to try things yourself (unlike, say, k8s by example) : just use it in your project and use the doc as needed. I am very fond of make, to the point I did a video transcoding solution based on it and ffmpeg.
- TeMPOraL 6y agoRelated trick: GNU tools tend to come with Info pages - it's to man pages what a book is to a listicle. These Info pages can get you up to speed quickly, while giving you a deeper understanding of the tool at the same time.
- jscheel 6y agoHmm, unfortunately I don't. I didn't really bookmark anything when I was learning. IIRC, I spent most of my time in the docs though.
- sneak 6y agoRead a lot of other people's Makefiles. I tend to shy away from huge/overly complex ones, but there's a lot of good examples out there where I got most of my ideas/habits/patterns from.
- notacoward 6y agoAgreed. A great many things can be expressed as a graph of sub-tasks with preconditions and dependencies that create a partial ordering, and make is pretty darn good at grinding through such graphs. You can go far with just the basics plus a couple of extra tricks like "phony" targets.
- necrotic_comp 6y agoCan you give an example on how you use make for simple things like this ? I want to get into it for non C++ projects, and it's a little daunting to make the leap.
- cgarvis 6y agoHere is a starting point for a AWS SAM Golang project. It even comes with a `make help` command. https://gist.github.com/cgarvis/61d70eeb1288bfee540c59cad095be64 https://gist.github.com/cgarvis/61d70eeb1288bfee540c59cad095...
- necrotic_comp 6y agoThanks!
- sneak 6y agoHere's one of mine for a project I'm working on today: https://git.eeqj.de/sneak/mothership/src/branch/master/Makefile https://git.eeqj.de/sneak/mothership/src/branch/master/Makef...
- pletnes 6y agoI love this! Used to do it, too, but currently we’re stuck in windows. What do you do then? (IT blocks WSL so not that)
- JamesSwift 6y agoGNU make is available on windows. If you run it via git-bash then it should mostly "just work" (though there will be some idiosyncracies to work out). I tested this project and it all runs on linux/osx/windows: https://github.com/J-Swift/cod-stats https://github.com/J-Swift/cod-stats
- pletnes 6y agoNot an easy sell in my experience, windows people think it’s strange to install an archaic C build system as an add-on. And some people even git in cmd. It’s just not easy to get people on board with it.
- JamesSwift 6y agoWhen used as I would recommend, GNU Make is not a build system, its a task runner. Its a language agnostic gulp or npm package.json scripts runner. You can run anything you want (even powershell!) in the targets, its just a standard way to package them up together and declare task dependencies.
- pletnes 6y agoI know and support the approach, but have to keep «selling» this. Make documents itself as a C compilation system. I think it’s actually a better task runner! Python’s tox and invoke are nice, but much more noisy and language-specific.
- JamesSwift 6y agoYes, anything I do public facing is likely to use make/docker. It really cuts down on the mental energy I need to expend thinking about differing environments/bootstrapping.