Search
lxdream.org :: lxdream/test/Makefile.in
lxdream 0.9.1
released Jun 29
Download Now
filename test/Makefile.in
changeset 521:33d2d92784c7
next533:9764673fd4a5
author nkeynes
date Sat Nov 17 01:13:41 2007 +0000 (15 years ago)
permissions -rw-r--r--
last change Detect presence of SH4 + ARM cross-compilers, and disable the system tests if
we don't find the sh-elf environment.
Detect build host to see if we can make a working translator
file annotate diff log raw
nkeynes@521
     1
# host compiler and flags
nkeynes@521
     2
HOSTCC		= @CC@
nkeynes@521
     3
HOSTCFLAGS	= @CFLAGS@
nkeynes@521
     4
SH4CC		= @SHCC@
nkeynes@521
     5
SH4INC          = -Iinclude
nkeynes@521
     6
SH4CFLAGS	= $(SH4INC) -D_arch_dreamcast -D_arch_sub_pristine \
nkeynes@521
     7
                  -O2 -fno-builtin -fno-strict-aliasing -ml -m4-single-only \
nkeynes@521
     8
                  -fno-optimize-sibling-calls
nkeynes@521
     9
SH4LD		= @SHLD@
nkeynes@521
    10
SH4LDFLAGS      = -fno-builtin -fno-strict-aliasing  -ml -m4-single-only \
nkeynes@521
    11
                  -Wl,-Tdc.x -nostartfiles -nostdlib -Llib
nkeynes@521
    12
SH4LIBS         = -Wl,--start-group -lc -lgcc -lm -Wl,--end-group
nkeynes@521
    13
SH4OBJCOPY      = @SHOBJCOPY@ -O binary
nkeynes@521
    14
ARMCC		= @ARMCC@
nkeynes@521
    15
ARMCFLAGS	= -O2
nkeynes@521
    16
ARMLD		= @ARMLD@
nkeynes@521
    17
ARMOBJCOPY	= @ARMOBJCOPY@
nkeynes@521
    18
nkeynes@521
    19
RUNTEST		= ../src/lxdream -c ./lxdream.rc -puh
nkeynes@521
    20
nkeynes@521
    21
nkeynes@521
    22
# cygwin
nkeynes@521
    23
# these must point to your sh-elf bfd, not the system one
nkeynes@521
    24
#BFDLIB		= -L/usr/local/lib -lbfd -liberty -lintl
nkeynes@521
    25
#BFDINCLUDE	= /usr/local/include
nkeynes@521
    26
nkeynes@521
    27
#SHARED_OBJECTS	= crt0.so dcload-syscall.so dcload-syscalls.so memcpy.so lib.so
nkeynes@521
    28
SHARED_OBJECTS	=
nkeynes@521
    29
nkeynes@521
    30
%.ao: %.c
nkeynes@521
    31
	$(ARMCC) $(ARMCFLAGS) -o $@ -c $< 
nkeynes@521
    32
nkeynes@521
    33
%.ao: %.s
nkeynes@521
    34
	$(ARMCC) $(ARMCFLAGS) -o $@ -c $< 
nkeynes@521
    35
nkeynes@521
    36
%.so: %.c
nkeynes@521
    37
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
nkeynes@521
    38
nkeynes@521
    39
%.so: %.ac
nkeynes@521
    40
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
nkeynes@521
    41
nkeynes@521
    42
%.so: %.s
nkeynes@521
    43
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
nkeynes@521
    44
nkeynes@521
    45
%.so: %.S
nkeynes@521
    46
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
nkeynes@521
    47
nkeynes@521
    48
%.o: %.c
nkeynes@521
    49
	$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
nkeynes@521
    50
nkeynes@521
    51
%.arm: %.ao arm_crt0.ao
nkeynes@521
    52
	$(ARMCC) -Wl,-Ttext,0x00000000 -nostartfiles -nostdlib -e reset -o $@ arm_crt0.ao $< -lgcc
nkeynes@521
    53
nkeynes@521
    54
nkeynes@521
    55
%.bin: %.arm
nkeynes@521
    56
	$(ARMOBJCOPY) -O binary $< $@
nkeynes@521
    57
nkeynes@521
    58
%.aso: %.bin bin2c
nkeynes@521
    59
	./bin2c $< $<.c
nkeynes@521
    60
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $<.c
nkeynes@521
    61
nkeynes@521
    62
all: build-tests
nkeynes@521
    63
nkeynes@521
    64
check: build-tests
nkeynes@521
    65
	cat testta.data testta2.data testta3.data testta4.data testta5.data | $(RUNTEST) testta
nkeynes@521
    66
	$(RUNTEST) testsh4
nkeynes@521
    67
	$(RUNTEST) testregs
nkeynes@521
    68
	$(RUNTEST) testmath
nkeynes@521
    69
	$(RUNTEST) testide -d ../disc/test.nrg
nkeynes@521
    70
nkeynes@521
    71
nkeynes@521
    72
build-tests: testsh4 testmath testide testta testregs testrend testdisp testspu
nkeynes@521
    73
nkeynes@521
    74
testsh4: crt0.so sh4/testsh4.so timer.so interrupt.so \
nkeynes@521
    75
	 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \
nkeynes@521
    76
	 sh4/bf.so sh4/bsr.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so \
nkeynes@521
    77
	 sh4/div0.so sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so \
nkeynes@521
    78
	 sh4/mac.s \
nkeynes@521
    79
	 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \
nkeynes@521
    80
	 sh4/tas.so sh4/xtrct.so \
nkeynes@521
    81
	 sh4/excslot.so sh4/undef.so
nkeynes@521
    82
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@521
    83
	$(SH4OBJCOPY) testsh4 testsh4.bin
nkeynes@521
    84
nkeynes@521
    85
testide: crt0.so testide.so ide.so lib.so testdata.so
nkeynes@521
    86
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@521
    87
	$(SH4OBJCOPY) testide testide.bin
nkeynes@521
    88
nkeynes@521
    89
testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so
nkeynes@521
    90
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
    91
nkeynes@521
    92
testregs: crt0.so $(SHARED_OBJECTS) testregs.so ide.so
nkeynes@521
    93
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
    94
	$(SH4OBJCOPY) testregs testregs.bin
nkeynes@521
    95
nkeynes@521
    96
testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so
nkeynes@521
    97
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
    98
	$(SH4OBJCOPY) testta testta.bin
nkeynes@521
    99
nkeynes@521
   100
testrend: crt0.so $(SHARED_OBJECTS) testrend.so pvr.so dmac.so asic.so lib.so testdata.so
nkeynes@521
   101
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
   102
	$(SH4OBJCOPY) testrend testrend.bin
nkeynes@521
   103
nkeynes@521
   104
testblend: crt0.so $(SHARED_OBJECTS) testblend.so pvr.so dmac.so asic.so lib.so testdata.so
nkeynes@521
   105
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
   106
	$(SH4OBJCOPY) testblend testblend.bin
nkeynes@521
   107
nkeynes@521
   108
testdisp: crt0.so $(SHARED_OBJECTS) testdisp.so pvr.so asic.so lib.so testdata.so timer.so
nkeynes@521
   109
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
   110
	$(SH4OBJCOPY) testdisp testdisp.bin
nkeynes@521
   111
nkeynes@521
   112
testyuv: crt0.so $(SHARED_OBJECTS) testyuv.so pvr.so asic.so lib.so testdata.so timer.so dmac.so
nkeynes@521
   113
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
   114
	$(SH4OBJCOPY) testyuv testyuv.bin
nkeynes@521
   115
nkeynes@521
   116
testspu: crt0.so $(SHARED_OBJECTS) testspu.so asic.so lib.so testdata.so timer.so dmac.so
nkeynes@521
   117
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
   118
	$(SH4OBJCOPY) testspu testspu.bin
nkeynes@521
   119
nkeynes@521
   120
testg2: crt0.so $(SHARED_OBJECTS) testg2.so asic.so lib.so testdata.so timer.so dmac.so
nkeynes@521
   121
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
   122
	$(SH4OBJCOPY) testg2 testg2.bin
nkeynes@521
   123
nkeynes@521
   124
readdata: crt0.so readdata.so
nkeynes@521
   125
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@521
   126
nkeynes@521
   127
rend: crt0.so rendload.so asic.so lib.so timer.so pvr.so
nkeynes@521
   128
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@521
   129
	$(SH4OBJCOPY) rend rend.bin
nkeynes@521
   130
nkeynes@521
   131
testFF10: crt0.so testFF10.so lib.so
nkeynes@521
   132
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@521
   133
	$(SH4OBJCOPY) testFF10 testFF10.bin
nkeynes@521
   134
nkeynes@521
   135
.PHONY : clean
nkeynes@521
   136
clean:
nkeynes@521
   137
	rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic
nkeynes@521
   138
.