1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-12-22 16:12:03 +00:00
hekate/Makefile

77 lines
1.4 KiB
Makefile
Raw Normal View History

2018-05-01 06:15:48 +01:00
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
2018-06-08 10:42:24 +01:00
include $(DEVKITARM)/base_rules
2018-05-01 06:15:48 +01:00
TARGET := ipl
BUILD := build_ipl
SOURCEDIR := ipl
OBJS = $(addprefix $(BUILD)/, \
start.o \
main.o \
config.o \
2018-05-01 06:15:48 +01:00
btn.o \
blz.o \
2018-05-01 06:15:48 +01:00
clock.o \
cluster.o \
fuse.o \
gpio.o \
heap.o \
hos.o \
i2c.o \
kfuse.o \
lz.o \
2018-06-24 20:42:46 +01:00
bq24193.o \
2018-05-01 06:15:48 +01:00
max7762x.o \
2018-06-24 20:42:46 +01:00
max17050.o \
2018-05-01 06:15:48 +01:00
mc.o \
nx_emmc.o \
sdmmc.o \
sdmmc_driver.o \
sdram.o \
sdram_lp0.o \
tui.o \
util.o \
di.o \
gfx.o \
pinmux.o \
pkg1.o \
pkg2.o \
se.o \
tsec.o \
uart.o \
ini.o \
)
2018-06-23 04:30:57 +01:00
OBJS += $(addprefix $(BUILD)/, diskio.o ff.o ffunicode.o ffsystem.o)
2018-05-01 06:15:48 +01:00
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork
2018-06-27 22:21:05 +01:00
CUSTOMDEFINES := -DMENU_LOGO_ENABLE
2018-06-19 15:10:59 +01:00
CFLAGS = $(ARCH) -O2 -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -std=gnu11 -Wall $(CUSTOMDEFINES)
2018-05-01 06:15:48 +01:00
LDFLAGS = $(ARCH) -nostartfiles -lgcc -Wl,--nmagic,--gc-sections
.PHONY: all clean
2018-05-11 03:28:53 +01:00
all: $(TARGET).bin
2018-07-01 02:56:58 +01:00
@echo -n "Payload size is "
@wc -c < $(TARGET).bin
@echo "Max size is 126296 Bytes."
2018-05-01 06:15:48 +01:00
clean:
@rm -rf $(OBJS)
2018-05-11 03:28:53 +01:00
@rm -rf $(BUILD)
@rm -rf $(TARGET).bin
2018-05-01 06:15:48 +01:00
2018-05-11 03:28:53 +01:00
$(TARGET).bin: $(BUILD)/$(TARGET).elf
2018-05-01 06:15:48 +01:00
$(OBJCOPY) -S -O binary $< $@
$(BUILD)/$(TARGET).elf: $(OBJS)
$(CC) $(LDFLAGS) -T ipl/link.ld $^ -o $@
$(BUILD)/%.o: $(SOURCEDIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD)/%.o: $(SOURCEDIR)/%.S
2018-05-11 03:28:53 +01:00
@mkdir -p "$(BUILD)"
2018-05-01 06:15:48 +01:00
$(CC) $(CFLAGS) -c $< -o $@