mbed-scli test program
Diff: Makefile
- Revision:
- 1:d5669b136382
- Child:
- 3:60330a83318b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Sun Feb 26 20:26:24 2017 +0900 @@ -0,0 +1,83 @@ +# +# Super light weight command line compile script using mbed-sdk sources. +# v0.4 +# 2017/02 made by dinau +# + +########################## +# Usage +########################## +# First, download the dependency libraries from web. +# $ make lib +# Simple build with default settings. +# $ make +# It can be changed to other target or toolchain on command line if necessary. +# $ make TARGET=NUCLEO_F411RE +# $ make TC=uARM +# Write *.bin file to target board. +# $ make f +# Clean all object files and rebuild target. +# $ make c +# Example, it can be used any combination on command line. +# $ make c f TARGET=NUCLEO_L152RE TC=uARM +# + + +########################## +# Defalut setting. +# These are must be changed according to your environment. +########################## +TARGET ?= NUCLEO_F030R8 +#TARGET ?= NUCLEO_L152RE + +# GCC_ARM or uARM or ARM +TC ?= GCC_ARM + +# Specify mbed flash drive +MBED_DRIVE = /g + +# Specify mbed root folder: [ "absolute path" or "relative path" ] +MBED_ROOT = /d/mbed-os + +# Specify [ "default" or "debug" or "small" ] +PROFILE = --profile default + +# Verbose display +ifeq (${v},1) + VERBOSE = -v +endif + +########################## +# Fixed setting. +########################## +# Specify "id". This is a fixed constant, don't change it. +PROG = MBED_A1 + +#RTOS = -rtos +MACROS = "-D NDEBUG=1" +#CFLAGS = "--cflags NDEBUG=1" +BUILD_DIR = .build/${TARGET}/${TC} +COMFLAG = --color -m ${TARGET} -t ${TC} ${VERBOSE} ${PROFILE} +PROG_NAME = -n ${PROG} + +########################## +# Make target +########################## +all: + python ${MBED_ROOT}/tools/build.py -j4 ${COMFLAG} ${RTOS} + python ${MBED_ROOT}/tools/make.py ${COMFLAG} ${PROG_NAME} --build ${BUILD_DIR} --source . + +.PHONY: c f lib +# clean and make +c: + rm -fr ${BUILD_DIR} + python ${MBED_ROOT}/tools/build.py -j4 ${COMFLAG} ${RTOS} -c + python ${MBED_ROOT}/tools/make.py ${COMFLAG} ${PROG_NAME} --build ${BUILD_DIR} --source . -c + +# copy to mbed drive +f: all + cp ${BUILD_DIR}/${notdir ${CURDIR}}.bin ${MBED_DRIVE} + +# get dependency libraries from web site. +lib: + @python makelib.py