4 ms·
I work on a project with 4.4 million lines of code and using a single Makefile with no generated code works fine. It's really not all that difficult.
by jart 2y ago
I work on a project with 4.4 million lines of code and using a single Makefile with no generated code works fine. It's really not all that difficult.
- wruza 2y agoProjects of much smaller sizes often have recursive convoluted makefiles.
- chipdart 2y ago> Projects of much smaller sizes often have recursive convoluted makefiles. You name any technology and anyone can enumerate dozens of projects that use it wrong.
- wruza 2y agoI’d walk that before talking. Take any complex makefile system and turn it into a single “not really difficult” makefile without sacrificing anything important. Wins this argument and helps those who “use it wrong”.
- ReleaseCandidat 2y agoAnd I can show you thousands of "Hello World"s that use GNU Autotools or CMake ;) But seriously: can I take a look at it (Soource + Makefile)?
- Drawde 2y agoThis is most likely what is being referenced: https://github.com/jart/cosmopolitan/blob/master/Makefile https://github.com/jart/cosmopolitan/blob/master/Makefile I like how the includes are separated and commented. Also if you weren't already familiar with their work you might be interested in giving this a read: https://justine.lol/ape.html https://justine.lol/ape.html
- homebrewer 2y agoCan % grep '^include' Makefile -c 159 includes with % wc --lines --total=only $(awk '/^include/{ print $2 }' Makefile) Makefile 22547 lines in total really count as having a single makefile? I have no dog in this fight, just wondering.
- rectang 2y agoI don’t object to “it works for me”, but “it’s really not all that difficult” is a bad generalization. * If you need portability, Makefiles are hard. * The whitespace design of Makefiles is bad and has swallowed up countless debugging hours over the years. This design flaw isn’t intrinsic to the way Makefiles work, it’s just a lousy artifact from a superficial decision from decades ago: to change behavior based on distinctions invisible in source code. It’s mitigated by syntax highlighting but still bites people. * Makefiles are dependent on the consistency of the build environment, for example the availability and behavior of command line switches. Even if your project doesn’t need OS platform portability, this is still a pain across time and requires external tooling to manage. * There are certain subtleties to the way Makefiles behave that are addressed by `.PHONY`. I agree that these are manageable in the absence of other complexities, but they contribute towards Makefiles being more difficult than appears at first. I’m sure you’re familiar with those critiques and others. They may not bother you, but you don’t speak for everybody.
- jart 2y agoMy Makefile is portable. It builds binaries that run on six OSes and two architectures. So I used my Makefile to build GNU Make and a GCC toolchain. Now I can run my Makefile on any of those OSes / architectures too, and it'll produce the same deterministic output, bit for bit.
- whartung 2y agoIf part of your build is building your own build tool in order to ensure you have the proper build tool then why not build a different “better” build tool? Part of the premise of Make is its ubiquity, but if you can’t rely on that save as a simple bootstrap (as you seem to be doing) then why not forego it for something else?
- marci 2y agoAre you suggesting this: https://xkcd.com/927/ https://xkcd.com/927/ ?
- 2y ago
- flykespice 2y agoSure buddy anything can be manageable once you invest enough time and sanity. Now show us the Makefile.
- sshine 2y ago> I work on a project with 4.4 million lines of code [...] It's really not all that difficult. You may be biased.