@@ -64,7 +64,21 @@ CHIP_BUILD_ARCH = $(shell $(CHIP_ROOT)/third_party/nlbuild-autotools/repo/third_
64
64
# Compilation flags specific to building CHIP
65
65
# ==================================================
66
66
67
- CHIP_DEFINES += \
67
+ CHIP_DEFINES += \
68
+ MBEDTLS_CONFIG_FILE=\<$(CHIP_ROOT ) /third_party/openthread/repo/third_party/mbedtls/mbedtls-config.h\> \
69
+ MBEDTLS_USER_CONFIG_FILE=\<$(CHIP_ROOT ) /third_party/openthread/repo/examples/platforms/k32w/k32w061/k32w061-mbedtls-config.h\> \
70
+ MBEDTLS_THREADING_C=1 \
71
+ MBEDTLS_THREADING_ALT=1 \
72
+ MBEDTLS_X509_CSR_WRITE_C \
73
+ MBEDTLS_X509_CREATE_C \
74
+ MBEDTLS_PK_WRITE_C \
75
+ MBEDTLS_OID_C \
76
+ MBEDTLS_PEM_WRITE_C \
77
+ MBEDTLS_BASE64_C \
78
+ MBEDTLS_SSL_COOKIE_C \
79
+ MBEDTLS_HKDF_C \
80
+ MBEDTLS_SSL_SRV_C \
81
+ MBEDTLS_ERROR_C
68
82
69
83
CHIP_DEFINE_FLAGS = $(foreach def,$(CHIP_DEFINES ) ,-D$(def ) )
70
84
CHIP_CPPFLAGS = $(STD_CFLAGS ) $(CFLAGS ) $(DEBUG_FLAGS ) $(OPT_FLAGS ) $(DEFINE_FLAGS ) $(CHIP_DEFINE_FLAGS ) $(INC_FLAGS )
@@ -75,36 +89,36 @@ CHIP_CXXFLAGS = $(STD_CXXFLAGS) $(CXXFLAGS)
75
89
# ==================================================
76
90
77
91
CHIP_CONFIGURE_OPTIONS = \
78
- -C AR="$(AR ) " AS="$(AS ) " CC="$(CCACHE ) $(CC ) " CXX="$(CCACHE ) $(CXX ) " \
79
- LD="$(LD ) " OBJCOPY="$(OBJCOPY ) " RANLIB="$(RANLIB ) " INSTALL="$(INSTALL ) $(INSTALLFLAGS ) " \
92
+ -C AR="$(AR ) " AS="$(AS ) " CC="$(CCACHE ) $(CC ) " CXX="$(CCACHE ) $(CXX ) " \
93
+ LD="$(LD ) " OBJCOPY="$(OBJCOPY ) " RANLIB="$(RANLIB ) " INSTALL="$(INSTALL ) $(INSTALLFLAGS ) " \
80
94
CPPFLAGS="$(CHIP_CPPFLAGS ) -imacros $(CHIP_ROOT ) /third_party/openthread/repo/examples/platforms/k32w/k32w061/k32w061-sdk-config.h" \
81
- CXXFLAGS="$(CHIP_CXXFLAGS ) " \
82
- --prefix=$(CHIP_OUTPUT_DIR ) \
83
- --exec-prefix=$(CHIP_OUTPUT_DIR ) \
84
- --host=$(CHIP_HOST_ARCH ) \
85
- --build=$(CHIP_BUILD_ARCH ) \
86
- --with-target-style=embedded \
87
- --with-device-layer=k32w \
88
- --with-network-layer=all \
89
- --with-target-network=lwip \
90
- --with-lwip=internal \
91
- --with-lwip-target=k32w \
92
- --with-inet-endpoint="tcp udp" \
93
- --with-openssl=no \
94
- --with-openthread=internal \
95
- --with-logging-style=external \
96
- --with-chip-project-includes=$(CHIP_PROJECT_CONFIG ) \
97
- --with-chip-system-project-includes=$(CHIP_PROJECT_CONFIG ) \
98
- --with-chip-inet-project-includes=$(CHIP_PROJECT_CONFIG ) \
99
- --with-chip-ble-project-includes=$(CHIP_PROJECT_CONFIG ) \
100
- --with-chip-warm-project-includes=$(CHIP_PROJECT_CONFIG ) \
101
- --with-chip-device-project-includes=$(CHIP_PROJECT_CONFIG ) \
102
- --disable-ipv4 \
103
- --disable-tests \
104
- --disable-tools \
105
- --disable-docs \
106
- --disable-java \
107
- --disable-device-manager \
95
+ CXXFLAGS="$(CHIP_CXXFLAGS ) " \
96
+ --prefix=$(CHIP_OUTPUT_DIR ) \
97
+ --exec-prefix=$(CHIP_OUTPUT_DIR ) \
98
+ --host=$(CHIP_HOST_ARCH ) \
99
+ --build=$(CHIP_BUILD_ARCH ) \
100
+ --with-target-style=embedded \
101
+ --with-device-layer=k32w \
102
+ --with-network-layer=all \
103
+ --with-target-network=lwip \
104
+ --with-lwip=internal \
105
+ --with-lwip-target=k32w \
106
+ --with-inet-endpoint="tcp udp" \
107
+ --with-openssl=no \
108
+ --with-openthread=internal \
109
+ --with-logging-style=external \
110
+ --with-chip-project-includes=$(CHIP_PROJECT_CONFIG ) \
111
+ --with-chip-system-project-includes=$(CHIP_PROJECT_CONFIG ) \
112
+ --with-chip-inet-project-includes=$(CHIP_PROJECT_CONFIG ) \
113
+ --with-chip-ble-project-includes=$(CHIP_PROJECT_CONFIG ) \
114
+ --with-chip-warm-project-includes=$(CHIP_PROJECT_CONFIG ) \
115
+ --with-chip-device-project-includes=$(CHIP_PROJECT_CONFIG ) \
116
+ --disable-ipv4 \
117
+ --disable-tests \
118
+ --disable-tools \
119
+ --disable-docs \
120
+ --disable-java \
121
+ --disable-device-manager \
108
122
--with-crypto=mbedtls
109
123
110
124
# Enable / disable optimization.
@@ -123,35 +137,37 @@ endif
123
137
# ==================================================
124
138
125
139
# Add CHIP-specific paths to the standard include directories.
126
- STD_INC_DIRS += \
127
- $(CHIP_OUTPUT_DIR ) /include \
128
- $(CHIP_OUTPUT_DIR ) /src/include \
129
- $(CHIP_ROOT ) /third_party/lwip/repo/lwip/src/include \
130
- $(CHIP_ROOT ) /src/lwip \
131
- $(CHIP_ROOT ) /src/lwip/k32w \
132
- $(CHIP_ROOT ) /src/lwip/freertos \
133
- $(K32W061_SDK_ROOT ) /CMSIS/Include \
134
- $(K32W061_SDK_ROOT ) /devices/K32W061 \
135
- $(K32W061_SDK_ROOT ) /devices/K32W061/drivers \
136
- $(K32W061_SDK_ROOT ) /devices/K32W061/utilities \
137
- $(K32W061_SDK_ROOT ) /devices/K32W061/utilities/debug_console \
138
- $(K32W061_SDK_ROOT ) /devices/K32W061/utilities/str \
139
- $(K32W061_SDK_ROOT ) /middleware/wireless/framework/Common \
140
- $(K32W061_SDK_ROOT ) /middleware/wireless/framework/Lists \
141
- $(K32W061_SDK_ROOT ) /middleware/wireless/framework/PDM/Include \
142
- $(K32W061_SDK_ROOT ) /middleware/wireless/framework/MemManager/Interface \
140
+ STD_INC_DIRS += \
141
+ $(CHIP_OUTPUT_DIR ) /include \
142
+ $(CHIP_OUTPUT_DIR ) /src/include \
143
+ $(CHIP_OUTPUT_DIR ) /third_party/openthread/include \
144
+ $(CHIP_ROOT ) /third_party/lwip/repo/lwip/src/include \
145
+ $(CHIP_ROOT ) /third_party/openthread/repo/third_party/nxp/K32W061DK6/middleware/mbedtls/port/ksdk \
146
+ $(CHIP_ROOT ) /src/lwip \
147
+ $(CHIP_ROOT ) /src/lwip/k32w \
148
+ $(CHIP_ROOT ) /src/lwip/freertos \
149
+ $(K32W061_SDK_ROOT ) /CMSIS/Include \
150
+ $(K32W061_SDK_ROOT ) /devices/K32W061 \
151
+ $(K32W061_SDK_ROOT ) /devices/K32W061/drivers \
152
+ $(K32W061_SDK_ROOT ) /devices/K32W061/utilities \
153
+ $(K32W061_SDK_ROOT ) /devices/K32W061/utilities/debug_console \
154
+ $(K32W061_SDK_ROOT ) /devices/K32W061/utilities/str \
155
+ $(K32W061_SDK_ROOT ) /middleware/wireless/framework/Common \
156
+ $(K32W061_SDK_ROOT ) /middleware/wireless/framework/Lists \
157
+ $(K32W061_SDK_ROOT ) /middleware/wireless/framework/PDM/Include \
158
+ $(K32W061_SDK_ROOT ) /middleware/wireless/framework/MemManager/Interface \
143
159
$(CHIP_ROOT ) /third_party/openthread/repo/examples/platforms
144
160
145
161
# Add the location of CHIP libraries to application link action.
146
162
STD_LDFLAGS += -L$(CHIP_OUTPUT_DIR ) /lib
147
163
148
164
# Add CHIP libraries to standard libraries list.
149
- STD_LIBS += \
165
+ STD_LIBS += \
150
166
-lDeviceLayer \
151
- -lCHIP \
152
- -lInetLayer \
167
+ -lCHIP \
168
+ -lInetLayer \
153
169
-lSystemLayer \
154
- -llwip \
170
+ -llwip \
155
171
-lmbedtls
156
172
157
173
# Add the appropriate CHIP target as a prerequisite to all application
@@ -160,13 +176,13 @@ STD_LIBS += \
160
176
STD_COMPILE_PREREQUISITES += install-chip
161
177
162
178
# Add the CHIP libraries as prerequisites for linking the application.
163
- STD_LINK_PREREQUISITES += \
179
+ STD_LINK_PREREQUISITES += \
164
180
$(CHIP_OUTPUT_DIR ) /lib/libDeviceLayer.a \
165
- $(CHIP_OUTPUT_DIR ) /lib/libCHIP.a \
166
- $(CHIP_OUTPUT_DIR ) /lib/libInetLayer.a \
181
+ $(CHIP_OUTPUT_DIR ) /lib/libCHIP.a \
182
+ $(CHIP_OUTPUT_DIR ) /lib/libInetLayer.a \
167
183
$(CHIP_OUTPUT_DIR ) /lib/libSystemLayer.a \
168
- $(CHIP_OUTPUT_DIR ) /lib/liblwip.a \
169
- $(CHIP_OUTPUT_DIR ) /lib/libmbedtls.a \
184
+ $(CHIP_OUTPUT_DIR ) /lib/liblwip.a \
185
+ $(CHIP_OUTPUT_DIR ) /lib/libmbedtls.a
170
186
171
187
# ==================================================
172
188
# Late-bound build rules for CHIP
0 commit comments