- Update romcc so that it more successfully spills registers to the xmm registers
[coreboot.git] / util / romcc / Makefile
1 VERSION:=0.32
2 RELEASE_DATE:=28 June 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= -g -Wall $(CPPFLAGS)
10 CPROF_FLAGS=-pg -fprofile-arcs
11
12 all: romcc test
13
14 romcc: romcc.c Makefile
15         $(CC) $(CFLAGS) -o $@ $<
16
17 romcc_pg: romcc.c Makefile
18         $(CC) $(CFLAGS) $(CPROF_FLAGS) -o $@ $<
19
20 TESTS=\
21         hello_world.c \
22         hello_world2.c \
23         simple_test.c \
24         simple_test2.c \
25         simple_test3.c \
26         simple_test4.c \
27         simple_test5.c \
28         simple_test6.c \
29         simple_test7.c \
30         simple_test8.c \
31         simple_test9.c \
32         simple_test10.c \
33         simple_test11.c \
34         simple_test12.c \
35         simple_test13.c \
36         simple_test14.c \
37         simple_test15.c \
38         simple_test16.c \
39         simple_test17.c \
40         simple_test18.c \
41         simple_test19.c \
42         simple_test20.c \
43         simple_test21.c \
44         simple_test22.c \
45         simple_test23.c \
46         simple_test24.c \
47         simple_test25.c \
48         simple_test26.c \
49         simple_test27.c \
50         simple_test28.c \
51         simple_test29.c \
52         simple_test30.c \
53         simple_test31.c \
54         simple_test32.c \
55         simple_test33.c \
56         simple_test34.c \
57         simple_test35.c \
58         simple_test36.c \
59         simple_test37.c \
60         simple_test38.c \
61         simple_test39.c \
62         simple_test40.c \
63         simple_test41.c \
64         simple_test42.c \
65         simple_test43.c \
66         simple_test44.c \
67         simple_test45.c \
68         simple_test46.c \
69         simple_test47.c \
70         raminit_test.c \
71         raminit_test2.c \
72         raminit_test3.c \
73         raminit_test4.c
74
75 FAIL_TESTS = \
76         fail_test1.c
77
78 TEST_SRCS:=$(patsubst %, tests/%, $(TESTS))
79 TEST_ASM:=$(patsubst %.c, tests/%.S, $(TESTS))
80 TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS))
81 TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS))
82
83 FAIL_SRCS:=$(patsubst %, tests/%, $(FAIL_TESTS))
84 FAIL_OUT:=$(patsubst %.c, tests/%.out, $(FAIL_TESTS))
85
86
87 $(TEST_ASM): %.S: %.c romcc
88         export ALLOC_CHECK_=2; ./romcc -mcpu=k8 -O -o $@ $< > $*.debug
89
90 $(FAIL_OUT): %.out: %.c romcc
91         export ALLOC_CHECK_=2; if ./romcc -O -o $*.S $< > $*.debug 2> $@ ; then exit 1 ; else exit 0 ; fi
92
93 $(TEST_OBJ): %.o: %.S
94         as $< -o $@
95
96 $(TEST_ELF): %.elf: %.o tests/ldscript.ld
97         ld -T tests/ldscript.ld $< -o $@
98
99 test: $(TEST_ELF)
100
101 echo:
102         echo "TEST_SRCS=$(TEST_SRCS)"
103         echo "TEST_ASM=$(TEST_ASM)"
104         echo "TEST_OBJ=$(TEST_OBJ)"
105         echo "TEST_ELF=$(TEST_ELF)"
106         echo ""
107         echo "FAIL_SRCS=$(FAIL_SRCS)"
108         echo "FAIL_ASM=$(FAIL_ASM)"
109
110 clean:
111         rm -f romcc romcc_pg core $(TEST_ASM) $(TEST_OBJ) $(TEST_ELF) tests/*.debug tests/*.debug2 tests/*.gmon.out tests/*.out
112