3 ms·
This is a nice article, especially on a general level of writing scripts that automate work so you don't have to redo it manually. I want to point out one thin
by shurcooL 14y ago
This is a nice article, especially on a general level of writing scripts that automate work so you don't have to redo it manually.
I want to point out one thing.
targetfile: sourcefiles
command
This violates DRY, there is duplication between command and source files (and target file?). In theory, it should be possible to automatically deduct the source files from the command.
It's far from easy in the general case, but it would save you from having to manually update source files when the command changes. (Any small inefficiency times lots of occurrences times lots of people really adds up.)
- spc476 14y agoI don't understand. In make, I can do: program : f1.o f2.o f3.o $(CC) -o $@ $^ f1.o : f1.c f1.h f.h $(CC) -c -o $@ $< Where "$@" is the target, "$^" is a list of the source files, and "$<" is the first source file. And that's if you want to be verbose.