Search
lxdream.org :: lxdream/test/Makefile
lxdream 0.9.1
released Jun 29
Download Now
filename test/Makefile
changeset 344:bac957de4843
prev297:26fc4446ac09
next357:3592a10b3242
author nkeynes
date Wed Jan 31 11:01:36 2007 +0000 (17 years ago)
permissions -rw-r--r--
last change use ide.c in testregs
view annotate diff log raw
     1 # host compiler and flags
     2 HOSTCC		= gcc
     3 HOSTCFLAGS	= -O2
     4 SH4CC		= sh-elf-gcc
     5 SH4INC          = -Iinclude
     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
     9 SH4LD		= sh-elf-ld
    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
    14 ARMCC		= arm-elf-gcc
    15 ARMCFLAGS	= -O2
    16 ARMLD		= arm-elf-ld
    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
    24 # cygwin
    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
    30 SHARED_OBJECTS	=
    32 %.ao: %.c
    33 	$(ARMCC) $(ARMCFLAGS) -o $@ -c $< 
    35 %.ao: %.s
    36 	$(ARMCC) $(ARMCFLAGS) -o $@ -c $< 
    38 %.so: %.c
    39 	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
    41 %.so: %.ac
    42 	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
    44 %.so: %.s
    45 	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
    47 %.so: %.S
    48 	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
    50 %.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
    57 %.bin: %.arm
    58 	$(ARMOBJCOPY) -O binary $< $@
    60 %.aso: %.bin bin2c
    61 	./bin2c $< $<.c
    62 	$(SH4CC) $(SH4CFLAGS) -o $@ -c $<.c
    64 all: build-tests
    66 test: build-tests
    67 	$(RUNTEST) testmath
    68 	$(RUNTEST) testide -d ../disc/test.nrg
    69 	$(RUNTEST) testta < testta.data < testta2.data < testta3.data < testta4.data < testta5.data
    70 	$(RUNTEST) testregs
    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 \
    77 	 sh4/excslot.so sh4/undef.so
    78 	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
    79 	$(SH4OBJCOPY) testsh4 testsh4.bin
    81 testide: crt0.so testide.so ide.so lib.so testdata.so
    82 	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
    83 	$(SH4OBJCOPY) testide testide.bin
    85 testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so
    86 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
    88 testregs: crt0.so $(SHARED_OBJECTS) testregs.so ide.so
    89 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
    90 	$(SH4OBJCOPY) testregs testregs.bin
    92 testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so
    93 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
    94 	$(SH4OBJCOPY) testta testta.bin
    96 testrend: crt0.so $(SHARED_OBJECTS) testrend.so pvr.so dmac.so asic.so lib.so testdata.so
    97 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
    98 	$(SH4OBJCOPY) testrend testrend.bin
   100 testblend: crt0.so $(SHARED_OBJECTS) testblend.so pvr.so dmac.so asic.so lib.so testdata.so
   101 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
   102 	$(SH4OBJCOPY) testblend testblend.bin
   104 testdisp: crt0.so $(SHARED_OBJECTS) testdisp.so pvr.so asic.so lib.so testdata.so timer.so
   105 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
   106 	$(SH4OBJCOPY) testdisp testdisp.bin
   108 testyuv: crt0.so $(SHARED_OBJECTS) testyuv.so pvr.so asic.so lib.so testdata.so timer.so dmac.so
   109 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
   110 	$(SH4OBJCOPY) testyuv testyuv.bin
   112 testspu: crt0.so $(SHARED_OBJECTS) testspu.so asic.so lib.so testdata.so timer.so dmac.so
   113 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
   114 	$(SH4OBJCOPY) testspu testspu.bin
   116 testg2: crt0.so $(SHARED_OBJECTS) testg2.so asic.so lib.so testdata.so timer.so dmac.so
   117 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
   118 	$(SH4OBJCOPY) testg2 testg2.bin
   120 readdata: crt0.so readdata.so
   121 	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
   123 rend: crt0.so rendload.so asic.so lib.so timer.so pvr.so
   124 	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
   125 	$(SH4OBJCOPY) rend rend.bin
   127 testFF10: crt0.so testFF10.so lib.so
   128 	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
   129 	$(SH4OBJCOPY) testFF10 testFF10.bin
   131 .PHONY : clean
   132 clean:
   133 	rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic
.