Updated with changes from Claudio Beccari, v 1.4; marked cls target as phony.