gen_makefile: provide overall 'clean' target

Change-Id: I746234eb458da41b86fe9571915a2e942daa26ee
This commit is contained in:
Neels Hofmeyr 2017-08-29 12:30:32 +02:00
parent 375ac73ec9
commit 277f479b17
1 changed files with 10 additions and 0 deletions

View File

@ -164,6 +164,13 @@ def gen_make(proj, deps, configure_opts, jobs, make_dir, src_dir, build_dir, url
@echo "\n\n\n===== $@\n"
$(MAKE) -C {build_proj} install
touch $@
.PHONY: {proj}-clean
{proj}-clean:
@echo "\n\n\n===== $@\n"
-chmod -R ug+w {build_proj}
-rm -rf {build_proj}
-rm -rf .make.{proj}.*
'''.format(
url=url,
proj=proj,
@ -224,6 +231,9 @@ regen:
# convenience target: clone all repositories first
out.write('clone: \\\n\t' + ' \\\n\t'.join([ '.make.%s.clone' % p for p, d in projects_deps ]) + '\n\n')
# convenience target: clean all
out.write('clean: \\\n\t' + ' \\\n\t'.join([ '%s-clean' % p for p, d in projects_deps ]) + '\n\n')
# now the actual useful build rules
out.write('all: \\\n\tclone \\\n\t' + ' \\\n\t'.join([ '.make.%s.detect_edits .make.%s.install' % (p,p) for p, d in projects_deps ]) + '\n\n')