1 # host compiler and flags
6 SH4CFLAGS = $(SH4INC) -D_arch_dreamcast -D_arch_sub_pristine \
7 -O2 -fno-builtin -fno-strict-aliasing -ml -m4-single-only \
8 -fno-optimize-sibling-calls
10 SH4LDFLAGS = -fno-builtin -fno-strict-aliasing -ml -m4-single-only \
11 -Wl,-Tdc.x -nostartfiles -nostdlib -Llib
12 SH4LIBS = -Wl,--start-group -lc -lgcc -lm -Wl,--end-group
13 SH4OBJCOPY = sh-elf-objcopy -O binary
17 ARMOBJCOPY = arm-elf-objcopy
19 BFDLIB = -L/usr/local/sh-elf-bfd/lib -lbfd -liberty
20 BFDINCLUDE = /usr/local/sh-elf-bfd/include
21 RUNTEST = ../src/lxdream -c ./lxdream.rc -h -q -p
25 # these must point to your sh-elf bfd, not the system one
26 #BFDLIB = -L/usr/local/lib -lbfd -liberty -lintl
27 #BFDINCLUDE = /usr/local/include
29 #SHARED_OBJECTS = crt0.so dcload-syscall.so dcload-syscalls.so memcpy.so lib.so
33 $(ARMCC) $(ARMCFLAGS) -o $@ -c $<
36 $(ARMCC) $(ARMCFLAGS) -o $@ -c $<
39 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
42 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
45 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
48 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
51 $(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
53 %.arm: %.ao arm_crt0.ao
54 $(ARMCC) -Wl,-Ttext,0x00000000 -nostartfiles -nostdlib -e reset -o $@ arm_crt0.ao $< -lgcc
58 $(ARMOBJCOPY) -O binary $< $@
62 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<.c
68 $(RUNTEST) testide -d ../disc/test.nrg
69 $(RUNTEST) testta < testta.data
71 build-tests: testmath testide testta
73 testide: crt0.so testide.so ide.so
74 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
76 testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so
77 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
79 testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so
80 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
81 $(SH4OBJCOPY) testta testta.bin
83 readdata: crt0.so readdata.so
84 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
88 rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic
.