From 277f479b17946732d263b6bd499cccb7f8dc58f6 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 29 Aug 2017 12:30:32 +0200 Subject: [PATCH] gen_makefile: provide overall 'clean' target Change-Id: I746234eb458da41b86fe9571915a2e942daa26ee --- gen_makefile.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gen_makefile.py b/gen_makefile.py index 05db443..7b87151 100755 --- a/gen_makefile.py +++ b/gen_makefile.py @@ -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')