-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
40 lines (27 loc) · 962 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
include starlet.mk
CFLAGS = -fpic -mbig-endian -mthumb -march=armv5t -mthumb-interwork -fomit-frame-pointer -Os
LDFLAGS += -fpic -mbig-endian -mthumb -march=armv5t -mthumb-interwork -fomit-frame-pointer
LDSCRIPT = babelfish.ld
LIBS = -lgcc
TARGET = babelfish.elf
TARGET_BIN = babelfish.bin
DATA = vectors.bin.o
OBJS = start.o babelfish.o utils.o gecko.o memory.o memory_asm.o $(DATA)
include common.mk
all: $(TARGET_BIN)
babelfish.o: babelfish.c vectors.bin.o
%.bin.o: %.bin
@$(bin2o)
# vectors contains our SWI replacement that outputs debug stuff over USBGecko
vectors.bin: vectors.elf
$(OBJCOPY) -O binary vectors.elf vectors.bin
vectors.elf: vectors.o
$(LD) -EB -Ttext=0 -o vectors.elf vectors.o
vectors.o: vectors.s
$(AS) -o vectors.o vectors.s
$(TARGET_BIN): $(TARGET)
@echo " OBJCPY $@"
@$(OBJCOPY) -O binary $< $@
clean: myclean
myclean:
-rm -f $(TARGET_BIN) vectors.elf vectors.bin vectors_bin.h vectors.o babelfish.map