Search
lxdream.org :: lxdream/test/Makefile
lxdream 0.9.1
released Jun 29
Download Now
filename test/Makefile
changeset 190:f7653df5e832
prev185:6755a04c447f
next213:da6b1904f67b
author nkeynes
date Sat Aug 05 00:18:21 2006 +0000 (16 years ago)
permissions -rw-r--r--
last change Add error lines to tests with incomplete polys
Split clip tests to separate data file
Add tests for cmd bit 23 ("use list size field")
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@190
    72
build-tests: testmath testide testta testregs
nkeynes@185
    73
nkeynes@185
    74
testide: crt0.so testide.so ide.so
nkeynes@185
    75
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@185
    76
nkeynes@185
    77
testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so
nkeynes@185
    78
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@185
    79
nkeynes@190
    80
testregs: crt0.so $(SHARED_OBJECTS) testregs.so
nkeynes@190
    81
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@190
    82
	$(SH4OBJCOPY) testregs testregs.bin
nkeynes@190
    83
nkeynes@185
    84
testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so
nkeynes@185
    85
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@185
    86
	$(SH4OBJCOPY) testta testta.bin
nkeynes@185
    87
nkeynes@185
    88
readdata: crt0.so readdata.so
nkeynes@185
    89
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@185
    90
nkeynes@185
    91
.PHONY : clean
nkeynes@185
    92
clean:
nkeynes@185
    93
	rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic
nkeynes@185
    94
.