1#
2# eFuse Manager ganeretes header file.
3#
4.PHONY: efuse_custom_table efuse_common_table efuse_test_table show_efuse_table
5
6GEN_EFUSE_TABLE := $(PYTHON) $(COMPONENT_PATH)/efuse_table_gen.py
7
8GEN_EFUSE_TABLE_ARG := --max_blk_len $(CONFIG_EFUSE_MAX_BLK_LEN)
9
10
11###################
12# Make common files esp_efuse_table.c and include/esp_efuse_table.h files.
13SOC_NAME := $(IDF_TARGET)
14EFUSE_COMMON_TABLE_CSV_PATH := $(COMPONENT_PATH)/$(SOC_NAME)/esp_efuse_table.csv
15
16efuse_common_table:
17	@echo "COMMON_TABLE_CSV: $(EFUSE_COMMON_TABLE_CSV_PATH)"
18	$(GEN_EFUSE_TABLE) $(EFUSE_COMMON_TABLE_CSV_PATH) $(GEN_EFUSE_TABLE_ARG)
19
20
21###################
22# Make custom files project/main/esp_efuse_custom_table.c and project/main/include/esp_efuse_custom_table.h files.
23ifdef CONFIG_EFUSE_CUSTOM_TABLE
24# Path to CSV file is relative to project path for custom CSV files.
25EFUSE_CUSTOM_TABLE_CSV_PATH := $(call dequote,$(abspath $(call dequote, $(PROJECT_PATH))/$(call dequote,$(CONFIG_EFUSE_CUSTOM_TABLE_FILENAME))))
26
27efuse_custom_table:
28	@echo "COMMON_TABLE_CSV: $(EFUSE_COMMON_TABLE_CSV_PATH)"
29	@echo "CUSTOM_TABLE_CSV: $(EFUSE_CUSTOM_TABLE_CSV_PATH)"
30	$(GEN_EFUSE_TABLE) $(EFUSE_COMMON_TABLE_CSV_PATH) $(EFUSE_CUSTOM_TABLE_CSV_PATH) $(GEN_EFUSE_TABLE_ARG)
31
32else
33efuse_custom_table:
34EFUSE_CUSTOM_TABLE_CSV_PATH :=
35EFUSE_CUSTOM_TABLE_OUT_PATH :=
36endif # ifdef CONFIG_EFUSE_CUSTOM_TABLE
37
38
39###################
40# print to console efuse table
41show_efuse_table:
42	$(GEN_EFUSE_TABLE) $(EFUSE_COMMON_TABLE_CSV_PATH) $(EFUSE_CUSTOM_TABLE_CSV_PATH) $(GEN_EFUSE_TABLE_ARG) --info
43
44
45###################
46# Generates files for unit test. This command is run manually.
47EFUSE_TEST_TABLE_CSV_PATH := $(COMPONENT_PATH)/test/esp_efuse_test_table.csv
48efuse_test_table:
49	$(GEN_EFUSE_TABLE) $(EFUSE_TEST_TABLE_CSV_PATH) $(GEN_EFUSE_TABLE_ARG)
50