mbed-scli test program

Dependencies:   Scheduler

Makefile

Committer:
mimi3
Date:
2017-02-28
Revision:
5:c3524dc89507
Parent:
4:85e9057db7a6
Child:
6:7915b5819364

File content as of revision 5:c3524dc89507:

#
# Super light weight command line compile script using mbed-sdk sources.
# v0.7
# 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
TARGET		?= NUCLEO_F411RE

# 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 lst list
c:
	rm -fr ${BUILD_DIR}

# clean and make
ca:
	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

lst: list
list:
	@arm-none-eabi-objdump -Sdh ${BUILD_DIR}/${notdir ${CURDIR}}.elf > ${TARGET}-${TC}.lst