2018-02-02 14:31:37 +00:00
# SimpleLink MCU platform makefile
i f n d e f C O N T I K I
$( error CONTIKI not defined! You must specify where CONTIKI resides!)
e n d i f
i f n d e f S I M P L E L I N K _ S D K
$( error SIMPLELINK_SDK not defined! You must specify where the SimpleLink SDK resides!)
e n d i f
2018-02-15 14:39:18 +00:00
# Hacky way to emulate line breaks in warnings/errors
# https://stackoverflow.com/questions/17055773/how-to-synthesize-line-breaks-in-gnu-make-warnings-or-errors
d e f i n e n
e n d e f
# List of all Simplelink SDKs the Contiki Simplelink platform supports
# with the format "simplelink_<device>_sdk". Don't add the version.
# Simply adding a new entry with the name of a new SDK should be enough when
# the necessary implementaitons have been made.
SUPPORTED_SDKS = \
simplelink_cc13x0_sdk \
simplelink_cc13x2_sdk \
simplelink_cc26x0_sdk \
simplelink_cc26x2_sdk \
simplelink_cc2640r2_sdk \
# The Simplelink SDK name extracted from the file path.
# e.g. C:/ti/simplelink_cc13x0_sdk_1_60_00_21 => simplelink_cc13x0_sdk_1_60_00_21
SDK_NAME := $( notdir $( SIMPLELINK_SDK) )
# The stripped name from the Simplelink SDK, i.e. without version number.
# e.g. simplelink_cc13x0_sdk_1_60_00_21 => simplelink_cc13x0_sdk
# Note that the first grep verifies the SDK name is on a valid format,
# and the second grep extracts the stripped name
SDK_NAME_STRIPPED := $( shell echo " $( SDK_NAME) " \
| grep -Po "simplelink_.*?_sdk_[0-9_]+" \
| grep -Po "simplelink_.*?_sdk" )
# Verify a valid Simplelink SDK has been supplied.
# Format is "simplelink_<device>_sdk_<version>"
i f e q ( , $( SDK_NAME_STRIPPED ) )
$( error Supplied Simplelink SDK '$(SDK_NAME)' is not valid.$nFormat is "simplelink_<device>_sdk_<version>" )
e n d i f
# Verify a supported Simplelink SDK has been supplied, else print all supported SDKs
i f e q ( , $( findstring $ ( SDK_NAME_STRIPPED ) , $ ( SUPPORTED_SDKS ) ) )
$( error Simplelink SDK '$(SDK_NAME)' is not supported.$nSupported SDKs:$n $( foreach sdk, $( SUPPORTED_SDKS) , $( sdk) _<version>$n ) )
e n d i f
# Find all available boards from the '<sdk>/source/ti/boards directory'
AVAILABLE_BOARDS := $( shell ls -d $( SIMPLELINK_SDK) /source/ti/boards/*)
# Also allow a custom board file in the application project
AVAILABLE_BOARDS += CUSTOM
2018-02-06 13:30:50 +00:00
i f n d e f S I M P L E L I N K _ B O A R D
2018-02-15 14:39:18 +00:00
$( error SIMPLELINK_BOARD not defined. You must specify a board!$nAvailable boards:$n $( foreach board, $( AVAILABLE_BOARDS) , $( board) $n ) )
2018-02-06 13:30:50 +00:00
e n d i f
i f n e q ( $( findstring $ ( SIMPLELINK_BOARD ) ,$ ( AVAILABLE_BOARDS ) ) , $( SIMPLELINK_BOARD ) )
2018-02-15 14:39:18 +00:00
$( error Board '$(SIMPLELINK_BOARD)' is not valid for the given Simplelink SDK '$(SDK_NAME)' .$nAvailable boards:$n $( foreach board, $( AVAILABLE_BOARDS) , $( board) $n ) )
2018-02-06 13:30:50 +00:00
e n d i f
2018-02-02 14:31:37 +00:00
### Board and BSP selection
2018-02-15 14:39:18 +00:00
CONTIKI_TARGET_DIRS += . common
2018-02-02 14:31:37 +00:00
2018-02-05 16:18:08 +00:00
CONTIKI_TARGET_SOURCEFILES += platform.c
2018-02-15 14:39:18 +00:00
CONTIKI_TARGET_SOURCEFILES += leds-arch.c
2018-02-02 14:31:37 +00:00
2018-02-05 16:18:08 +00:00
CONTIKI_SOURCEFILES += $( CONTIKI_TARGET_SOURCEFILES)
2018-02-02 14:31:37 +00:00
CLEAN += *.simplelink
### Unless the example dictates otherwise, build without code size optimisations
SMALL ?= 0
2018-02-05 16:18:08 +00:00
CONTIKI_CPU = $( CONTIKI) /arch/cpu/simplelink
i n c l u d e $( CONTIKI_CPU ) / M a k e f i l e . s i m p l e l i n k
2018-02-02 14:31:37 +00:00
2018-02-15 14:39:18 +00:00
MODULES += os/net os/net/mac os/net/mac/framer
2018-02-02 14:31:37 +00:00