11 ms·
Lots of "Don't do this" without suggesting alternatives doesn't do anyone much good. If you're on a *nix system, building C/C++ programs (or automating one-off
by falcolas 14y ago
Lots of "Don't do this" without suggesting alternatives doesn't do anyone much good.
If you're on a *nix system, building C/C++ programs (or automating one-off builds like the example), what would you recommend in make's place?
- lmm 14y agoCMake
- craftkiller 14y agoPersonally I'd suggest Premake because it uses Lua instead of rolling its own scripting language. The world would be a better place if we could all agree on one scripting language for stuff like this so no one has to look up the syntax for things like creating arrays for every individual tool. Feature-wise premake isn't entirely caught up to CMake but it has everything important. Also the premake files look a lot cleaner and more readable compared to cmake files.
- leif 14y agohttp://xkcd.com/927 http://xkcd.com/927
- quotemstr 14y ago> The world would be a better place if we could all agree on one scripting language for stuff like this It's called bloody "make". If Prolog is a language, so is make. Make is still a scripting language even if it's not boneheadedly sequential and imperative the way, say, Python is.
- deleted 14y ago[deleted]
- Peaker 14y agoMake is simply not up to the job. It make writing correct build systems very difficult (hard to not under-specify dependencies). It does not support auto-generating code and then scanning it for extra build dependencies. It is a crappy tool and we should standardize on something better.
- lmm 14y agoIf what you want is a standardized language Scons has that and is a bit more established.
- swift 14y agoCMake is pretty ugly in its own right, though I will grant it's hard to be worse than GNU make.
- jahewson 14y agoCMake is an abomination
- xymostech 14y agoMind pointing out any constructive arguments against it? I recently switched over from hand-built makefiles to cmake for one of my projects, and it's been a breeze.
- wtracy 14y agoI have never been able to figure out how to cross-compile a project that uses CMake. GNU Make lets you just set some environment flags and drop in a different compiler.
- cmccabe 14y agoCMake honors the same environment variables as Make. Just set them before running CMake. CMake also supports cross-compiling. www.vtk.org/Wiki/CMake_Cross_Compiling
- quotemstr 14y agoI prefer autotools to CMake. Maybe I didn't really give CMake a fair shot, but in a few hours of trying, I couldn't out figure out the CMake equivalent to a bit of custom glue code in configure.ac that checked for a Lisp compiler. I get the feeling CMake works fine as long as you color within the lines, but that it's much harder to extend than autotools is.
- McUsr 14y agoYes, this is something I have thought through, though I may have been lucky/unlucky with my pick of projects. But generally speaking, installs I have installed based on GNU autotools, seems to install with less fuzz than those with C-Make. So, that, and the fact that there is full free documentation of GNU Autotools, even books out there, have made my personal choice easy. For me the overall factor is the ease for any of my users, installing something I have written.
- mseebach 14y agoI debated whether to start namedropping build systems, but I decided it was going to be counter productive and devolve into a debate of the relative merits of the systems I'd picked out. In the end it depends heavily on the environment you're in what makes sense for your project.
- NelsonMinar 14y agoIn other words: if you're not sure, use make.
- lmm 14y agoNo, really not. If you pick a build system at random it's probably better than make. If it's a big project it's worth taking 30 minutes to actually look at what's available and pick one.
- lflux 14y agoNinja.
- vinkelhake 14y agoYou probably don't want to write ninja files yourself. CMake + Ninja is a nice combo.
- Peaker 14y agoI'd suggest tup[1] and Shake[2]. [1]: http://gittup.org/tup/ http://gittup.org/tup/ [2]: http://community.haskell.org/~ndm/shake/ http://community.haskell.org/~ndm/shake/
- payload 14y agoThanks for the links! I will definitely use tup for some next project. I try from time to time different make-like systems but I always come back to GNU Make. I also don't fear the GNU Make Reference. But tup looks, again, quite promising. It even has those little context sensitive one-special-char one-letter variables :) But they do something better by design, I see http://gittup.org/tup/make_vs_tup.html http://gittup.org/tup/make_vs_tup.html
- quotemstr 14y ago> This page compares make to tup. This page is a little biased because tup is so fast. How fast? This one time a beam of light was flying through the vacuum of space at the speed of light and then tup went by and was like "Yo beam of light, you need a lift?" cuz tup was going so fast it thought the beam of light had a flat tire and was stuck. True story. Anyway, feel free to run your own comparisons if you don't believe me and my (true) story. The completely unprofessional tone here really turns me off to the entire system. If you write like a typical teenager, you probably code like a typical teenager, and I don't want a typical teenager writing my goddamn build system. Besides: who the hell is bottlenecked on the build system? The compiler and linker (or the equivalent for your favorite language) do all the work. Anyone who believes this article makes a different is completely ignorant of Amdahl's Law.
- plorkyeran 14y agoFor very large projects the build system can quite easily become the bottleneck when just changing a single file, which also happens to be the most important use-case for developers. In extreme cases a no-op build with make can easily get to 15+ seconds.
- rachelbythebay 14y agoAssuming you're building your own code and are willing to arrange things in a compatible manner, then I have a solution to offer. It figures out the dependencies by reading the source code. You can create objects and binaries just by asking it to build a certain target. I recorded an example of installing and using it here: http://rachelbythebay.com/jvt/view?bb_install http://rachelbythebay.com/jvt/view?bb_install You can get a copy for experimentation here: http://rachelbythebay.com/bb/ http://rachelbythebay.com/bb/ It isn't for everyone, but only you can know if it'll meet your needs. Hopefully this helps.
- quotemstr 14y ago> willing to arrange things in a compatible manner, then I have a solution to offer. So you're proposing that people give up screwdrivers because figuring out what bit to use is hard, and that they should instead use your potato peeler, never mind that it doesn't actually drive screws?
- rachelbythebay 14y agoNope. Not at all. But I like that you think that.
- _phred 14y agoWhoa, your terminal playback thing is pretty neat. Did you use GNU Screen to record the session?
- rachelbythebay 14y agoThank you! I used script. Certain implementations have an option to emit timing and byte count data on stderr. Then it's just a matter of saving it and building something to honor those delays during playback.
- kragen 14y agoThat's awesome! I had no idea about `script -t`; I'd written my own a few years back. Thank you!
- jhasse 14y agoScons: http://scons.org/ http://scons.org/