- Add a test to make certain romcc is properly allocating registers.
[coreboot.git] / util / romcc / Makefile
1 VERSION:=0.23
2 RELEASE_DATE:=08 May 2003
3 PACKAGE:=romcc
4
5
6 # Move the configuration defines to makefile.conf
7 CC=gcc
8 CPPFLAGS=-DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(RELEASE_DATE)"'
9 CFLAGS=-O -g -Wall $(CPPFLAGS)
10
11 all: romcc test
12
13 romcc: romcc.c Makefile
14         $(CC) $(CFLAGS) -o $@ $<
15
16 TESTS=\
17         hello_world.c \
18         simple_test.c \
19         simple_test2.c \
20         simple_test3.c \
21         simple_test4.c \
22         simple_test5.c \
23         simple_test6.c \
24         simple_test7.c \
25         simple_test8.c \
26         simple_test9.c \
27         simple_test10.c \
28         simple_test11.c \
29         simple_test12.c \
30         simple_test13.c \
31         simple_test14.c \
32         simple_test15.c \
33         simple_test16.c \
34         simple_test17.c \
35         simple_test18.c \
36         simple_test19.c \
37         simple_test20.c \
38         raminit_test.c \
39         raminit_test2.c
40
41 TEST_SRCS:=$(patsubst %, tests/%, $(TESTS))
42 TEST_ASM:=$(patsubst %.c, tests/%.S, $(TESTS))
43 TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS))
44 TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS))
45
46 $(TEST_ASM): %.S: %.c romcc
47         export ALLOC_CHECK_=2; ./romcc -O $< > $@
48
49 $(TEST_OBJ): %.o: %.S
50         as $< -o $@
51
52 $(TEST_ELF): %.elf: %.o
53         ld -Ttext 0x1000 $< -o $@
54
55 test: $(TEST_ELF)
56
57 echo:
58         echo "TEST_SRCS=$(TEST_SRCS)"
59         echo "TEST_ASM=$(TEST_ASM)"
60         echo "TEST_OBJ=$(TEST_OBJ)"
61         echo "TEST_ELF=$(TEST_ELF)"
62
63 clean:
64         rm -f romcc core $(TEST_ASM) $(TEST_OBJ) $(TEST_ELF)
65