Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / examples / temperature-measurement-app / esp32 / Makefile
1 #
2 #    Copyright (c) 2020 Project CHIP Authors
3 #    All rights reserved.
4 #
5 #    Licensed under the Apache License, Version 2.0 (the "License");
6 #    you may not use this file except in compliance with the License.
7 #    You may obtain a copy of the License at
8 #
9 #        http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #    Unless required by applicable law or agreed to in writing, software
12 #    distributed under the License is distributed on an "AS IS" BASIS,
13 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #    See the License for the specific language governing permissions and
15 #    limitations under the License.
16
17 #
18 # This is a project Makefile. It is assumed the directory this Makefile resides in is a
19 # project subdirectory.
20 #
21
22 PROJECT_NAME := chip-temperature-measurement-app
23
24 EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32/components \
25                         $(PROJECT_PATH)/../../common/m5stack-tft/repo/components \
26                         $(PROJECT_PATH)/../../common/QRCode \
27                         $(PROJECT_PATH)/../../common/screen-framework \
28
29 CXXFLAGS += -std=c++14 -Os -DLWIP_IPV6_SCOPES=0
30 CPPFLAGS += -Os -DLWIP_IPV6_SCOPES=0 -DCHIP_HAVE_CONFIG_H
31 CFLAGS += -Os -DLWIP_IPV6_SCOPES=0
32
33 top: all flashing_script
34
35 ifeq ($(is_debug),false)
36 export SDKCONFIG_DEFAULTS = sdkconfig.optimize.defaults
37 endif
38
39 include $(IDF_PATH)/make/project.mk
40
41 FLASHING_SCRIPT=$(BUILD_DIR_BASE)/$(PROJECT_NAME).flash.py
42
43 $(FLASHING_SCRIPT): $(APP_BIN) $(BOOTLOADER_BIN) $(PARTITION_TABLE_BIN) $(PROJECT_PATH)/sdkconfig
44         @third_party/connectedhomeip/scripts/flashing/gen_flashing_script.py esp32 \
45           --output $(BUILD_DIR_BASE)/$(PROJECT_NAME).flash.py \
46           --port $(ESPPORT) --baud $(ESPBAUD) --before $(CONFIG_ESPTOOLPY_BEFORE) --after $(CONFIG_ESPTOOLPY_AFTER) \
47           --application $(subst $(BUILD_DIR_BASE)/,,$(APP_BIN)) \
48           --bootloader $(subst $(BUILD_DIR_BASE)/,,$(BOOTLOADER_BIN)) \
49           --partition $(subst $(BUILD_DIR_BASE)/,,$(PARTITION_TABLE_BIN)) \
50           --use-partition-file $(PARTITION_TABLE_BIN) \
51           --use-parttool $(IDF_PATH)/components/partition_table/parttool.py \
52           --use-sdkconfig $(PROJECT_PATH)/sdkconfig
53
54 flashing_script: $(FLASHING_SCRIPT) $(BUILD_DIR_BASE)/esp32_firmware_utils.py $(BUILD_DIR_BASE)/firmware_utils.py
55         @echo To flash $(subst $(CURDIR)/,,$(APP_BIN)), run $(subst $(CURDIR)/,,$(FLASHING_SCRIPT))
56
57 $(BUILD_DIR_BASE)/esp32_firmware_utils.py: third_party/connectedhomeip/scripts/flashing/esp32_firmware_utils.py
58         @cp $< $@
59
60 $(BUILD_DIR_BASE)/firmware_utils.py: third_party/connectedhomeip/scripts/flashing/firmware_utils.py
61         @cp $< $@
62
63 .PHONY: flashing_script