3 ms·
"The "%.o: %.c" line is a huge code smell for Makefiles. You shouldn't ever write that line—it's built in!" Does it hurt to write it though? It makes the makef
by yodsanklai 9y ago
"The "%.o: %.c" line is a huge code smell for Makefiles. You shouldn't ever write that line—it's built in!"
Does it hurt to write it though? It makes the makefile more readable for people who don't know it's built-in. Besides, it's only built-in for ".c". I prefer to keep it in order to have a generic Makefile I can adapt to other programming languages.
- exDM69 9y agoEither you should not write it, or disable all built-in rules of Make with a flag. Doing both is asking for trouble. Make has lots of built-in rules for lots of languages, C, C++, Fortran, Lex, Yacc, etc.