Eric Biederman | 6aa31cc | 2003-06-10 21:22:07 +0000 | [diff] [blame] | 1 | VERSION:=0.27 |
| 2 | RELEASE_DATE:=10 June 2003 |
Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 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) |
Eric Biederman | 05f26fc | 2003-06-11 21:55:00 +0000 | [diff] [blame] | 10 | CPROF_FLAGS=-pg -fprofile-arcs |
Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 11 | |
| 12 | all: romcc test |
| 13 | |
| 14 | romcc: romcc.c Makefile |
| 15 | $(CC) $(CFLAGS) -o $@ $< |
| 16 | |
Eric Biederman | 05f26fc | 2003-06-11 21:55:00 +0000 | [diff] [blame] | 17 | romcc_pg: romcc.c Makefile |
| 18 | $(CC) $(CFLAGS) $(CPROF_FLAGS) -o $@ $< |
| 19 | |
Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 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 \ |
Eric Biederman | 0babc1c | 2003-05-09 02:39:00 +0000 | [diff] [blame] | 37 | simple_test16.c \ |
| 38 | simple_test17.c \ |
| 39 | simple_test18.c \ |
| 40 | simple_test19.c \ |
Eric Biederman | a96d6a9 | 2003-05-13 20:45:19 +0000 | [diff] [blame] | 41 | simple_test20.c \ |
Eric Biederman | 6aa31cc | 2003-06-10 21:22:07 +0000 | [diff] [blame] | 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 \ |
Eric Biederman | 05f26fc | 2003-06-11 21:55:00 +0000 | [diff] [blame] | 52 | simple_test31.c \ |
Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 53 | raminit_test.c \ |
Eric Biederman | 6aa31cc | 2003-06-10 21:22:07 +0000 | [diff] [blame] | 54 | raminit_test2.c \ |
| 55 | raminit_test3.c |
Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 56 | |
| 57 | TEST_SRCS:=$(patsubst %, tests/%, $(TESTS)) |
| 58 | TEST_ASM:=$(patsubst %.c, tests/%.S, $(TESTS)) |
| 59 | TEST_OBJ:=$(patsubst %.c, tests/%.o, $(TESTS)) |
| 60 | TEST_ELF:=$(patsubst %.c, tests/%.elf, $(TESTS)) |
| 61 | |
| 62 | $(TEST_ASM): %.S: %.c romcc |
Eric Biederman | 6aa31cc | 2003-06-10 21:22:07 +0000 | [diff] [blame] | 63 | export ALLOC_CHECK_=2; ./romcc -O -o $@ $< > $*.debug |
Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 64 | |
| 65 | $(TEST_OBJ): %.o: %.S |
| 66 | as $< -o $@ |
| 67 | |
Eric Biederman | 6aa31cc | 2003-06-10 21:22:07 +0000 | [diff] [blame] | 68 | $(TEST_ELF): %.elf: %.o tests/ldscript.ld |
| 69 | ld -T tests/ldscript.ld $< -o $@ |
Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 70 | |
| 71 | test: $(TEST_ELF) |
| 72 | |
| 73 | echo: |
| 74 | echo "TEST_SRCS=$(TEST_SRCS)" |
| 75 | echo "TEST_ASM=$(TEST_ASM)" |
| 76 | echo "TEST_OBJ=$(TEST_OBJ)" |
| 77 | echo "TEST_ELF=$(TEST_ELF)" |
| 78 | |
| 79 | clean: |
Eric Biederman | 6aa31cc | 2003-06-10 21:22:07 +0000 | [diff] [blame] | 80 | rm -f romcc core $(TEST_ASM) $(TEST_OBJ) $(TEST_ELF) tests/*.debug tests/*.debug2 |
Eric Biederman | b138ac8 | 2003-04-22 18:44:01 +0000 | [diff] [blame] | 81 | |