testpico: 32x reset + other tests
[megadrive.git] / megaed-stop / Makefile
CommitLineData
d2bfad8a 1CROSS = m68k-elf-\r
2CC = $(CROSS)gcc\r
3AS = $(CROSS)as\r
4LD = $(CROSS)ld\r
5OBJCOPY = $(CROSS)objcopy\r
6\r
7ASFLAGS += -m68000 --register-prefix-optional --bitwise-or -pic\r
8ASFLAGS_CC += -Wa,-m68000 -Wa,--register-prefix-optional -Wa,--bitwise-or -Wa,-pic\r
9CFLAGS += -Wall -g -O1 -m68000 -fomit-frame-pointer\r
10LDLIBS += $(shell $(CC) -print-file-name=libgcc.a)\r
11\r
12TARGET = megaed_stop\r
13OBJS = sega_gcc.o main.o\r
14\r
15all: $(TARGET).bin\r
16\r
17$(TARGET).elf: $(OBJS)\r
18 $(LD) -o $@ -Ted_app.ld -Map $(TARGET).map $^ $(LDLIBS)\r
19\r
20$(TARGET)_e.bin: $(TARGET).bin\r
21 dd if=/dev/zero of=$@ bs=1M count=1\r
22 dd if=$^ of=$@ bs=1M seek=1\r
23 dd if=$^ of=$@ conv=notrunc\r
24\r
25clean:\r
26 $(RM) $(TARGET).bin $(OBJS) $(TARGET).elf $(TARGET).map\r
27\r
28\r
29%.bin: %.elf\r
30 $(OBJCOPY) -I elf32-m68k -O binary $^ $@\r
31\r
32%.o: %.S\r
33 $(CC) -c -o $@ $^ $(ASFLAGS_CC)\r
34\r
35rel: $(TARGET).bin\r
36 mkdir -p /tmp/$(TARGET)/src/\r
37 cp $^ /tmp/$(TARGET)/\r
38 $(MAKE) clean\r
39 cp -a * /tmp/$(TARGET)/src/\r