jacking/Makefile

31 lines
690 B
Makefile

CC = arm-none-eabi-gcc
CGENFLAGS = -mcpu=arm926ej-s -mthumb-interwork -fno-pie
WARN = -Wall -Wextra -Werror
OPTIMIZE = -g -Og
INCLUDE = -I.
GENDEP = -MMD -MP
DEFS = -DPLL_FBDIV=20
CFLAGS = -std=gnu17 $(CGENFLAGS) $(WARN) $(OPTIMIZE) $(INCLUDE) $(GENDEP) $(DEFS)
LDFLAGS = -static -nostartfiles -T bsp/fx3.ld -Wl,-z,max-page-size=4096,-Map,$(basename $@).map
VPATH = bsp
OBJS = main.o usb.o gpif.o gctl.o gpio.o uart.o util.o dma.o irq.o cache.o vectors.o
all : jazelle.img
jazelle.img: jazelle.elf
python3 elf2img.py $< $@
clean :
rm -f jazelle.img jazelle.elf jazelle.map $(OBJS) $(OBJS:.o=.d)
jazelle.elf : $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
-include $(OBJS:.o=.d)