- Minor mod to reset16.inc to work with newer binutils hopefully this works with...
[coreboot.git] / util / romcc / Makefile
1 VERSION:=0.28
2 RELEASE_DATE:=16 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=-O -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         simple_test.c \
23         simple_test2.c \
24         simple_test3.c \
25         simple_test4.c \
26         simple_test5.c \
27         simple_test6.c \
28         simple_test7.c \
29         simple_test8.c \
30         simple_test9.c \
31         simple_test10.c \
32         simple_test11.c \
33         simple_test12.c \
34         simple_test13.c \
35         simple_test14.c \
36         simple_test15.c \
37         simple_test16.c \
38         simple_test17.c \
39         simple_test18.c \
40         simple_test19.c \
41         simple_test20.c \
42         simple_test21.c \
43         simple_test22.c \
44         simple_test23.c \
45         simple_test24.c \
46         simple_test25.c \
47         simple_test26.c \
48         simple_test27.c \
49         simple_test28.c \
50         simple_test29.c \
51         simple_test30.c \
52         simple_test31.c \
53         simple_test32.c \
54         raminit_test.c \
55         raminit_test2.c \
56         raminit_test3.c \
57         raminit_test4.c
58
59 TEST_SRCS:=$(patsubst %, tests/%, $(TESTS))
60 TEST_ASM:=$(patsubst %.c, tests/%.S, $(TESTS))
61 TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS))
62 TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS))
63
64 $(TEST_ASM): %.S: %.c romcc
65         export ALLOC_CHECK_=2; ./romcc -O -o $@ $< > $*.debug
66
67 $(TEST_OBJ): %.o: %.S
68         as $< -o $@
69
70 $(TEST_ELF): %.elf: %.o tests/ldscript.ld
71         ld -T tests/ldscript.ld $< -o $@
72
73 test: $(TEST_ELF)
74
75 echo:
76         echo "TEST_SRCS=$(TEST_SRCS)"
77         echo "TEST_ASM=$(TEST_ASM)"
78         echo "TEST_OBJ=$(TEST_OBJ)"
79         echo "TEST_ELF=$(TEST_ELF)"
80
81 clean:
82         rm -f romcc romcc_pg core $(TEST_ASM) $(TEST_OBJ) $(TEST_ELF) tests/*.debug tests/*.debug2 tests/*.gmon.out
83