From 97311fc211984f801acd14edb5d6d10abaa7d0d7 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 14 Apr 2014 17:21:34 +0200 Subject: [PATCH] make: add clean action --- make.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/make.py b/make.py index f08fd4d19..0b866e52f 100755 --- a/make.py +++ b/make.py @@ -18,6 +18,7 @@ MiSoC - a high performance and small footprint SoC based on Migen. This program builds and/or loads MiSoC components. One or several actions can be specified: +clean delete previous build(s). build-bitstream build FPGA bitstream. Implies build-bios on targets with integrated BIOS. build-headers build software header files with CSR/IRQ/SDRAM_PHY definitions. @@ -28,7 +29,7 @@ load-bitstream load bitstream into volatile storage. flash-bitstream load bitstream into non-volatile storage. flash-bios load BIOS into non-volatile storage. -all build-bitstream, build-bios, flash-bitstream, flash-bios. +all clean, build-bitstream, build-bios, flash-bitstream, flash-bios. Load/flash actions use the existing outputs, and do not trigger new builds. """) @@ -91,7 +92,7 @@ if __name__ == "__main__": soc.finalize() # decode actions - action_list = ["build-bitstream", "build-headers", "build-csr-csv", "build-bios", + action_list = ["clean", "build-bitstream", "build-headers", "build-csr-csv", "build-bios", "load-bitstream", "flash-bitstream", "flash-bios", "all"] actions = {k: False for k in action_list} for action in args.action: @@ -119,6 +120,7 @@ Subtarget: {} # dependencies if actions["all"]: + actions["clean"] = True actions["build-bitstream"] = True actions["build-bios"] = True actions["flash-bitstream"] = True @@ -128,6 +130,9 @@ Subtarget: {} if actions["build-bios"]: actions["build-headers"] = True + if actions["clean"]: + subprocess.call(["rm", "-rf", "build/*"]) + if actions["build-headers"]: boilerplate = """/* * Platform: {}