build: add support for automatically removing build dir contents during build