<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def distclean(ctx=None):
	'''removes the build directory'''
	global commands
	lst=os.listdir('.')
	for f in lst:
		if f==Options.lockfile:
			try:
				proj=Environment.Environment(f)
			except:
				Logs.warn('could not read %r'%f)
				continue
			try:
				shutil.rmtree(proj[BLDDIR])
			except IOError:
				pass
			except OSError,e:
				if e.errno!=errno.ENOENT:
					Logs.warn('project %r cannot be removed'%proj[BLDDIR])
			try:
				os.remove(f)
			except OSError,e:
				if e.errno!=errno.ENOENT:
					Logs.warn('file %r cannot be removed'%f)
		if not commands and f.startswith('.waf'):
			shutil.rmtree(f,ignore_errors=True)