3 ms·
I think "magic" is much too loaded a way to characterize it. The rule applicable to C pertains to building foo.o from foo.c. It amounts to two lines in a Make
by mturmon 13y ago
I think "magic" is much too loaded a way to characterize it.
The rule applicable to C pertains to building foo.o from foo.c. It amounts to two lines in a Makefile:
%.o: %.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
where COMPILE.c and the other variable is predefined to trivial values.
There are other rules useful for C++, and for yacc, etc., but they are just as simple.
You can cancel all the implicit rules with "-r", or cancel selected implicit rules by naming them in the Makefile like this:
%.o : %.c ;
All this is in the make manual, which is quite good: https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html https://www.gnu.org/software/make/manual/html_node/Catalogue...