mbed-scli test program

Dependencies:   Scheduler

Committer:
mimi3
Date:
Tue Feb 28 22:12:26 2017 +0900
Revision:
5:c3524dc89507
Parent:
4:85e9057db7a6
Child:
6:7915b5819364
update: to v0.7

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mimi3 1:d5669b136382 1 #
mimi3 1:d5669b136382 2 # Super light weight command line compile script using mbed-sdk sources.
mimi3 5:c3524dc89507 3 # v0.7
mimi3 1:d5669b136382 4 # 2017/02 made by dinau
mimi3 1:d5669b136382 5 #
mimi3 1:d5669b136382 6
mimi3 1:d5669b136382 7 ##########################
mimi3 1:d5669b136382 8 # Usage
mimi3 1:d5669b136382 9 ##########################
mimi3 1:d5669b136382 10 # First, download the dependency libraries from web.
mimi3 1:d5669b136382 11 # $ make lib
mimi3 1:d5669b136382 12 # Simple build with default settings.
mimi3 1:d5669b136382 13 # $ make
mimi3 1:d5669b136382 14 # It can be changed to other target or toolchain on command line if necessary.
mimi3 1:d5669b136382 15 # $ make TARGET=NUCLEO_F411RE
mimi3 1:d5669b136382 16 # $ make TC=uARM
mimi3 1:d5669b136382 17 # Write *.bin file to target board.
mimi3 1:d5669b136382 18 # $ make f
mimi3 1:d5669b136382 19 # Clean all object files and rebuild target.
mimi3 1:d5669b136382 20 # $ make c
mimi3 1:d5669b136382 21 # Example, it can be used any combination on command line.
mimi3 1:d5669b136382 22 # $ make c f TARGET=NUCLEO_L152RE TC=uARM
mimi3 1:d5669b136382 23 #
mimi3 1:d5669b136382 24
mimi3 1:d5669b136382 25
mimi3 1:d5669b136382 26 ##########################
mimi3 1:d5669b136382 27 # Defalut setting.
mimi3 1:d5669b136382 28 # These are must be changed according to your environment.
mimi3 1:d5669b136382 29 ##########################
mimi3 5:c3524dc89507 30 #TARGET ?= NUCLEO_F030R8
mimi3 1:d5669b136382 31 #TARGET ?= NUCLEO_L152RE
mimi3 5:c3524dc89507 32 TARGET ?= NUCLEO_F411RE
mimi3 1:d5669b136382 33
mimi3 1:d5669b136382 34 # GCC_ARM or uARM or ARM
mimi3 1:d5669b136382 35 TC ?= GCC_ARM
mimi3 1:d5669b136382 36
mimi3 1:d5669b136382 37 # Specify mbed flash drive
mimi3 1:d5669b136382 38 MBED_DRIVE = /g
mimi3 1:d5669b136382 39
mimi3 1:d5669b136382 40 # Specify mbed root folder: [ "absolute path" or "relative path" ]
mimi3 1:d5669b136382 41 MBED_ROOT = /d/mbed-os
mimi3 1:d5669b136382 42
mimi3 1:d5669b136382 43 # Specify [ "default" or "debug" or "small" ]
mimi3 5:c3524dc89507 44 #PROFILE = --profile default
mimi3 1:d5669b136382 45
mimi3 1:d5669b136382 46 # Verbose display
mimi3 5:c3524dc89507 47 #ifeq (${v},1)
mimi3 5:c3524dc89507 48 #VERBOSE = -v
mimi3 5:c3524dc89507 49 #endif
mimi3 1:d5669b136382 50
mimi3 1:d5669b136382 51 ##########################
mimi3 1:d5669b136382 52 # Fixed setting.
mimi3 1:d5669b136382 53 ##########################
mimi3 1:d5669b136382 54 # Specify "id". This is a fixed constant, don't change it.
mimi3 1:d5669b136382 55 PROG = MBED_A1
mimi3 1:d5669b136382 56
mimi3 1:d5669b136382 57 #RTOS = -rtos
mimi3 1:d5669b136382 58 MACROS = "-D NDEBUG=1"
mimi3 1:d5669b136382 59 #CFLAGS = "--cflags NDEBUG=1"
mimi3 1:d5669b136382 60 BUILD_DIR = .build/${TARGET}/${TC}
mimi3 5:c3524dc89507 61 COMFLAG = --color -m ${TARGET} -t ${TC} ${VERBOSE} ${PROFILE}
mimi3 1:d5669b136382 62 PROG_NAME = -n ${PROG}
mimi3 1:d5669b136382 63
mimi3 1:d5669b136382 64 ##########################
mimi3 1:d5669b136382 65 # Make target
mimi3 1:d5669b136382 66 ##########################
mimi3 1:d5669b136382 67 all:
mimi3 1:d5669b136382 68 python ${MBED_ROOT}/tools/build.py -j4 ${COMFLAG} ${RTOS}
mimi3 1:d5669b136382 69 python ${MBED_ROOT}/tools/make.py ${COMFLAG} ${PROG_NAME} --build ${BUILD_DIR} --source .
mimi3 1:d5669b136382 70
mimi3 4:85e9057db7a6 71 .PHONY: c f lib lst list
mimi3 5:c3524dc89507 72 c:
mimi3 5:c3524dc89507 73 rm -fr ${BUILD_DIR}
mimi3 5:c3524dc89507 74
mimi3 1:d5669b136382 75 # clean and make
mimi3 5:c3524dc89507 76 ca:
mimi3 1:d5669b136382 77 rm -fr ${BUILD_DIR}
mimi3 1:d5669b136382 78 python ${MBED_ROOT}/tools/build.py -j4 ${COMFLAG} ${RTOS} -c
mimi3 1:d5669b136382 79 python ${MBED_ROOT}/tools/make.py ${COMFLAG} ${PROG_NAME} --build ${BUILD_DIR} --source . -c
mimi3 1:d5669b136382 80
mimi3 1:d5669b136382 81 # copy to mbed drive
mimi3 1:d5669b136382 82 f: all
mimi3 1:d5669b136382 83 cp ${BUILD_DIR}/${notdir ${CURDIR}}.bin ${MBED_DRIVE}
mimi3 1:d5669b136382 84
mimi3 1:d5669b136382 85 # get dependency libraries from web site.
mimi3 1:d5669b136382 86 lib:
mimi3 1:d5669b136382 87 @python makelib.py
mimi3 4:85e9057db7a6 88
mimi3 4:85e9057db7a6 89 lst: list
mimi3 4:85e9057db7a6 90 list:
mimi3 4:85e9057db7a6 91 @arm-none-eabi-objdump -Sdh ${BUILD_DIR}/${notdir ${CURDIR}}.elf > ${TARGET}-${TC}.lst
mimi3 5:c3524dc89507 92