Ummm...
What language?
As a quick example, in BASH there's '
&&' which, when used to separate two (or more) commands on one line, means "Wait until the previous command completes successfully before running the next command". If the previous command fails to complete successfully, the process stops there and the rest of the commands are not processed.
Code:
~ # make && make install
HTH. Let us know.