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 < testta2.data < testta3.data < testta4.data < testta5.data
72 build-tests: testsh4 testmath testide testta testregs testrend testdisp testspu
74 testsh4: crt0.so sh4/testsh4.so timer.so interrupt.so \
75 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \
76 sh4/bf.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so sh4/div0.so \
77 sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so sh4/mac.s \
78 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \
79 sh4/tas.so sh4/xtrct.so \
80 sh4/excslot.so sh4/undef.so
81 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
82 $(SH4OBJCOPY) testsh4 testsh4.bin
84 testide: crt0.so testide.so ide.so lib.so testdata.so
85 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
86 $(SH4OBJCOPY) testide testide.bin
88 testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so
89 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
91 testregs: crt0.so $(SHARED_OBJECTS) testregs.so ide.so
92 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
93 $(SH4OBJCOPY) testregs testregs.bin
95 testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so
96 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
97 $(SH4OBJCOPY) testta testta.bin
99 testrend: crt0.so $(SHARED_OBJECTS) testrend.so pvr.so dmac.so asic.so lib.so testdata.so
100 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
101 $(SH4OBJCOPY) testrend testrend.bin
103 testblend: crt0.so $(SHARED_OBJECTS) testblend.so pvr.so dmac.so asic.so lib.so testdata.so
104 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
105 $(SH4OBJCOPY) testblend testblend.bin
107 testdisp: crt0.so $(SHARED_OBJECTS) testdisp.so pvr.so asic.so lib.so testdata.so timer.so
108 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
109 $(SH4OBJCOPY) testdisp testdisp.bin
111 testyuv: crt0.so $(SHARED_OBJECTS) testyuv.so pvr.so asic.so lib.so testdata.so timer.so dmac.so
112 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
113 $(SH4OBJCOPY) testyuv testyuv.bin
115 testspu: crt0.so $(SHARED_OBJECTS) testspu.so asic.so lib.so testdata.so timer.so dmac.so
116 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
117 $(SH4OBJCOPY) testspu testspu.bin
119 testg2: crt0.so $(SHARED_OBJECTS) testg2.so asic.so lib.so testdata.so timer.so dmac.so
120 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
121 $(SH4OBJCOPY) testg2 testg2.bin
123 readdata: crt0.so readdata.so
124 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
126 rend: crt0.so rendload.so asic.so lib.so timer.so pvr.so
127 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
128 $(SH4OBJCOPY) rend rend.bin
130 testFF10: crt0.so testFF10.so lib.so
131 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
132 $(SH4OBJCOPY) testFF10 testFF10.bin
136 rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic
.