also build boards without family
This commit is contained in:
parent
e9e3000ff9
commit
8c5c46454f
|
@ -2,6 +2,9 @@
|
||||||
# Common make definition for all examples
|
# Common make definition for all examples
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
|
|
||||||
|
# Build directory
|
||||||
|
BUILD = _build/build-$(BOARD)
|
||||||
|
|
||||||
# Handy check parameter function
|
# Handy check parameter function
|
||||||
check_defined = \
|
check_defined = \
|
||||||
$(strip $(foreach 1,$1, \
|
$(strip $(foreach 1,$1, \
|
||||||
|
@ -18,19 +21,29 @@ __check_defined = \
|
||||||
# $(error Invalid BOARD specified)
|
# $(error Invalid BOARD specified)
|
||||||
#endif
|
#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),)
|
||||||
|
BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/*/boards/$(BOARD)))
|
||||||
|
FAMILY := $(word 3, $(subst /, ,$(BOARD_PATH)))
|
||||||
|
FAMILY_PATH = hw/bsp/$(FAMILY)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(BOARD_PATH),)
|
ifeq ($(BOARD_PATH),)
|
||||||
$(error Invalid BOARD specified)
|
$(error Invalid BOARD specified)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
FAMILY = $(word 3, $(subst /, ,$(BOARD_PATH)))
|
ifeq ($(FAMILY),)
|
||||||
FAMILY_PATH = hw/bsp/$(FAMILY)
|
include $(TOP)/hw/bsp/$(BOARD)/board.mk
|
||||||
|
else
|
||||||
|
# Include Family and Board specific defs
|
||||||
|
include $(TOP)/$(FAMILY_PATH)/family.mk
|
||||||
|
|
||||||
# Build directory
|
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
|
||||||
BUILD = _build/build-$(BOARD)
|
endif
|
||||||
|
|
||||||
# Include Family and Board specific defs
|
|
||||||
include $(TOP)/$(FAMILY_PATH)/family.mk
|
|
||||||
|
|
||||||
#-------------- Cross Compiler ------------
|
#-------------- Cross Compiler ------------
|
||||||
# Can be set by board, default to ARM GCC
|
# Can be set by board, default to ARM GCC
|
||||||
|
@ -49,7 +62,6 @@ RM = rm
|
||||||
|
|
||||||
# Include all source C in family & board folder
|
# Include all source C in family & board folder
|
||||||
SRC_C += hw/bsp/board.c
|
SRC_C += hw/bsp/board.c
|
||||||
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
|
|
||||||
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(BOARD_PATH)/*.c))
|
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(BOARD_PATH)/*.c))
|
||||||
|
|
||||||
# Compiler Flags
|
# Compiler Flags
|
||||||
|
|
Loading…
Reference in New Issue