nkeynes@731: srcdir = @srcdir@ nkeynes@731: top_srcdir = @top_srcdir@ nkeynes@731: VPATH = @srcdir@ nkeynes@748: mkdir_p = @mkdir_p@ nkeynes@731: nkeynes@521: # host compiler and flags nkeynes@521: HOSTCC = @CC@ nkeynes@521: HOSTCFLAGS = @CFLAGS@ nkeynes@731: nkeynes@521: SH4CC = @SHCC@ nkeynes@731: SH4INC = -I$(srcdir)/include 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@731: -Wl,-T$(srcdir)/dc.x -nostartfiles -nostdlib -L$(srcdir)/lib nkeynes@521: SH4LIBS = -Wl,--start-group -lc -lgcc -lm -Wl,--end-group nkeynes@521: SH4OBJCOPY = @SHOBJCOPY@ -O binary nkeynes@731: nkeynes@521: ARMCC = @ARMCC@ nkeynes@521: ARMCFLAGS = -O2 nkeynes@521: ARMLD = @ARMLD@ nkeynes@521: ARMOBJCOPY = @ARMOBJCOPY@ nkeynes@521: nkeynes@731: RUNTEST = ../src/lxdream -c $(srcdir)/lxdream.rc -puH -A null nkeynes@731: RUNTESTX = ../src/lxdream -c $(srcdir)/lxdream.rc -xpuH -A null 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@746: $(SH4CC) $(SH4CFLAGS) -o $@ -c $< -Wa,-I$(srcdir) 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@680: all: nkeynes@521: nkeynes@521: check: build-tests nkeynes@521: $(RUNTEST) testsh4 nkeynes@586: $(RUNTESTX) testsh4 nkeynes@550: $(RUNTEST) testmmu nkeynes@521: $(RUNTEST) testregs nkeynes@586: 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@731: sh4/mac.so \ 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@586: 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@749: rm -f *.o *.so *.ao *.ac *.bin sh4/*.so mapleid ide readmem dumpasic \ nkeynes@749: testsh4 testta testdisp testregs testide testmath testmmu \ nkeynes@749: testrend testspu dcflash.rom nkeynes@521: nkeynes@712: distclean: clean nkeynes@712: rm -f Makefile nkeynes@748: nkeynes@748: install: nkeynes@748: nkeynes@748: installcheck: nkeynes@748: nkeynes@748: uninstall: nkeynes@748: nkeynes@748: DISTFILES = asic.c asic.h bin2c.c crt0.s dma.h dmac.c ide.c ide.h interrupt.s \ nkeynes@748: lib.c lib.h math.s pvr.c pvr.h rendload.c sh4/add.s sh4/addc.s \ nkeynes@748: sh4/addv.s sh4/and.s sh4/andi.s sh4/bf.s sh4/bsr.s sh4/bt.s sh4/cmp.s \ nkeynes@748: sh4/cmpstr.s sh4/div0.s sh4/div1.s sh4/excslot.s sh4/float.s sh4/fmov.s \ nkeynes@748: sh4/ftrc.s sh4/inc.s sh4/mac.s sh4/rot.s sh4/shl.s sh4/shld.s sh4/sub.s \ nkeynes@748: sh4/subc.s sh4/tas.s sh4/testsh4.c sh4/tlb.s sh4/trapa.s sh4/undef.s \ nkeynes@748: sh4/xtrct.s testdata.c testdata.h testdisp.c testide.c testmath.c \ nkeynes@748: testmmu.c testregs.c testrend.c testspu.c testta.c testyuv.c timer.c timer.h \ nkeynes@748: dc.x lib/libc.a lib/libm.a lib/newlib-1.8.2-dc.patch \ nkeynes@748: include/_ansi.h include/_syslist.h include/ar.h include/assert.h include/ctype.h \ nkeynes@748: include/dirent.h include/errno.h include/fastmath.h include/fcntl.h include/grp.h \ nkeynes@748: include/ieeefp.h include/locale.h include/machine/fastmath.h include/machine/ieeefp.h \ nkeynes@748: include/machine/setjmp-dj.h include/machine/setjmp.h include/machine/time.h \ nkeynes@748: include/machine/types.h include/malloc.h include/math.h include/paths.h \ nkeynes@748: include/process.h include/pwd.h include/reent.h include/regdef.h include/setjmp.h \ nkeynes@748: include/signal.h include/stdio.h include/stdlib.h include/string.h include/sys/_types.h \ nkeynes@748: include/sys/config.h include/sys/dirent.h include/sys/errno.h include/sys/fcntl.h \ nkeynes@748: include/sys/file.h include/sys/param.h include/sys/reent.h include/sys/resource.h \ nkeynes@748: include/sys/signal.h include/sys/stat-dj.h include/sys/stat.h include/sys/time.h \ nkeynes@748: include/sys/timeb.h include/sys/times.h include/sys/types.h include/sys/unistd.h \ nkeynes@748: include/sys/utime.h include/sys/wait.h include/termios.h include/time.h \ nkeynes@748: include/unctrl.h include/unistd.h include/utime.h include/utmp.h nkeynes@748: nkeynes@748: nkeynes@748: nkeynes@748: distdir: nkeynes@748: $(mkdir_p) $(distdir)/sh4 $(distdir)/lib $(distdir)/include nkeynes@748: @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ nkeynes@748: topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ nkeynes@748: list='$(DISTFILES)'; for file in $$list; do \ nkeynes@748: case $$file in \ nkeynes@748: $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ nkeynes@748: $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ nkeynes@748: esac; \ nkeynes@748: if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ nkeynes@748: dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ nkeynes@748: if test "$$dir" != "$$file" && test "$$dir" != "."; then \ nkeynes@748: dir="/$$dir"; \ nkeynes@748: $(mkdir_p) "$(distdir)$$dir"; \ nkeynes@748: else \ nkeynes@748: dir=''; \ nkeynes@748: fi; \ nkeynes@748: if test -d $$d/$$file; then \ nkeynes@748: if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ nkeynes@748: cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ nkeynes@748: fi; \ nkeynes@748: cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ nkeynes@748: else \ nkeynes@748: test -f $(distdir)/$$file \ nkeynes@748: || cp -p $$d/$$file $(distdir)/$$file \ nkeynes@748: || exit 1; \ nkeynes@748: fi; \ nkeynes@748: done nkeynes@748: nkeynes@748: dvi: