summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-01-13 12:56:33 +0700
committerhathach <[email protected]>2021-01-13 12:56:48 +0700
commit8c5c46454fdcc43faf04d8c3dd41434f7fd0122e (patch)
treeba2fb8358904b1275e2a7bd5711fcc68e2b400b4 /examples
parente9e3000ff9ff7cb2255c7b45f1938aee6de8b244 (diff)
also build boards without family
Diffstat (limited to 'examples')
-rw-r--r--examples/make.mk30
1 files changed, 21 insertions, 9 deletions
diff --git a/examples/make.mk b/examples/make.mk
index d19dd7f09..60e5f2c06 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -2,6 +2,9 @@
# Common make definition for all examples
# ---------------------------------------
+# Build directory
+BUILD = _build/build-$(BOARD)
+
# Handy check parameter function
check_defined = \
$(strip $(foreach 1,$1, \
@@ -18,19 +21,29 @@ __check_defined = \
# $(error Invalid BOARD specified)
#endif
-BOARD_PATH = $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/*/boards/$(BOARD)))
+# Board without family
+BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/$(BOARD)))
+FAMILY :=
+
+# Board within family
ifeq ($(BOARD_PATH),)
- $(error Invalid BOARD specified)
+ BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/*/boards/$(BOARD)))
+ FAMILY := $(word 3, $(subst /, ,$(BOARD_PATH)))
+ FAMILY_PATH = hw/bsp/$(FAMILY)
endif
-FAMILY = $(word 3, $(subst /, ,$(BOARD_PATH)))
-FAMILY_PATH = hw/bsp/$(FAMILY)
+ifeq ($(BOARD_PATH),)
+ $(error Invalid BOARD specified)
+endif
-# Build directory
-BUILD = _build/build-$(BOARD)
+ifeq ($(FAMILY),)
+ include $(TOP)/hw/bsp/$(BOARD)/board.mk
+else
+ # Include Family and Board specific defs
+ include $(TOP)/$(FAMILY_PATH)/family.mk
-# Include Family and Board specific defs
-include $(TOP)/$(FAMILY_PATH)/family.mk
+ SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
+endif
#-------------- Cross Compiler ------------
# Can be set by board, default to ARM GCC
@@ -49,7 +62,6 @@ RM = rm
# Include all source C in family & board folder
SRC_C += hw/bsp/board.c
-SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(BOARD_PATH)/*.c))
# Compiler Flags