copied from https://github.com/Arceliar/phony