2003-10-22 06:03:46 +02:00
|
|
|
VERSION:=0.37
|
|
|
|
RELEASE_DATE:=21 October 2003
|
2003-04-22 20:44:01 +02:00
|
|
|
PACKAGE:=romcc
|
|
|
|
|
|
|
|
|
|
|
|
# Move the configuration defines to makefile.conf
|
2003-06-25 13:34:59 +02:00
|
|
|
CC=gcc
|
2003-04-22 20:44:01 +02:00
|
|
|
CPPFLAGS=-DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(RELEASE_DATE)"'
|
2003-06-19 17:14:52 +02:00
|
|
|
CFLAGS= -g -Wall $(CPPFLAGS)
|
2003-06-11 23:55:00 +02:00
|
|
|
CPROF_FLAGS=-pg -fprofile-arcs
|
2003-04-22 20:44:01 +02:00
|
|
|
|
|
|
|
all: romcc test
|
|
|
|
|
|
|
|
romcc: romcc.c Makefile
|
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
|
2003-06-11 23:55:00 +02:00
|
|
|
romcc_pg: romcc.c Makefile
|
|
|
|
$(CC) $(CFLAGS) $(CPROF_FLAGS) -o $@ $<
|
|
|
|
|
2003-10-11 08:20:25 +02:00
|
|
|
LINUX_TESTS=\
|
|
|
|
linux_test1.c \
|
|
|
|
linux_test2.c \
|
|
|
|
linux_test3.c \
|
|
|
|
linux_test4.c \
|
|
|
|
linux_test5.c \
|
|
|
|
linux_test6.c \
|
|
|
|
linux_test7.c \
|
2003-10-22 06:03:46 +02:00
|
|
|
linux_test8.c \
|
2003-10-11 08:20:25 +02:00
|
|
|
|
2003-04-22 20:44:01 +02:00
|
|
|
TESTS=\
|
|
|
|
hello_world.c \
|
2003-06-19 17:14:52 +02:00
|
|
|
hello_world2.c \
|
2003-04-22 20:44:01 +02:00
|
|
|
simple_test.c \
|
|
|
|
simple_test2.c \
|
|
|
|
simple_test3.c \
|
|
|
|
simple_test4.c \
|
|
|
|
simple_test5.c \
|
|
|
|
simple_test6.c \
|
|
|
|
simple_test7.c \
|
|
|
|
simple_test8.c \
|
|
|
|
simple_test9.c \
|
|
|
|
simple_test10.c \
|
|
|
|
simple_test11.c \
|
|
|
|
simple_test12.c \
|
|
|
|
simple_test13.c \
|
|
|
|
simple_test14.c \
|
|
|
|
simple_test15.c \
|
2003-05-09 04:39:00 +02:00
|
|
|
simple_test16.c \
|
|
|
|
simple_test17.c \
|
|
|
|
simple_test18.c \
|
|
|
|
simple_test19.c \
|
2003-05-13 22:45:19 +02:00
|
|
|
simple_test20.c \
|
2003-06-10 23:22:07 +02:00
|
|
|
simple_test21.c \
|
|
|
|
simple_test23.c \
|
|
|
|
simple_test24.c \
|
|
|
|
simple_test25.c \
|
|
|
|
simple_test26.c \
|
|
|
|
simple_test27.c \
|
|
|
|
simple_test28.c \
|
|
|
|
simple_test29.c \
|
2003-06-11 23:55:00 +02:00
|
|
|
simple_test31.c \
|
2003-06-17 10:42:17 +02:00
|
|
|
simple_test32.c \
|
2003-06-18 13:03:18 +02:00
|
|
|
simple_test33.c \
|
2003-06-19 17:14:52 +02:00
|
|
|
simple_test34.c \
|
|
|
|
simple_test35.c \
|
|
|
|
simple_test36.c \
|
|
|
|
simple_test37.c \
|
2003-06-28 08:49:45 +02:00
|
|
|
simple_test40.c \
|
|
|
|
simple_test41.c \
|
|
|
|
simple_test43.c \
|
|
|
|
simple_test45.c \
|
|
|
|
simple_test46.c \
|
|
|
|
simple_test47.c \
|
2003-07-01 12:05:30 +02:00
|
|
|
simple_test48.c \
|
|
|
|
simple_test49.c \
|
|
|
|
simple_test50.c \
|
|
|
|
simple_test51.c \
|
|
|
|
simple_test52.c \
|
|
|
|
simple_test53.c \
|
2003-07-04 17:14:04 +02:00
|
|
|
simple_test55.c \
|
|
|
|
simple_test56.c \
|
2003-10-11 08:20:25 +02:00
|
|
|
simple_test57.c \
|
|
|
|
simple_test58.c \
|
|
|
|
simple_test60.c \
|
|
|
|
simple_test61.c \
|
|
|
|
simple_test62.c \
|
|
|
|
simple_test63.c \
|
|
|
|
simple_test64.c \
|
|
|
|
simple_test65.c \
|
|
|
|
simple_test66.c \
|
|
|
|
simple_test67.c \
|
|
|
|
simple_test68.c \
|
2003-10-22 06:03:46 +02:00
|
|
|
simple_test69.c \
|
|
|
|
simple_test71.c \
|
|
|
|
simple_test72.c \
|
|
|
|
simple_test73.c \
|
2003-04-22 20:44:01 +02:00
|
|
|
raminit_test.c \
|
2003-06-10 23:22:07 +02:00
|
|
|
raminit_test2.c \
|
2003-06-16 18:57:34 +02:00
|
|
|
raminit_test3.c \
|
2003-07-01 12:05:30 +02:00
|
|
|
raminit_test4.c \
|
2003-10-11 08:20:25 +02:00
|
|
|
raminit_test5.c \
|
|
|
|
raminit_test6.c \
|
|
|
|
$(LINUX_TESTS)
|
2003-04-22 20:44:01 +02:00
|
|
|
|
2003-06-28 08:49:45 +02:00
|
|
|
FAIL_TESTS = \
|
2003-07-04 17:14:04 +02:00
|
|
|
fail_test1.c \
|
|
|
|
fail_test2.c \
|
2003-10-11 08:20:25 +02:00
|
|
|
fail_test3.c \
|
|
|
|
fail_test4.c \
|
|
|
|
fail_test5.c \
|
2003-06-28 08:49:45 +02:00
|
|
|
|
2003-04-22 20:44:01 +02:00
|
|
|
TEST_SRCS:=$(patsubst %, tests/%, $(TESTS))
|
|
|
|
TEST_ASM:=$(patsubst %.c, tests/%.S, $(TESTS))
|
2003-10-11 08:20:25 +02:00
|
|
|
TEST_ASM_O:=$(patsubst %.c, tests/%.S-O, $(TESTS))
|
|
|
|
TEST_ASM_O2:=$(patsubst %.c, tests/%.S-O2, $(TESTS))
|
|
|
|
TEST_ASM_mmmx :=$(patsubst %.c, tests/%.S-mmmx, $(TESTS))
|
|
|
|
TEST_ASM_msse :=$(patsubst %.c, tests/%.S-msse, $(TESTS))
|
|
|
|
TEST_ASM_mmmx_msse:=$(patsubst %.c, tests/%.S-mmmx-msse, $(TESTS))
|
|
|
|
TEST_ASM_O_mmmx :=$(patsubst %.c, tests/%.S-O-mmmx, $(TESTS))
|
|
|
|
TEST_ASM_O_msse :=$(patsubst %.c, tests/%.S-O-msse, $(TESTS))
|
|
|
|
TEST_ASM_O_mmmx_msse:=$(patsubst %.c, tests/%.S-O-mmmx-msse, $(TESTS))
|
|
|
|
TEST_ASM_O2_mmmx :=$(patsubst %.c, tests/%.S-O2-mmmx, $(TESTS))
|
|
|
|
TEST_ASM_O2_msse :=$(patsubst %.c, tests/%.S-O2-msse, $(TESTS))
|
|
|
|
TEST_ASM_O2_mmmx_msse:=$(patsubst %.c, tests/%.S-O2-mmmx-msse, $(TESTS))
|
2003-10-22 06:03:46 +02:00
|
|
|
TEST_ASM_O2_mmmx_call :=$(patsubst %.c, tests/%.S-O2-mmmx-call, $(TESTS))
|
|
|
|
TEST_ASM_O2_mmmx_msse_call:=$(patsubst %.c, tests/%.S-O2-mmmx-msse-call, $(TESTS))
|
|
|
|
TEST_ASM_ALL:= $(TEST_ASM) $(TEST_ASM_O) $(TEST_ASM_O2) $(TEST_ASM_mmmx) $(TEST_ASM_msse) $(TEST_ASM_mmmx_msse) $(TEST_ASM_O_mmmx) $(TEST_ASM_O_msse) $(TEST_ASM_O_mmmx_msse) $(TEST_ASM_O2_mmmx) $(TEST_ASM_O2_msse) $(TEST_ASM_O2_mmmx_msse) $(TEST_ASM_O2_mmmx_call) $(TEST_ASM_O2_mmmx_msse_call)
|
|
|
|
TEST_ASM_MOST:= $(TEST_ASM_O) $(TEST_ASM_O_mmmx) $(TEST_ASM_O_msse) $(TEST_ASM_O_mmmx_msse) $(TEST_ASM_O2) $(TEST_ASM_O2_mmmx) $(TEST_ASM_O2_msse) $(TEST_ASM_O2_mmmx_msse) $(TEST_ASM_O2_mmmx_call) $(TEST_ASM_O2_mmmx_msse_call)
|
2003-04-22 20:44:01 +02:00
|
|
|
TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS))
|
|
|
|
TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS))
|
2003-10-11 08:20:25 +02:00
|
|
|
LINUX_ELF:=$(patsubst %.c, tests/%.elf, $(LINUX_TESTS))
|
|
|
|
LINUX_OUT:=$(patsubst %.c, tests/%.out, $(LINUX_TESTS))
|
2003-04-22 20:44:01 +02:00
|
|
|
|
2003-06-28 08:49:45 +02:00
|
|
|
FAIL_SRCS:=$(patsubst %, tests/%, $(FAIL_TESTS))
|
|
|
|
FAIL_OUT:=$(patsubst %.c, tests/%.out, $(FAIL_TESTS))
|
|
|
|
|
|
|
|
|
2003-10-22 06:03:46 +02:00
|
|
|
ROMCC_OPTS=-fmax-allocation-passes=8 -fdebug-live-range-conflicts
|
|
|
|
|
2003-04-22 20:44:01 +02:00
|
|
|
$(TEST_ASM): %.S: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
$(TEST_ASM_O): %.S-O: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
$(TEST_ASM_O2): %.S-O2: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O2 -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
$(TEST_ASM_mmmx): %.S-mmmx: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -mmmx -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
$(TEST_ASM_msse): %.S-msse: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -msse -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
$(TEST_ASM_mmmx_msse): %.S-mmmx-msse: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -mmmx -msse -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
$(TEST_ASM_O_mmmx): %.S-O-mmmx: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O -mmmx -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
$(TEST_ASM_O_msse): %.S-O-msse: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O -msse -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
$(TEST_ASM_O_mmmx_msse): %.S-O-mmmx-msse: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O -mmmx -msse -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
$(TEST_ASM_O2_mmmx): %.S-O2-mmmx: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O2 -mmmx -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
$(TEST_ASM_O2_msse): %.S-O2-msse: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O2 -msse -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
|
|
|
$(TEST_ASM_O2_mmmx_msse): %.S-O2-mmmx-msse: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O2 -mmmx -msse -o $@ $< > $*.debug
|
|
|
|
|
|
|
|
$(TEST_ASM_O2_mmmx_call): %.S-O2-mmmx-call: %.c romcc
|
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O2 -mmmx -fno-always-inline -o $@ $< > $*.debug
|
|
|
|
|
|
|
|
$(TEST_ASM_O2_mmmx_msse_call): %.S-O2-mmmx-msse-call: %.c romcc
|
|
|
|
export ALLOC_CHECK_=2; ./romcc $(ROMCC_OPTS) -O2 -mmmx -msse -fno-always-inline -o $@ $< > $*.debug
|
2003-10-11 08:20:25 +02:00
|
|
|
|
2003-06-28 08:49:45 +02:00
|
|
|
|
|
|
|
$(FAIL_OUT): %.out: %.c romcc
|
2003-10-22 06:03:46 +02:00
|
|
|
export ALLOC_CHECK_=2; if ./romcc $(ROMCC_OPTS) -O2 -o $*.S $< > $*.debug 2> $@ ; then exit 1 ; else exit 0 ; fi
|
2003-04-22 20:44:01 +02:00
|
|
|
|
2003-10-11 08:20:25 +02:00
|
|
|
$(TEST_OBJ): %.o: %.S-O2-mmmx
|
2003-04-22 20:44:01 +02:00
|
|
|
as $< -o $@
|
|
|
|
|
2003-06-10 23:22:07 +02:00
|
|
|
$(TEST_ELF): %.elf: %.o tests/ldscript.ld
|
|
|
|
ld -T tests/ldscript.ld $< -o $@
|
2003-04-22 20:44:01 +02:00
|
|
|
|
2003-10-11 08:20:25 +02:00
|
|
|
$(LINUX_OUT): %.out: %.elf
|
|
|
|
./$< > $@
|
|
|
|
|
|
|
|
test: $(TEST_ELF) $(FAIL_OUT) $(TEST_ASM_MOST)
|
|
|
|
|
|
|
|
run_linux: $(LINUX_OUT)
|
2003-04-22 20:44:01 +02:00
|
|
|
|
|
|
|
echo:
|
|
|
|
echo "TEST_SRCS=$(TEST_SRCS)"
|
|
|
|
echo "TEST_ASM=$(TEST_ASM)"
|
|
|
|
echo "TEST_OBJ=$(TEST_OBJ)"
|
|
|
|
echo "TEST_ELF=$(TEST_ELF)"
|
2003-06-28 08:49:45 +02:00
|
|
|
echo ""
|
|
|
|
echo "FAIL_SRCS=$(FAIL_SRCS)"
|
|
|
|
echo "FAIL_ASM=$(FAIL_ASM)"
|
2003-04-22 20:44:01 +02:00
|
|
|
|
|
|
|
clean:
|
2003-10-11 08:20:25 +02:00
|
|
|
rm -f romcc romcc_pg core $(TEST_ASM_ALL) $(TEST_OBJ) $(TEST_ELF) tests/*.debug tests/*.debug2 tests/*.gmon.out tests/*.out
|
2003-04-22 20:44:01 +02:00
|
|
|
|