Search
lxdream.org :: lxdream/test/Makefile :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/Makefile
changeset 185:6755a04c447f
next190:f7653df5e832
author nkeynes
date Tue Jul 11 01:35:27 2006 +0000 (13 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/Makefile Tue Jul 11 01:35:27 2006 +0000
1.3 @@ -0,0 +1,89 @@
1.4 +# host compiler and flags
1.5 +HOSTCC = gcc
1.6 +HOSTCFLAGS = -O2
1.7 +SH4CC = sh-elf-gcc
1.8 +SH4INC = -Iinclude
1.9 +SH4CFLAGS = $(SH4INC) -D_arch_dreamcast -D_arch_sub_pristine \
1.10 + -O2 -fno-builtin -fno-strict-aliasing -ml -m4-single-only \
1.11 + -fno-optimize-sibling-calls
1.12 +SH4LD = sh-elf-ld
1.13 +SH4LDFLAGS = -fno-builtin -fno-strict-aliasing -ml -m4-single-only \
1.14 + -Wl,-Tdc.x -nostartfiles -nostdlib -Llib
1.15 +SH4LIBS = -Wl,--start-group -lc -lgcc -lm -Wl,--end-group
1.16 +SH4OBJCOPY = sh-elf-objcopy -O binary
1.17 +ARMCC = arm-elf-gcc
1.18 +ARMCFLAGS = -O2
1.19 +ARMLD = arm-elf-ld
1.20 +ARMOBJCOPY = arm-elf-objcopy
1.21 +
1.22 +BFDLIB = -L/usr/local/sh-elf-bfd/lib -lbfd -liberty
1.23 +BFDINCLUDE = /usr/local/sh-elf-bfd/include
1.24 +RUNTEST = ../src/lxdream -c ./lxdream.rc -h -q -p
1.25 +
1.26 +
1.27 +# cygwin
1.28 +# these must point to your sh-elf bfd, not the system one
1.29 +#BFDLIB = -L/usr/local/lib -lbfd -liberty -lintl
1.30 +#BFDINCLUDE = /usr/local/include
1.31 +
1.32 +#SHARED_OBJECTS = crt0.so dcload-syscall.so dcload-syscalls.so memcpy.so lib.so
1.33 +SHARED_OBJECTS =
1.34 +
1.35 +%.ao: %.c
1.36 + $(ARMCC) $(ARMCFLAGS) -o $@ -c $<
1.37 +
1.38 +%.ao: %.s
1.39 + $(ARMCC) $(ARMCFLAGS) -o $@ -c $<
1.40 +
1.41 +%.so: %.c
1.42 + $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
1.43 +
1.44 +%.so: %.ac
1.45 + $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
1.46 +
1.47 +%.so: %.s
1.48 + $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
1.49 +
1.50 +%.so: %.S
1.51 + $(SH4CC) $(SH4CFLAGS) -o $@ -c $<
1.52 +
1.53 +%.o: %.c
1.54 + $(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
1.55 +
1.56 +%.arm: %.ao arm_crt0.ao
1.57 + $(ARMCC) -Wl,-Ttext,0x00000000 -nostartfiles -nostdlib -e reset -o $@ arm_crt0.ao $< -lgcc
1.58 +
1.59 +
1.60 +%.bin: %.arm
1.61 + $(ARMOBJCOPY) -O binary $< $@
1.62 +
1.63 +%.aso: %.bin bin2c
1.64 + ./bin2c $< $<.c
1.65 + $(SH4CC) $(SH4CFLAGS) -o $@ -c $<.c
1.66 +
1.67 +all: build-tests
1.68 +
1.69 +test: build-tests
1.70 + $(RUNTEST) testmath
1.71 + $(RUNTEST) testide -d ../disc/test.nrg
1.72 + $(RUNTEST) testta < testta.data
1.73 +
1.74 +build-tests: testmath testide testta
1.75 +
1.76 +testide: crt0.so testide.so ide.so
1.77 + $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
1.78 +
1.79 +testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so
1.80 + $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
1.81 +
1.82 +testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so
1.83 + $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
1.84 + $(SH4OBJCOPY) testta testta.bin
1.85 +
1.86 +readdata: crt0.so readdata.so
1.87 + $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
1.88 +
1.89 +.PHONY : clean
1.90 +clean:
1.91 + rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic
1.92 +
.