mbed-scli test program
Makefile@10:72b75743f231, 2017-03-05 (annotated)
- Committer:
- mimi3
- Date:
- Sun Mar 05 18:02:41 2017 +0900
- Revision:
- 10:72b75743f231
- Parent:
- 9:d5b80cd43e82
fixed:typo
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 | 8:f1c7a11d0670 | 3 | # v0.9 # 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 | 8:f1c7a11d0670 | 22 | # Display mbed library revision |
mimi3 | 8:f1c7a11d0670 | 23 | # $ make rev |
mimi3 | 6:7915b5819364 | 24 | # |
mimi3 | 1:d5669b136382 | 25 | # Example, it can be used any combination on command line. |
mimi3 | 1:d5669b136382 | 26 | # $ make c f TARGET=NUCLEO_L152RE TC=uARM |
mimi3 | 1:d5669b136382 | 27 | # |
mimi3 | 1:d5669b136382 | 28 | |
mimi3 | 1:d5669b136382 | 29 | |
mimi3 | 1:d5669b136382 | 30 | ########################## |
mimi3 | 1:d5669b136382 | 31 | # Defalut setting. |
mimi3 | 1:d5669b136382 | 32 | # These are must be changed according to your environment. |
mimi3 | 1:d5669b136382 | 33 | ########################## |
mimi3 | 6:7915b5819364 | 34 | TARGET ?= NUCLEO_F030R8 |
mimi3 | 1:d5669b136382 | 35 | #TARGET ?= NUCLEO_L152RE |
mimi3 | 6:7915b5819364 | 36 | #TARGET ?= NUCLEO_F411RE |
mimi3 | 1:d5669b136382 | 37 | |
mimi3 | 1:d5669b136382 | 38 | # GCC_ARM or uARM or ARM |
mimi3 | 1:d5669b136382 | 39 | TC ?= GCC_ARM |
mimi3 | 1:d5669b136382 | 40 | |
mimi3 | 1:d5669b136382 | 41 | # Specify mbed flash drive |
mimi3 | 1:d5669b136382 | 42 | MBED_DRIVE = /g |
mimi3 | 1:d5669b136382 | 43 | |
mimi3 | 1:d5669b136382 | 44 | # Specify mbed root folder: [ "absolute path" or "relative path" ] |
mimi3 | 6:7915b5819364 | 45 | MBED_ROOT = c:/mbed-os |
mimi3 | 1:d5669b136382 | 46 | |
mimi3 | 1:d5669b136382 | 47 | # Specify [ "default" or "debug" or "small" ] |
mimi3 | 6:7915b5819364 | 48 | #PROFILE = --profile ${MBED_ROOT}/tools/profiles/release.json |
mimi3 | 6:7915b5819364 | 49 | #PROFILE = --profile ${MBED_ROOT}/tools/profiles/small.json |
mimi3 | 1:d5669b136382 | 50 | |
mimi3 | 1:d5669b136382 | 51 | # Verbose display |
mimi3 | 6:7915b5819364 | 52 | ifeq (${v},1) |
mimi3 | 6:7915b5819364 | 53 | VERBOSE = -v |
mimi3 | 6:7915b5819364 | 54 | endif |
mimi3 | 1:d5669b136382 | 55 | |
mimi3 | 1:d5669b136382 | 56 | ########################## |
mimi3 | 1:d5669b136382 | 57 | # Fixed setting. |
mimi3 | 1:d5669b136382 | 58 | ########################## |
mimi3 | 1:d5669b136382 | 59 | # Specify "id". This is a fixed constant, don't change it. |
mimi3 | 1:d5669b136382 | 60 | PROG = MBED_A1 |
mimi3 | 1:d5669b136382 | 61 | |
mimi3 | 1:d5669b136382 | 62 | #RTOS = -rtos |
mimi3 | 1:d5669b136382 | 63 | MACROS = "-D NDEBUG=1" |
mimi3 | 1:d5669b136382 | 64 | #CFLAGS = "--cflags NDEBUG=1" |
mimi3 | 1:d5669b136382 | 65 | BUILD_DIR = .build/${TARGET}/${TC} |
mimi3 | 5:c3524dc89507 | 66 | COMFLAG = --color -m ${TARGET} -t ${TC} ${VERBOSE} ${PROFILE} |
mimi3 | 1:d5669b136382 | 67 | PROG_NAME = -n ${PROG} |
mimi3 | 1:d5669b136382 | 68 | |
mimi3 | 1:d5669b136382 | 69 | ########################## |
mimi3 | 1:d5669b136382 | 70 | # Make target |
mimi3 | 1:d5669b136382 | 71 | ########################## |
mimi3 | 1:d5669b136382 | 72 | all: |
mimi3 | 6:7915b5819364 | 73 | @echo ${MBED_ROOT} > mbed-root.txt |
mimi3 | 1:d5669b136382 | 74 | python ${MBED_ROOT}/tools/build.py -j4 ${COMFLAG} ${RTOS} |
mimi3 | 1:d5669b136382 | 75 | python ${MBED_ROOT}/tools/make.py ${COMFLAG} ${PROG_NAME} --build ${BUILD_DIR} --source . |
mimi3 | 1:d5669b136382 | 76 | |
mimi3 | 6:7915b5819364 | 77 | .PHONY: c ca cm f lib lst list rev |
mimi3 | 6:7915b5819364 | 78 | # clean only local |
mimi3 | 5:c3524dc89507 | 79 | c: |
mimi3 | 5:c3524dc89507 | 80 | rm -fr ${BUILD_DIR} |
mimi3 | 5:c3524dc89507 | 81 | |
mimi3 | 9:d5b80cd43e82 | 82 | # clean objects of mbed lib |
mimi3 | 6:7915b5819364 | 83 | cm: |
mimi3 | 6:7915b5819364 | 84 | rm -fr ${MBED_ROOT}/BUILD/* |
mimi3 | 6:7915b5819364 | 85 | rm -fr ${MBED_ROOT}/.build/* |
mimi3 | 6:7915b5819364 | 86 | |
mimi3 | 9:d5b80cd43e82 | 87 | # clean all and make |
mimi3 | 6:7915b5819364 | 88 | ca: cm all |
mimi3 | 1:d5669b136382 | 89 | |
mimi3 | 1:d5669b136382 | 90 | # copy to mbed drive |
mimi3 | 1:d5669b136382 | 91 | f: all |
mimi3 | 1:d5669b136382 | 92 | cp ${BUILD_DIR}/${notdir ${CURDIR}}.bin ${MBED_DRIVE} |
mimi3 | 1:d5669b136382 | 93 | |
mimi3 | 1:d5669b136382 | 94 | # get dependency libraries from web site. |
mimi3 | 1:d5669b136382 | 95 | lib: |
mimi3 | 10:72b75743f231 | 96 | @python mlib.py |
mimi3 | 4:85e9057db7a6 | 97 | |
mimi3 | 9:d5b80cd43e82 | 98 | # make assembler list file |
mimi3 | 4:85e9057db7a6 | 99 | lst: list |
mimi3 | 4:85e9057db7a6 | 100 | list: |
mimi3 | 4:85e9057db7a6 | 101 | @arm-none-eabi-objdump -Sdh ${BUILD_DIR}/${notdir ${CURDIR}}.elf > ${TARGET}-${TC}.lst |
mimi3 | 5:c3524dc89507 | 102 | |
mimi3 | 9:d5b80cd43e82 | 103 | # display mbed lib revision |
mimi3 | 6:7915b5819364 | 104 | rev: |
mimi3 | 6:7915b5819364 | 105 | @grep "e MBED_LIBRARY_VERSION" ${MBED_ROOT}/mbed.h |
mimi3 | 6:7915b5819364 | 106 |