nes-proj/arch/platform/simplelink/Makefile.simplelink

49 lines
1.8 KiB
Makefile
Raw Normal View History

2018-05-08 19:39:20 +00:00
################################################################################
### SimpleLink MCU platform makefile
2018-02-02 14:31:37 +00:00
2018-05-08 19:39:20 +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
BOARD ?= srf06/cc26x0
2018-05-08 19:39:20 +00:00
################################################################################
2018-07-25 08:21:54 +00:00
### Resolve the SimpleLink Family
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-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)))
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.)
endif
# 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-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
include $(FAMILY_PATH)/Makefile.$(FAMILY)
################################################################################
2018-07-25 08:21:54 +00:00
### SimpleLink targets
simplelink_families:
2018-07-24 16:27:49 +00:00
@echo "$(SIMPLELINK_FAMILIES) (current: $(FAMILY))"