4 ms·
This is simple vs magic. Makefiles are simple in that you can see every directive and very little is hidden from you. There is no magic - just dependency order
by RVuRnvbM2e 9y ago
This is simple vs magic.
Makefiles are simple in that you can see every directive and very little is hidden from you. There is no magic - just dependency ordering using mtime as a very simple heuristic.
- palotasb 9y agoExcept that there is a lot of magic [1] and it does cause bugs. For example the implicit `%: %.o` rule has to be cancelled if you have a rule like `$(SPECIFIC_OBJ_FILES): %.c.o: %.c` [1]: https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#Catalogue-of-Rules https://www.gnu.org/software/make/manual/html_node/Catalogue...
- meribold 9y agoI like to put `MAKEFLAGS += --no-builtin-rules` near the top of my makefiles. This way, all predefined rules are cancelled and I won't be caught off guard by a rule that I didn't specify explicitly being a match. I also usually put `.SUFFIXES:`, but I guess that's redundant: "The `-r` or `--no-builtin-rules` flag causes the default list of suffixes to be empty." [1] [1]: https://www.gnu.org/software/make/manual/make.html#Suffix-Rules https://www.gnu.org/software/make/manual/make.html#Suffix-Ru...