-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (27 loc) · 883 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
TOOLCHAIN = m68k-linux-gnu
AS = $(TOOLCHAIN)-as
LD = $(TOOLCHAIN)-ld
GCC = $(TOOLCHAIN)-gcc
LIBS = -L/usr/lib/gcc-cross/m68k-linux-gnu/8/ -lgcc
OBJCOPY = $(TOOLCHAIN)-objcopy
FLASHER = ./tools/flasher
BIN = monitor.bin
OBJS = main.o exceptions.o constants.o commands.o serial.o strings.o parser.o keyboard.o \
ide.o misc.o i2c.o ticks.o memtest.o \
ne2k.o printer.o mandlebrot.o draw.o \
asm-wrapper.o mini-printf.o string.o linux.o
all: $(BIN)
%.o: %.s
$(AS) -mcpu=68030 -m68881 --fatal-warnings $< -o $@
%.o: %.c
$(GCC) -std=c99 -O0 -mstrict-align -fomit-frame-pointer -ffreestanding -Iinclude -Wall -mcpu=68030 -m68881 -c $< -o $@
monitor.elf: $(OBJS)
$(LD) -T linker.scr $^ $(LIBS) -o $@
%.bin: %.elf
$(OBJCOPY) -O binary $< [email protected]
dd [email protected] of=$@ ibs=8192 obs=8192 conv=sync
rm -f [email protected]
flash:
$(FLASHER) -s /dev/ttyUSB0 -f $(BIN)
clean:
rm -f *.o *.elf *.bin