From: Florent Kermarrec Date: Mon, 14 Apr 2014 15:21:34 +0000 (+0200) Subject: make: add clean action X-Git-Tag: 24jan2021_ls180~2730 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=97311fc211984f801acd14edb5d6d10abaa7d0d7;p=litex.git make: add clean action --- diff --git a/make.py b/make.py index f08fd4d1..0b866e52 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: {}