2 RELEASE_DATE:=4 July 2003
6 # Move the configuration defines to makefile.conf
8 CPPFLAGS=-DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(RELEASE_DATE)"'
9 CFLAGS= -g -Wall $(CPPFLAGS)
10 CPROF_FLAGS=-pg -fprofile-arcs
14 romcc: romcc.c Makefile
15 $(CC) $(CFLAGS) -o $@ $<
17 romcc_pg: romcc.c Makefile
18 $(CC) $(CFLAGS) $(CPROF_FLAGS) -o $@ $<
89 TEST_SRCS:=$(patsubst %, tests/%, $(TESTS))
90 TEST_ASM:=$(patsubst %.c, tests/%.S, $(TESTS))
91 TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS))
92 TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS))
94 FAIL_SRCS:=$(patsubst %, tests/%, $(FAIL_TESTS))
95 FAIL_OUT:=$(patsubst %.c, tests/%.out, $(FAIL_TESTS))
98 $(TEST_ASM): %.S: %.c romcc
99 export ALLOC_CHECK_=2; ./romcc -O -mcpu=k8 -o $@ $< > $*.debug
101 $(FAIL_OUT): %.out: %.c romcc
102 export ALLOC_CHECK_=2; if ./romcc -O -o $*.S $< > $*.debug 2> $@ ; then exit 1 ; else exit 0 ; fi
104 $(TEST_OBJ): %.o: %.S
107 $(TEST_ELF): %.elf: %.o tests/ldscript.ld
108 ld -T tests/ldscript.ld $< -o $@
110 test: $(TEST_ELF) $(FAIL_OUT)
113 echo "TEST_SRCS=$(TEST_SRCS)"
114 echo "TEST_ASM=$(TEST_ASM)"
115 echo "TEST_OBJ=$(TEST_OBJ)"
116 echo "TEST_ELF=$(TEST_ELF)"
118 echo "FAIL_SRCS=$(FAIL_SRCS)"
119 echo "FAIL_ASM=$(FAIL_ASM)"
122 rm -f romcc romcc_pg core $(TEST_ASM) $(TEST_OBJ) $(TEST_ELF) tests/*.debug tests/*.debug2 tests/*.gmon.out tests/*.out