-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
38 lines (28 loc) · 640 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
CROSS = arm-none-eabi-
ifneq (,$(wildcard $(DEVKITARM)/base_tools))
include $(DEVKITARM)/base_tools
endif
CC = $(CROSS)gcc
AS = $(CROSS)as
LD = $(CROSS)ld
OBJCOPY = $(CROSS)objcopy
SHASUM = sha1sum -c
.SECONDARY:
.PHONY: all bios9 bios7 compare clean
all: bios9 bios7
compare: bios9 bios7
$(SHASUM) bios.sha1
bios9: bios9.rom
bios7: bios7.rom
clean:
$(RM) -f bios{9,7}.{o,elf,rom}
bios9: IMAGE_SIZE = 0x1000
bios9: ASFLAGS = -march=armv5te
bios7: IMAGE_SIZE = 0x4000
bios7: ASFLAGS = -march=armv4t
%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
%.elf: %.o %.ld
$(LD) -T $*.ld -Map $*.map -o $@ $<
%.rom: %.elf
$(OBJCOPY) -O binary $< $@