Ignore Exit Codes View article history Edit article

Published: , Updated:
Talks about: , , and

In case you are using a Makefile to define a complex build step - for example start database, run tests, stop database - consider using the - qualifier in front of your actual build step like this:

.PHONY: build
build:
	start-database
	-build-software
	stop-database

Thanks to -, the database will be stopped even if building your software fails, therefore making sure to clean up after ourselves once the build finishes.