|
|
|
|
|
by Someone
4437 days ago
|
|
Say you have a long build process and do a quick semi-clean by hand to speed up the next buld (not the best idea, but not inconceivable), deleting the .a files, but fogetting to delete the matching .o files. Then, your next build will produce some novel (to you) error messages that may take long to clean up. Worse, the command building on the .o and the .a might just say "OK, I'm given a .o without a .a; fine, then I'll do a slightly different thing" Also, having two rules means duplicating a command: foo: foo.a
baz $(BAZ_OPTIONS) foo
foo: foo.o
baz $(BAZ_OPTIONS) foo
That's bad from a maintenance perspective. |
|
The solution to the multiple target problem is using the built in magic .INTERMEDIATE rule which isn't entirely obvious how it works.