2018-05-08 19:39:20 +00:00
|
|
|
################################################################################
|
2018-05-28 11:17:01 +00:00
|
|
|
### SimpleLink MCU platform makefile
|
2018-02-02 14:31:37 +00:00
|
|
|
|
2018-05-08 19:39:20 +00:00
|
|
|
################################################################################
|
2018-05-28 11:17:01 +00:00
|
|
|
### Sanity check of expected symbols
|
2018-05-08 19:39:20 +00:00
|
|
|
|
2018-02-02 14:31:37 +00:00
|
|
|
ifndef CONTIKI
|
2018-07-24 15:46:42 +00:00
|
|
|
$(error 'CONTIKI' not defined! You must specify where CONTIKI resides!)
|
2018-02-02 14:31:37 +00:00
|
|
|
endif
|
|
|
|
|
2018-09-23 11:58:31 +00:00
|
|
|
BOARD ?= srf06/cc26x0
|
2018-02-06 13:30:50 +00:00
|
|
|
|
2018-05-08 19:39:20 +00:00
|
|
|
################################################################################
|
2018-07-25 08:21:54 +00:00
|
|
|
### Resolve the SimpleLink Family
|
2018-02-16 15:55:39 +00:00
|
|
|
|
2018-07-24 16:27:49 +00:00
|
|
|
SIMPLELINK_FAMILIES := cc13xx-cc26xx
|
2018-02-02 14:31:37 +00:00
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
# Given a SimpleLink family as argument, check if it has the Board file.
|
|
|
|
# If so, return itself; else, return empty string.
|
2018-07-24 16:27:49 +00:00
|
|
|
verify_family = $(shell [ -d $(CONTIKI)/arch/platform/simplelink/$(1)/$(BOARD) ] && echo $(1))
|
2018-05-28 11:17:01 +00:00
|
|
|
|
2018-07-24 16:27:49 +00:00
|
|
|
# Test each supported SimpleLink family and see if it contains the specified Board.
|
|
|
|
# Throw an error if it isn't found.
|
2018-07-25 08:21:54 +00:00
|
|
|
FAMILY := $(foreach FAMILY, $(SIMPLELINK_FAMILIES), $(call verify_family,$(FAMILY)))
|
2018-09-11 11:17:21 +00:00
|
|
|
ifeq ($(strip $(FAMILY)),)
|
2018-07-24 16:27:49 +00:00
|
|
|
$(error Board '$(BOARD)' does not corresponding to any SimpleLink family. Make sure your BOARD variable is correct.)
|
2018-05-28 11:17:01 +00:00
|
|
|
endif
|
2018-08-01 07:06:51 +00:00
|
|
|
# If multiple families are found, only the first one is chosen. If this ever
|
2018-07-25 08:21:54 +00:00
|
|
|
# happens something is not correct.
|
|
|
|
ifneq ($(words $(FAMILY)),1)
|
|
|
|
FAMILY := $(firstword $(FAMILY))
|
|
|
|
$(warning Multiple SimpleLink families found to support '$(BOARD)'. Resolve to '$(FAMILY)'.)
|
|
|
|
endif
|
2018-05-28 11:17:01 +00:00
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
# Remove any excess whitespace.
|
|
|
|
FAMILY := $(strip $(FAMILY))
|
2018-02-02 14:31:37 +00:00
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
FAMILY_PATH := $(realpath $(CONTIKI)/arch/platform/simplelink/$(FAMILY))
|
2018-02-02 14:31:37 +00:00
|
|
|
CLEAN += *.simplelink
|
|
|
|
|
2018-07-25 08:21:54 +00:00
|
|
|
# Include the Simplelink Family specific Makefile
|
2018-05-28 11:17:01 +00:00
|
|
|
include $(FAMILY_PATH)/Makefile.$(FAMILY)
|
|
|
|
|
|
|
|
################################################################################
|
2018-07-25 08:21:54 +00:00
|
|
|
### SimpleLink targets
|
|
|
|
|
2018-05-28 11:17:01 +00:00
|
|
|
simplelink_families:
|
2018-07-24 16:27:49 +00:00
|
|
|
@echo "$(SIMPLELINK_FAMILIES) (current: $(FAMILY))"
|