5 ms·
I like your thinking regarding using simpler build tools. I took this to the extreme and now my build tool for personal C/C++ projects is just a file called bui
by spatulon 9y ago
I like your thinking regarding using simpler build tools. I took this to the extreme and now my build tool for personal C/C++ projects is just a file called build.sh/build.bat. That does little more than:
gcc main.c
main.c #includes any other .c files that are needed (the term for this appears to be a 'unity build'). Compiling this way is /really/ fast, which is why it's okay to use a dumb build script that always recompiles everything.
- keldaris 9y agoI do exactly the same thing whenever I write C/C++. Genuinely large projects aside, I see no compelling reason to waste your time with build systems. This approach is simple, easy to maintain and lets you get on with writing actual code.
- ramzyo 9y agoOut of curiosity, why not use make for something so simple instead of a Shell script?
- grawprog 9y agoMy thoughts are a shell is usually installed by default. Make may not be. This is only a guess. I'm not sure myself.
- spatulon 9y agoIn my mind, shell scripts are simpler. I have no reason to need the extra complexity that make brings. Also, I do a lot of programming on Windows, where GNU make would be another dependency to install. (Also, in my experience, make is slow on Windows, since they have to emulate fork()). I guess I could use Microsoft nmake, since I assume it's still installed along with Visual Studio, but again, batch files are simpler.
- int_19h 9y agoTake a look at this: http://news.dieweltistgarnichtso.net/bin/redo-sh.html http://news.dieweltistgarnichtso.net/bin/redo-sh.html And for GNU tools on Windows, I would heavily recommend MSYS2 these days - having Pacman as the package manager is very nice, and there are already a lot of packages there.
- keldaris 9y agoBecause I don't see any value from using it. It's not easier to read or write, it doesn't force you to keep it sane and simple like a bash/cmd script generally would, and it's just another dependency I don't really need. If I take a minimalistic approach to build systems, I prefer to go all the way. Also, although this is merely a personal quirk that shouldn't persuade anyone else, I've seen enough horrific, unreadable make files to instinctively dislike them by now.
- ramzyo 9y agoOut of curiosity, why did you not choose make to do this?
- omilu 9y agodid you watch handmade hero? he advocates the same
- spatulon 9y agoHaha, yes. Casey has been quite a big influence on me re-finding enjoyment in programming that I thought I'd lost.
- earenndil 9y agoI would tbh recommend make (bsd make is a wider-supported subset of gnu make) over a shell script, because it can automatically detect which source files need to be rebuilt and which can be kept from previous builds, greatly reducing compile times. Also, it supports parallel builds, although this one is relatively easy with a shellscript.
- int_19h 9y agoIf the sole purpose is to track which files changed, then redo is arguably a simpler solution to this problem - you don't need to learn a new language either (and its funky rules like the tab/space difference), just shell scripts with a couple new commands. http://news.dieweltistgarnichtso.net/bin/redo-sh.html http://news.dieweltistgarnichtso.net/bin/redo-sh.html
- senorsmile 9y agoI've never seen this before... I shall have to try it out on a C project I'm starting. Thanks!