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 = @SHOBJCOPY@ -O binary
17 ARMOBJCOPY = @ARMOBJCOPY@
19 RUNTEST = ../src/lxdream -c ./lxdream.rc -puH -A null
20 RUNTESTX = ../src/lxdream -c ./lxdream.rc -xpuH -A null
24 # these must point to your sh-elf bfd, not the system one
25 #BFDLIB = -L/usr/local/lib -lbfd -liberty -lintl
26 #BFDINCLUDE = /usr/local/include
28 #SHARED_OBJECTS = crt0.so dcload-syscall.so dcload-syscalls.so memcpy.so lib.so
32 $(ARMCC) $(ARMCFLAGS) -o $@ -c $<
35 $(ARMCC) $(ARMCFLAGS) -o $@ -c $<
38 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
41 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
44 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
47 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
50 $(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
52 %.arm: %.ao arm_crt0.ao
53 $(ARMCC) -Wl,-Ttext,0x00000000 -nostartfiles -nostdlib -e reset -o $@ arm_crt0.ao $< -lgcc
57 $(ARMOBJCOPY) -O binary $< $@
61 $(SH4CC) $(SH4CFLAGS) -o $@ -c $<.c
70 cat testta.data testta2.data testta3.data testta4.data testta5.data | $(RUNTEST) testta
71 # $(RUNTEST) testide -d ../disc/test.nrg
74 build-tests: testsh4 testmath testide testta testregs testrend testdisp testspu testmmu
76 testsh4: crt0.so sh4/testsh4.so timer.so interrupt.so \
77 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \
78 sh4/bf.so sh4/bsr.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so \
79 sh4/div0.so sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so \
81 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \
82 sh4/trapa.so sh4/tas.so sh4/xtrct.so \
83 sh4/excslot.so sh4/undef.so sh4/tlb.so
84 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
85 $(SH4OBJCOPY) testsh4 testsh4.bin
87 testide: crt0.so testide.so ide.so lib.so testdata.so
88 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
89 $(SH4OBJCOPY) testide testide.bin
91 testmmu: crt0.so testmmu.so lib.so
92 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
93 $(SH4OBJCOPY) testmmu testmmu.bin
95 testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so
96 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
98 testregs: crt0.so $(SHARED_OBJECTS) testregs.so ide.so
99 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
100 $(SH4OBJCOPY) testregs testregs.bin
102 testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so
103 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
104 $(SH4OBJCOPY) testta testta.bin
106 testrend: crt0.so $(SHARED_OBJECTS) testrend.so pvr.so dmac.so asic.so lib.so testdata.so
107 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
108 $(SH4OBJCOPY) testrend testrend.bin
110 testblend: crt0.so $(SHARED_OBJECTS) testblend.so pvr.so dmac.so asic.so lib.so testdata.so
111 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
112 $(SH4OBJCOPY) testblend testblend.bin
114 testdisp: crt0.so $(SHARED_OBJECTS) testdisp.so pvr.so asic.so lib.so testdata.so timer.so
115 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
116 $(SH4OBJCOPY) testdisp testdisp.bin
118 testyuv: crt0.so $(SHARED_OBJECTS) testyuv.so pvr.so asic.so lib.so testdata.so timer.so dmac.so
119 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
120 $(SH4OBJCOPY) testyuv testyuv.bin
122 testspu: crt0.so $(SHARED_OBJECTS) testspu.so asic.so lib.so testdata.so timer.so dmac.so
123 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
124 $(SH4OBJCOPY) testspu testspu.bin
126 testg2: crt0.so $(SHARED_OBJECTS) testg2.so asic.so lib.so testdata.so timer.so dmac.so
127 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
128 $(SH4OBJCOPY) testg2 testg2.bin
130 readdata: crt0.so readdata.so
131 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
133 rend: crt0.so rendload.so asic.so lib.so timer.so pvr.so
134 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
135 $(SH4OBJCOPY) rend rend.bin
137 testFF10: crt0.so testFF10.so lib.so
138 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
139 $(SH4OBJCOPY) testFF10 testFF10.bin
143 rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic
.