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