-
Notifications
You must be signed in to change notification settings - Fork 51
/
chip.mk
executable file
·82 lines (69 loc) · 2.45 KB
/
chip.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# chip definition
#
# ----------------------------------------------------------------------------
# chip type
# ----------------------------------------------------------------------------
-include $(ROOT_PATH)/.config
# ----------------------------------------------------------------------------
# chips of arch version 2
# ----------------------------------------------------------------------------
ifeq ($(__CONFIG_CHIP_TYPE), xr872)
__CONFIG_CHIP_ARCH_VER := 2
__CONFIG_CHIP_XR872 := y
CONFIG_SYMBOLS += -D__CONFIG_CHIP_XR872
endif
ifeq ($(__CONFIG_CHIP_TYPE), xr808)
__CONFIG_CHIP_ARCH_VER := 2
__CONFIG_CHIP_XR808 := y
CONFIG_SYMBOLS += -D__CONFIG_CHIP_XR808
endif
CONFIG_SYMBOLS += -D__CONFIG_CHIP_ARCH_VER=$(__CONFIG_CHIP_ARCH_VER)
# ----------------------------------------------------------------------------
# arch and core
# ----------------------------------------------------------------------------
__CONFIG_ARCH_DUAL_CORE := n
ifeq ($(__CONFIG_ARCH_DUAL_CORE), y)
CONFIG_SYMBOLS += -D__CONFIG_ARCH_DUAL_CORE
endif
__CONFIG_ARCH_APP_CORE := y
ifeq ($(__CONFIG_ARCH_APP_CORE), y)
CONFIG_SYMBOLS += -D__CONFIG_ARCH_APP_CORE
endif
__CONFIG_ARCH_NET_CORE := n
ifeq ($(__CONFIG_ARCH_NET_CORE), y)
CONFIG_SYMBOLS += -D__CONFIG_ARCH_NET_CORE
endif
# ----------------------------------------------------------------------------
# cpu
# ----------------------------------------------------------------------------
__CONFIG_CPU_CM4F ?= y
ifeq ($(__CONFIG_CPU_CM4F), y)
CONFIG_SYMBOLS += -D__CONFIG_CPU_CM4F
endif
# ----------------------------------------------------------------------------
# chip configuration check
# ----------------------------------------------------------------------------
ifneq ($(MAKECMDGOALS), config)
ifneq ($(MAKECMDGOALS), config_clean)
ifndef __CONFIG_CHIP_TYPE
__nullstring :=
$(info ERROR:)
$(info $(__nullstring) Chip is not defined!)
$(info $(__nullstring) Please run `make config` in your project.)
$(info $(__nullstring) Or run `./configure.sh` in the root directory.)
$(error )
endif
ifndef __CONFIG_HOSC_TYPE
__nullstring :=
$(info ERROR:)
$(info $(__nullstring) External high speed crystal oscillator is not defined!)
$(info $(__nullstring) Please run `make config` in your project.)
$(info $(__nullstring) Or run `./configure.sh` in the root directory.)
$(error )
endif
ifndef __CONFIG_CHIP_ARCH_VER
$(error Invalid chip configuration!)
endif
endif
endif