1 # ESP32 Makefile to compile the SoC reset program
2 # Copyright (C) 2022 Espressif Systems Ltd.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>
17 # Pass V=1 to see the commands being executed by make
22 BIN2C = ../../../../../src/helper/bin2char.sh
24 APP = cpu_reset_handler
28 APP_OBJ = $(BUILD_DIR)/$(APP).o
29 APP_BIN = $(BUILD_DIR)/$(APP)_code.bin
30 APP_CODE = $(APP)_code.inc
32 CFLAGS += -mtext-section-literals
36 all: $(BUILD_DIR) $(APP_OBJ) $(APP_CODE)
43 $(Q) $(CROSS)gcc -c $(CFLAGS) -o $@ $^
45 $(APP_CODE): $(APP_OBJ)
47 $(Q) $(CROSS)objcopy -O binary -j.text $^ $(APP_BIN)
48 $(Q) $(BIN2C) < $(APP_BIN) > $@
51 $(Q) rm -rf $(BUILD_DIR)