2018-09-23 09:45:48 +00:00
|
|
|
include rules/dkarm_compat
|
2018-05-01 05:15:48 +00:00
|
|
|
|
2018-08-13 08:58:24 +00:00
|
|
|
TARGET := hekate
|
2018-09-18 21:36:40 +00:00
|
|
|
BLVERSION_MAJOR := 4
|
2018-09-19 14:58:26 +00:00
|
|
|
BLVERSION_MINOR := 1
|
2018-08-13 08:58:24 +00:00
|
|
|
BUILD := build
|
2018-08-07 14:53:58 +00:00
|
|
|
OUTPUT := output
|
2018-08-13 08:58:24 +00:00
|
|
|
SOURCEDIR = bootloader
|
|
|
|
VPATH = $(dir $(wildcard ./$(SOURCEDIR)/*/)) $(dir $(wildcard ./$(SOURCEDIR)/*/*/))
|
2018-08-07 14:53:58 +00:00
|
|
|
|
2018-08-13 08:58:24 +00:00
|
|
|
OBJS = $(addprefix $(BUILD)/$(TARGET)/, \
|
2018-05-01 05:15:48 +00:00
|
|
|
start.o \
|
|
|
|
main.o \
|
2018-07-01 17:45:25 +00:00
|
|
|
config.o \
|
2018-05-01 05:15:48 +00:00
|
|
|
btn.o \
|
|
|
|
clock.o \
|
|
|
|
cluster.o \
|
|
|
|
fuse.o \
|
|
|
|
gpio.o \
|
|
|
|
heap.o \
|
|
|
|
hos.o \
|
|
|
|
i2c.o \
|
|
|
|
kfuse.o \
|
2018-06-24 19:42:46 +00:00
|
|
|
bq24193.o \
|
2018-05-01 05:15:48 +00:00
|
|
|
max7762x.o \
|
2018-06-24 19:42:46 +00:00
|
|
|
max17050.o \
|
2018-05-01 05:15:48 +00:00
|
|
|
mc.o \
|
|
|
|
nx_emmc.o \
|
|
|
|
sdmmc.o \
|
|
|
|
sdmmc_driver.o \
|
|
|
|
sdram.o \
|
|
|
|
tui.o \
|
|
|
|
util.o \
|
|
|
|
di.o \
|
|
|
|
gfx.o \
|
|
|
|
pinmux.o \
|
|
|
|
pkg1.o \
|
|
|
|
pkg2.o \
|
|
|
|
se.o \
|
|
|
|
tsec.o \
|
|
|
|
uart.o \
|
2018-08-21 01:37:40 +00:00
|
|
|
dirlist.o \
|
2018-05-01 05:15:48 +00:00
|
|
|
ini.o \
|
2018-08-21 01:14:31 +00:00
|
|
|
ianos.o \
|
2018-05-01 05:15:48 +00:00
|
|
|
)
|
2018-08-07 14:53:58 +00:00
|
|
|
|
2018-08-13 08:58:24 +00:00
|
|
|
OBJS += $(addprefix $(BUILD)/$(TARGET)/, \
|
|
|
|
lz.o blz.o \
|
|
|
|
diskio.o ff.o ffunicode.o ffsystem.o \
|
|
|
|
elfload.o elfreloc_arm.o \
|
|
|
|
)
|
2018-05-01 05:15:48 +00:00
|
|
|
|
2018-09-23 09:45:48 +00:00
|
|
|
CFLAGS += -mthumb
|
|
|
|
LDFLAGS += -mthumb
|
|
|
|
CFLAGS += -DBLVERSIONMJ=$(BLVERSION_MAJOR) -DBLVERSIONMN=$(BLVERSION_MINOR)
|
|
|
|
CFLAGS += -DMENU_LOGO_ENABLE
|
|
|
|
#CFLAGS += -DDEBUG
|
2018-05-01 05:15:48 +00:00
|
|
|
|
2018-08-07 14:53:58 +00:00
|
|
|
MODULEDIRS := $(wildcard modules/*)
|
|
|
|
|
|
|
|
.PHONY: all clean $(MODULEDIRS)
|
2018-05-01 05:15:48 +00:00
|
|
|
|
2018-05-11 02:28:53 +00:00
|
|
|
all: $(TARGET).bin
|
2018-07-01 01:56:58 +00:00
|
|
|
@echo -n "Payload size is "
|
2018-08-07 14:53:58 +00:00
|
|
|
@wc -c < $(OUTPUT)/$(TARGET).bin
|
2018-07-01 01:56:58 +00:00
|
|
|
@echo "Max size is 126296 Bytes."
|
2018-05-01 05:15:48 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -rf $(OBJS)
|
2018-05-11 02:28:53 +00:00
|
|
|
@rm -rf $(BUILD)
|
2018-08-07 14:53:58 +00:00
|
|
|
@rm -rf $(OUTPUT)
|
|
|
|
|
|
|
|
$(MODULEDIRS):
|
|
|
|
$(MAKE) -C $@ $(MAKECMDGOALS)
|
2018-05-01 05:15:48 +00:00
|
|
|
|
2018-08-13 08:58:24 +00:00
|
|
|
$(TARGET).bin: $(BUILD)/$(TARGET)/$(TARGET).elf $(MODULEDIRS)
|
2018-08-07 14:53:58 +00:00
|
|
|
$(OBJCOPY) -S -O binary $< $(OUTPUT)/$@
|
2018-08-21 01:41:16 +00:00
|
|
|
@printf ICTC$(BLVERSION_MAJOR)$(BLVERSION_MINOR) >> $(OUTPUT)/$@
|
2018-05-01 05:15:48 +00:00
|
|
|
|
2018-08-13 08:58:24 +00:00
|
|
|
$(BUILD)/$(TARGET)/$(TARGET).elf: $(OBJS)
|
|
|
|
$(CC) $(LDFLAGS) -T $(SOURCEDIR)/link.ld $^ -o $@
|
2018-05-01 05:15:48 +00:00
|
|
|
|
2018-08-13 08:58:24 +00:00
|
|
|
$(BUILD)/$(TARGET)/%.o: %.c
|
2018-05-01 05:15:48 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2018-08-13 08:58:24 +00:00
|
|
|
$(BUILD)/$(TARGET)/%.o: %.S
|
2018-05-11 02:28:53 +00:00
|
|
|
@mkdir -p "$(BUILD)"
|
2018-08-13 08:58:24 +00:00
|
|
|
@mkdir -p "$(BUILD)/$(TARGET)"
|
2018-08-07 14:53:58 +00:00
|
|
|
@mkdir -p "$(OUTPUT)"
|
2018-05-01 05:15:48 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|