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