From 9797f654d935cdd75ede4ef98b762284d54a5da4 Mon Sep 17 00:00:00 2001 From: Anton Staaf Date: Tue, 22 Jul 2014 08:33:46 -0700 Subject: Makefile: Add support for per-board symlinks to top level Previously if you were working on a single board you had to add BOARD= to all of your make command lines. Now if you are in a board directory you can just use "make", or "make clean", or any other top level make command. This commit also adds support for a top level "make flash" command that can be used from the board directories as well. This command uses openocd and requires that the board provides an openocd-flash.cfg file. Signed-off-by: Anton Staaf BRANCH=none TEST=(from a few board directories) make clean; make -j (from the discovery-stm32f072 directory) make flash Change-Id: Ie09a74881371169a2c3cd9cd9922f39f4873f1a6 Reviewed-on: https://chromium-review.googlesource.com/209669 Tested-by: Anton Staaf Reviewed-by: Bill Richardson Commit-Queue: Anton Staaf --- board/discovery-stm32f072/Makefile | 21 +-------------------- board/discovery-stm32f072/openocd-flash.cfg | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 20 deletions(-) mode change 100644 => 120000 board/discovery-stm32f072/Makefile create mode 100644 board/discovery-stm32f072/openocd-flash.cfg (limited to 'board/discovery-stm32f072') diff --git a/board/discovery-stm32f072/Makefile b/board/discovery-stm32f072/Makefile deleted file mode 100644 index 20874220b1..0000000000 --- a/board/discovery-stm32f072/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2014 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# -# Simple flashing command to reflash the discovery board using openocd -# -.PHONY: flash - -flash: - sudo openocd -f board/stm32f0discovery.cfg \ - -c "gdb_port 0" \ - -c "tcl_port 0" \ - -c "telnet_port 0" \ - -c "init" \ - -c "reset init" \ - -c "flash write_image erase ../../build/discovery-stm32f072/ec.bin 0x08000000" \ - -c "reset halt" \ - -c "resume" \ - -c "shutdown" diff --git a/board/discovery-stm32f072/Makefile b/board/discovery-stm32f072/Makefile new file mode 120000 index 0000000000..94aaae2c4d --- /dev/null +++ b/board/discovery-stm32f072/Makefile @@ -0,0 +1 @@ +../../Makefile \ No newline at end of file diff --git a/board/discovery-stm32f072/openocd-flash.cfg b/board/discovery-stm32f072/openocd-flash.cfg new file mode 100644 index 0000000000..eed8d03f36 --- /dev/null +++ b/board/discovery-stm32f072/openocd-flash.cfg @@ -0,0 +1,15 @@ +# Copyright (c) 2014 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source [find board/stm32f0discovery.cfg] + +gdb_port 0 +tcl_port 0 +telnet_port 0 +init +reset init +flash write_image erase $BUILD_DIR/ec.bin 0x08000000 +reset halt +resume +shutdown -- cgit v1.2.1