- Massive set of cleanups/fixes for romcc. Lots of corner cases now work
[coreboot.git] / util / romcc / Makefile
1 VERSION:=0.33
2 RELEASE_DATE:=1 July 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         simple_test48.c \
71         simple_test49.c \
72         simple_test50.c \
73         simple_test51.c \
74         simple_test52.c \
75         simple_test53.c \
76         simple_test54.c \
77         raminit_test.c \
78         raminit_test2.c \
79         raminit_test3.c \
80         raminit_test4.c \
81         raminit_test5.c
82
83 FAIL_TESTS = \
84         fail_test1.c
85
86 TEST_SRCS:=$(patsubst %, tests/%, $(TESTS))
87 TEST_ASM:=$(patsubst %.c, tests/%.S, $(TESTS))
88 TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS))
89 TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS))
90
91 FAIL_SRCS:=$(patsubst %, tests/%, $(FAIL_TESTS))
92 FAIL_OUT:=$(patsubst %.c, tests/%.out, $(FAIL_TESTS))
93
94
95 $(TEST_ASM): %.S: %.c romcc
96         export ALLOC_CHECK_=2; ./romcc -O -mcpu=k8 -o $@ $< > $*.debug
97
98 $(FAIL_OUT): %.out: %.c romcc
99         export ALLOC_CHECK_=2; if ./romcc -O -o $*.S $< > $*.debug 2> $@ ; then exit 1 ; else exit 0 ; fi
100
101 $(TEST_OBJ): %.o: %.S
102         as $< -o $@
103
104 $(TEST_ELF): %.elf: %.o tests/ldscript.ld
105         ld -T tests/ldscript.ld $< -o $@
106
107 test: $(TEST_ELF) $(FAIL_OUT)
108
109 echo:
110         echo "TEST_SRCS=$(TEST_SRCS)"
111         echo "TEST_ASM=$(TEST_ASM)"
112         echo "TEST_OBJ=$(TEST_OBJ)"
113         echo "TEST_ELF=$(TEST_ELF)"
114         echo ""
115         echo "FAIL_SRCS=$(FAIL_SRCS)"
116         echo "FAIL_ASM=$(FAIL_ASM)"
117
118 clean:
119         rm -f romcc romcc_pg core $(TEST_ASM) $(TEST_OBJ) $(TEST_ELF) tests/*.debug tests/*.debug2 tests/*.gmon.out tests/*.out
120