- Error on function prototypes
[coreboot.git] / util / romcc / Makefile
1 VERSION:=0.31
2 RELEASE_DATE:=25 June 2003
3 PACKAGE:=romcc
4
5
6 # Move the configuration defines to makefile.conf
7 CC=gcc-2.95
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         raminit_test.c \
63         raminit_test2.c \
64         raminit_test3.c \
65         raminit_test4.c
66
67 TEST_SRCS:=$(patsubst %, tests/%, $(TESTS))
68 TEST_ASM:=$(patsubst %.c, tests/%.S, $(TESTS))
69 TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS))
70 TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS))
71
72 $(TEST_ASM): %.S: %.c romcc
73         export ALLOC_CHECK_=2; ./romcc -O -o $@ $< > $*.debug
74
75 $(TEST_OBJ): %.o: %.S
76         as $< -o $@
77
78 $(TEST_ELF): %.elf: %.o tests/ldscript.ld
79         ld -T tests/ldscript.ld $< -o $@
80
81 test: $(TEST_ELF)
82
83 echo:
84         echo "TEST_SRCS=$(TEST_SRCS)"
85         echo "TEST_ASM=$(TEST_ASM)"
86         echo "TEST_OBJ=$(TEST_OBJ)"
87         echo "TEST_ELF=$(TEST_ELF)"
88
89 clean:
90         rm -f romcc romcc_pg core $(TEST_ASM) $(TEST_OBJ) $(TEST_ELF) tests/*.debug tests/*.debug2 tests/*.gmon.out
91