nkeynes@521: # host compiler and flags nkeynes@521: HOSTCC = @CC@ nkeynes@521: HOSTCFLAGS = @CFLAGS@ nkeynes@521: SH4CC = @SHCC@ nkeynes@521: SH4INC = -Iinclude nkeynes@521: SH4CFLAGS = $(SH4INC) -D_arch_dreamcast -D_arch_sub_pristine \ nkeynes@521: -O2 -fno-builtin -fno-strict-aliasing -ml -m4-single-only \ nkeynes@521: -fno-optimize-sibling-calls nkeynes@521: SH4LD = @SHLD@ nkeynes@521: SH4LDFLAGS = -fno-builtin -fno-strict-aliasing -ml -m4-single-only \ nkeynes@521: -Wl,-Tdc.x -nostartfiles -nostdlib -Llib nkeynes@521: SH4LIBS = -Wl,--start-group -lc -lgcc -lm -Wl,--end-group nkeynes@521: SH4OBJCOPY = @SHOBJCOPY@ -O binary nkeynes@521: ARMCC = @ARMCC@ nkeynes@521: ARMCFLAGS = -O2 nkeynes@521: ARMLD = @ARMLD@ nkeynes@521: ARMOBJCOPY = @ARMOBJCOPY@ nkeynes@521: nkeynes@550: RUNTEST = ../src/lxdream -c ./lxdream.rc -puh -A null nkeynes@579: RUNTESTX = ../src/lxdream -c ./lxdream.rc -xpuh -A null nkeynes@521: nkeynes@521: nkeynes@521: # cygwin nkeynes@521: # these must point to your sh-elf bfd, not the system one nkeynes@521: #BFDLIB = -L/usr/local/lib -lbfd -liberty -lintl nkeynes@521: #BFDINCLUDE = /usr/local/include nkeynes@521: nkeynes@521: #SHARED_OBJECTS = crt0.so dcload-syscall.so dcload-syscalls.so memcpy.so lib.so nkeynes@521: SHARED_OBJECTS = nkeynes@521: nkeynes@521: %.ao: %.c nkeynes@521: $(ARMCC) $(ARMCFLAGS) -o $@ -c $< nkeynes@521: nkeynes@521: %.ao: %.s nkeynes@521: $(ARMCC) $(ARMCFLAGS) -o $@ -c $< nkeynes@521: nkeynes@521: %.so: %.c nkeynes@521: $(SH4CC) $(SH4CFLAGS) -o $@ -c $< nkeynes@521: nkeynes@521: %.so: %.ac nkeynes@521: $(SH4CC) $(SH4CFLAGS) -o $@ -c $< nkeynes@521: nkeynes@521: %.so: %.s nkeynes@521: $(SH4CC) $(SH4CFLAGS) -o $@ -c $< nkeynes@521: nkeynes@521: %.so: %.S nkeynes@521: $(SH4CC) $(SH4CFLAGS) -o $@ -c $< nkeynes@521: nkeynes@521: %.o: %.c nkeynes@521: $(HOSTCC) $(HOSTCFLAGS) -o $@ -c $< nkeynes@521: nkeynes@521: %.arm: %.ao arm_crt0.ao nkeynes@521: $(ARMCC) -Wl,-Ttext,0x00000000 -nostartfiles -nostdlib -e reset -o $@ arm_crt0.ao $< -lgcc nkeynes@521: nkeynes@521: nkeynes@521: %.bin: %.arm nkeynes@521: $(ARMOBJCOPY) -O binary $< $@ nkeynes@521: nkeynes@521: %.aso: %.bin bin2c nkeynes@521: ./bin2c $< $<.c nkeynes@521: $(SH4CC) $(SH4CFLAGS) -o $@ -c $<.c nkeynes@521: nkeynes@521: all: build-tests nkeynes@521: nkeynes@521: check: build-tests nkeynes@521: $(RUNTEST) testsh4 nkeynes@579: $(RUNTESTX) testsh4 nkeynes@550: $(RUNTEST) testmmu nkeynes@521: $(RUNTEST) testregs nkeynes@579: cat testta.data testta2.data testta3.data testta4.data testta5.data | $(RUNTEST) testta nkeynes@550: # $(RUNTEST) testide -d ../disc/test.nrg nkeynes@521: nkeynes@521: nkeynes@550: build-tests: testsh4 testmath testide testta testregs testrend testdisp testspu testmmu nkeynes@521: nkeynes@521: testsh4: crt0.so sh4/testsh4.so timer.so interrupt.so \ nkeynes@521: sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \ nkeynes@521: sh4/bf.so sh4/bsr.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so \ nkeynes@521: sh4/div0.so sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so \ nkeynes@521: sh4/mac.s \ nkeynes@521: sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \ nkeynes@533: sh4/trapa.so sh4/tas.so sh4/xtrct.so \ nkeynes@555: sh4/excslot.so sh4/undef.so sh4/tlb.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testsh4 testsh4.bin nkeynes@521: nkeynes@521: testide: crt0.so testide.so ide.so lib.so testdata.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testide testide.bin nkeynes@521: nkeynes@550: testmmu: crt0.so testmmu.so lib.so nkeynes@550: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@550: $(SH4OBJCOPY) testmmu testmmu.bin nkeynes@550: nkeynes@521: testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: nkeynes@521: testregs: crt0.so $(SHARED_OBJECTS) testregs.so ide.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testregs testregs.bin nkeynes@521: nkeynes@521: testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testta testta.bin nkeynes@521: nkeynes@521: testrend: crt0.so $(SHARED_OBJECTS) testrend.so pvr.so dmac.so asic.so lib.so testdata.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testrend testrend.bin nkeynes@521: nkeynes@521: testblend: crt0.so $(SHARED_OBJECTS) testblend.so pvr.so dmac.so asic.so lib.so testdata.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testblend testblend.bin nkeynes@521: nkeynes@521: testdisp: crt0.so $(SHARED_OBJECTS) testdisp.so pvr.so asic.so lib.so testdata.so timer.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testdisp testdisp.bin nkeynes@521: nkeynes@521: testyuv: crt0.so $(SHARED_OBJECTS) testyuv.so pvr.so asic.so lib.so testdata.so timer.so dmac.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testyuv testyuv.bin nkeynes@521: nkeynes@521: testspu: crt0.so $(SHARED_OBJECTS) testspu.so asic.so lib.so testdata.so timer.so dmac.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testspu testspu.bin nkeynes@521: nkeynes@521: testg2: crt0.so $(SHARED_OBJECTS) testg2.so asic.so lib.so testdata.so timer.so dmac.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testg2 testg2.bin nkeynes@521: nkeynes@521: readdata: crt0.so readdata.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: nkeynes@521: rend: crt0.so rendload.so asic.so lib.so timer.so pvr.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) rend rend.bin nkeynes@521: nkeynes@521: testFF10: crt0.so testFF10.so lib.so nkeynes@521: $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS) nkeynes@521: $(SH4OBJCOPY) testFF10 testFF10.bin nkeynes@521: nkeynes@521: .PHONY : clean nkeynes@521: clean: nkeynes@521: rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic nkeynes@521: