2 # This is a project Makefile. It is assumed the directory this Makefile resides in is a
3 # project subdirectory.
6 PROJECT_NAME := chip-tests
8 CXXFLAGS += -DCHIP_SUPPORT_FOREIGN_TEST_DRIVERS -DCHIP_TARGET_STYLE_EMBEDDED -Wno-deprecated-declarations
10 CXXFLAGS += -DLWIP_IPV6_SCOPES=0 -std=gnu++14
11 CPPFLAGS += -DLWIP_IPV6_SCOPES=0 -DCHIP_HAVE_CONFIG_H
12 CFLAGS += -DLWIP_IPV6_SCOPES=0 -std=gnu11
14 EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32/components
16 include $(IDF_PATH)/make/project.mk
18 esp32_elf_builder: all
20 echo "#!/bin/sh" > build/chip/esp32_elf_builder.sh
21 echo set -e >> build/chip/esp32_elf_builder.sh
22 echo set -x >> build/chip/esp32_elf_builder.sh
23 echo $(CXX) $(CXXFLAGS) $(CPPFLAGS) -L$(PROJECT_PATH)/build/chip/lib -Wl,--whole-archive '$$1' -Wl,--no-whole-archive \
24 -lnlunit-test $(LDFLAGS) -lnlfaultinjection '$$2' -o $(PROJECT_PATH)/build/chip-tests.elf -Wl,-Map=$(APP_MAP) >> build/chip/esp32_elf_builder.sh
25 echo $(ESPTOOLPY) elf2image $(ESPTOOL_FLASH_OPTIONS) $(ESPTOOL_ELF2IMAGE_OPTIONS) \
26 -o $(PROJECT_PATH)/build/chip/chip-tests.bin $(PROJECT_PATH)/build/chip-tests.elf >> build/chip/esp32_elf_builder.sh
27 ln -sf $(PROJECT_PATH)/build/partitions.bin $(PROJECT_PATH)/build/chip/partitions.bin
28 mkdir -p build/chip/bootloader
29 ln -sf $(PROJECT_PATH)/build/bootloader/bootloader.bin $(PROJECT_PATH)/build/chip/bootloader.bin
30 ln -sf $(PROJECT_PATH)/idf.sh $(PROJECT_PATH)/build/chip/env.sh