- Checking latest version of romcc
[coreboot.git] / util / romcc / Makefile
1 VERSION:=0.21
2 RELEASE_DATE:=7 April 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         raminit_test.c \
34         raminit_test2.c
35
36 TEST_SRCS:=$(patsubst %, tests/%, $(TESTS))
37 TEST_ASM:=$(patsubst %.c, tests/%.S, $(TESTS))
38 TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS))
39 TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS))
40
41 $(TEST_ASM): %.S: %.c romcc
42         export ALLOC_CHECK_=2; ./romcc -O $< > $@
43
44 $(TEST_OBJ): %.o: %.S
45         as $< -o $@
46
47 $(TEST_ELF): %.elf: %.o
48         ld -Ttext 0x1000 $< -o $@
49
50 test: $(TEST_ELF)
51
52 echo:
53         echo "TEST_SRCS=$(TEST_SRCS)"
54         echo "TEST_ASM=$(TEST_ASM)"
55         echo "TEST_OBJ=$(TEST_OBJ)"
56         echo "TEST_ELF=$(TEST_ELF)"
57
58 clean:
59         rm -f romcc core $(TEST_ASM) $(TEST_OBJ) $(TEST_ELF)
60