Search
lxdream.org :: lxdream/test/Makefile
lxdream 0.9.1
released Jun 29
Download Now
filename test/Makefile
changeset 357:3592a10b3242
prev344:bac957de4843
next358:65043a8f5785
author nkeynes
date Tue Feb 13 08:34:27 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add tests for FLOAT and FTRC
Comment out user-mode exception test (broken)
file annotate diff log raw
nkeynes@185
     1
# host compiler and flags
nkeynes@185
     2
HOSTCC		= gcc
nkeynes@185
     3
HOSTCFLAGS	= -O2
nkeynes@185
     4
SH4CC		= sh-elf-gcc
nkeynes@185
     5
SH4INC          = -Iinclude
nkeynes@185
     6
SH4CFLAGS	= $(SH4INC) -D_arch_dreamcast -D_arch_sub_pristine \
nkeynes@185
     7
                  -O2 -fno-builtin -fno-strict-aliasing -ml -m4-single-only \
nkeynes@185
     8
                  -fno-optimize-sibling-calls
nkeynes@185
     9
SH4LD		= sh-elf-ld
nkeynes@185
    10
SH4LDFLAGS      = -fno-builtin -fno-strict-aliasing  -ml -m4-single-only \
nkeynes@185
    11
                  -Wl,-Tdc.x -nostartfiles -nostdlib -Llib
nkeynes@185
    12
SH4LIBS         = -Wl,--start-group -lc -lgcc -lm -Wl,--end-group
nkeynes@185
    13
SH4OBJCOPY      = sh-elf-objcopy -O binary
nkeynes@185
    14
ARMCC		= arm-elf-gcc
nkeynes@185
    15
ARMCFLAGS	= -O2
nkeynes@185
    16
ARMLD		= arm-elf-ld
nkeynes@185
    17
ARMOBJCOPY	= arm-elf-objcopy
nkeynes@185
    18
nkeynes@185
    19
BFDLIB		= -L/usr/local/sh-elf-bfd/lib -lbfd -liberty
nkeynes@185
    20
BFDINCLUDE	= /usr/local/sh-elf-bfd/include
nkeynes@185
    21
RUNTEST		= ../src/lxdream -c ./lxdream.rc -h -q -p
nkeynes@185
    22
nkeynes@185
    23
nkeynes@185
    24
# cygwin
nkeynes@185
    25
# these must point to your sh-elf bfd, not the system one
nkeynes@185
    26
#BFDLIB		= -L/usr/local/lib -lbfd -liberty -lintl
nkeynes@185
    27
#BFDINCLUDE	= /usr/local/include
nkeynes@185
    28
nkeynes@185
    29
#SHARED_OBJECTS	= crt0.so dcload-syscall.so dcload-syscalls.so memcpy.so lib.so
nkeynes@185
    30
SHARED_OBJECTS	=
nkeynes@185
    31
nkeynes@185
    32
%.ao: %.c
nkeynes@185
    33
	$(ARMCC) $(ARMCFLAGS) -o $@ -c $< 
nkeynes@185
    34
nkeynes@185
    35
%.ao: %.s
nkeynes@185
    36
	$(ARMCC) $(ARMCFLAGS) -o $@ -c $< 
nkeynes@185
    37
nkeynes@185
    38
%.so: %.c
nkeynes@185
    39
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
nkeynes@185
    40
nkeynes@185
    41
%.so: %.ac
nkeynes@185
    42
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
nkeynes@185
    43
nkeynes@185
    44
%.so: %.s
nkeynes@185
    45
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
nkeynes@185
    46
nkeynes@185
    47
%.so: %.S
nkeynes@185
    48
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $< 
nkeynes@185
    49
nkeynes@185
    50
%.o: %.c
nkeynes@185
    51
	$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
nkeynes@185
    52
nkeynes@185
    53
%.arm: %.ao arm_crt0.ao
nkeynes@185
    54
	$(ARMCC) -Wl,-Ttext,0x00000000 -nostartfiles -nostdlib -e reset -o $@ arm_crt0.ao $< -lgcc
nkeynes@185
    55
nkeynes@185
    56
nkeynes@185
    57
%.bin: %.arm
nkeynes@185
    58
	$(ARMOBJCOPY) -O binary $< $@
nkeynes@185
    59
nkeynes@185
    60
%.aso: %.bin bin2c
nkeynes@185
    61
	./bin2c $< $<.c
nkeynes@185
    62
	$(SH4CC) $(SH4CFLAGS) -o $@ -c $<.c
nkeynes@185
    63
nkeynes@185
    64
all: build-tests
nkeynes@185
    65
nkeynes@185
    66
test: build-tests
nkeynes@185
    67
	$(RUNTEST) testmath
nkeynes@185
    68
	$(RUNTEST) testide -d ../disc/test.nrg
nkeynes@190
    69
	$(RUNTEST) testta < testta.data < testta2.data < testta3.data < testta4.data < testta5.data
nkeynes@190
    70
	$(RUNTEST) testregs
nkeynes@185
    71
nkeynes@278
    72
build-tests: testsh4 testmath testide testta testregs testrend testdisp testspu
nkeynes@185
    73
nkeynes@230
    74
testsh4: crt0.so sh4/testsh4.so timer.so interrupt.so \
nkeynes@228
    75
	 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \
nkeynes@231
    76
	 sh4/bf.so sh4/bt.so sh4/cmp.so \
nkeynes@357
    77
	 sh4/float.so sh4/ftrc.so \
nkeynes@233
    78
	 sh4/excslot.so sh4/undef.so
nkeynes@225
    79
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@230
    80
	$(SH4OBJCOPY) testsh4 testsh4.bin
nkeynes@225
    81
nkeynes@263
    82
testide: crt0.so testide.so ide.so lib.so testdata.so
nkeynes@185
    83
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@230
    84
	$(SH4OBJCOPY) testide testide.bin
nkeynes@185
    85
nkeynes@185
    86
testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so
nkeynes@185
    87
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@185
    88
nkeynes@344
    89
testregs: crt0.so $(SHARED_OBJECTS) testregs.so ide.so
nkeynes@190
    90
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@190
    91
	$(SH4OBJCOPY) testregs testregs.bin
nkeynes@190
    92
nkeynes@185
    93
testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so
nkeynes@185
    94
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@185
    95
	$(SH4OBJCOPY) testta testta.bin
nkeynes@185
    96
nkeynes@213
    97
testrend: crt0.so $(SHARED_OBJECTS) testrend.so pvr.so dmac.so asic.so lib.so testdata.so
nkeynes@213
    98
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@213
    99
	$(SH4OBJCOPY) testrend testrend.bin
nkeynes@213
   100
nkeynes@344
   101
testblend: crt0.so $(SHARED_OBJECTS) testblend.so pvr.so dmac.so asic.so lib.so testdata.so
nkeynes@344
   102
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@344
   103
	$(SH4OBJCOPY) testblend testblend.bin
nkeynes@344
   104
nkeynes@263
   105
testdisp: crt0.so $(SHARED_OBJECTS) testdisp.so pvr.so asic.so lib.so testdata.so timer.so
nkeynes@263
   106
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@263
   107
	$(SH4OBJCOPY) testdisp testdisp.bin
nkeynes@263
   108
nkeynes@278
   109
testyuv: crt0.so $(SHARED_OBJECTS) testyuv.so pvr.so asic.so lib.so testdata.so timer.so dmac.so
nkeynes@278
   110
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@278
   111
	$(SH4OBJCOPY) testyuv testyuv.bin
nkeynes@278
   112
nkeynes@278
   113
testspu: crt0.so $(SHARED_OBJECTS) testspu.so asic.so lib.so testdata.so timer.so dmac.so
nkeynes@278
   114
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@278
   115
	$(SH4OBJCOPY) testspu testspu.bin
nkeynes@278
   116
nkeynes@344
   117
testg2: crt0.so $(SHARED_OBJECTS) testg2.so asic.so lib.so testdata.so timer.so dmac.so
nkeynes@344
   118
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@344
   119
	$(SH4OBJCOPY) testg2 testg2.bin
nkeynes@344
   120
nkeynes@185
   121
readdata: crt0.so readdata.so
nkeynes@185
   122
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@185
   123
nkeynes@297
   124
rend: crt0.so rendload.so asic.so lib.so timer.so pvr.so
nkeynes@297
   125
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@297
   126
	$(SH4OBJCOPY) rend rend.bin
nkeynes@297
   127
nkeynes@344
   128
testFF10: crt0.so testFF10.so lib.so
nkeynes@344
   129
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@344
   130
	$(SH4OBJCOPY) testFF10 testFF10.bin
nkeynes@344
   131
nkeynes@185
   132
.PHONY : clean
nkeynes@185
   133
clean:
nkeynes@185
   134
	rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic
nkeynes@185
   135
.