|
|
|
|
|
by peterwwillis
2385 days ago
|
|
rm -rf ${APP} is a code smell. If ${APP} is not a directory, -r should not be in this command. At best it is possibly confusing, and at worst if somehow ${APP} accidentally becomes a directory it will just remove it and you will have no idea that it was a directory, whereas just rm -f ${APP} will fail because it can't unlink a directory. Build success is an important factor in a CI/CD pipeline, therefore builds should fail immediately under unexpected behavior. Also, on .PHONY on a single line: But for Makefiles which grow really big, this is not suggested as it
could lead to ambiguity and unreadability, hence the preferred way is
to explicitly set phony target right before the rule definition.
If your Makefile grows really big, it's going to become a nightmare to maintain. Either split up your codebase + builds into sub-directories, or figure out some other way to structure your builds so that it's not super complicated to reason about or maintain them. |
|
Over all I agree with your argument, though.