Search
lxdream.org :: lxdream/test/Makefile
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 (14 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
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@185
    69
	$(RUNTEST) testta < testta.data
nkeynes@185
    70
nkeynes@185
    71
build-tests: testmath testide testta
nkeynes@185
    72
nkeynes@185
    73
testide: crt0.so testide.so ide.so
nkeynes@185
    74
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@185
    75
nkeynes@185
    76
testmath: crt0.so $(SHARED_OBJECTS) testmath.so math.so
nkeynes@185
    77
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@185
    78
nkeynes@185
    79
testta: crt0.so $(SHARED_OBJECTS) testta.so pvr.so dmac.so asic.so lib.so testdata.so
nkeynes@185
    80
	$(SH4CC) $(SH4LDFLAGS) $^  -o $@ $(SH4LIBS)
nkeynes@185
    81
	$(SH4OBJCOPY) testta testta.bin
nkeynes@185
    82
nkeynes@185
    83
readdata: crt0.so readdata.so
nkeynes@185
    84
	$(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
nkeynes@185
    85
nkeynes@185
    86
.PHONY : clean
nkeynes@185
    87
clean:
nkeynes@185
    88
	rm -f *.o *.so *.ao *.ac *.bin mapleid ide readmem dumpasic
nkeynes@185
    89
.