4 ms·
> MAKEFLAGS += --no-builtin-rules > This disables the bewildering array of built in rules ... Oh, wow, I totally disagree. It's good to be opinionated -- tha
by wyldfire 7y ago
> MAKEFLAGS += --no-builtin-rules
> This disables the bewildering array of built in rules ...
Oh, wow, I totally disagree. It's good to be opinionated -- that is, unless you're wrong. ;)
In all seriousness I find it terribly useful to quickly create simple Makefiles and follow idioms like CFLAGS/CXXFLAGS/LDFLAGS/LDLIBS/etc.
- Tyr42 7y agoI think putting those rules in a standard lib you could include would be awesome. I would then be able to open up the file and see check if it was CPPFLAGS or CXXFLAGS, or whatever, and see how it's written. It'd be way more discover-able, AND it would make make much nicer to teach. I have tried to teach make, but these implicit rules firing when I'm just trying to do a simple example can mask errors and create a lot of confusion. Also, not looking at all the VCS versions of the file makes make run much faster, so being modular in what you imported would be a win for bigger systems too.
- saagarjha 7y agoCPPFLAGS are meant to be passed to the C preprocessor, while CXXFLAGS are passed to the C++ compiler.
- alxmdev 7y agoI've recently been lightly toasted by GNU Make's implicit "old-fashioned" suffix rules, where it was looking for YACC files as prerequisites for my own generated C code. The manual suggests a workaround that clears the implicit suffixes and also allows you to add back the ones you want. For me, clearing all of them with an empty ".SUFFIXES :" rule was exactly what I needed. https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html https://www.gnu.org/software/make/manual/html_node/Suffix-Ru...
- microtherion 7y agoIf you think implicit yacc rules are "old-fashioned", let me introduce you to GNU Make's… implicit SCCS rules!