- use an external Makefile.config for the test/Makefile that is not comitted to cvs...
[libfirm] / ir / be / test / Makefile
1 include Makefile.config
2
3 COMPARES = $(addprefix compare_, $(filter-out $(DONTCOMPARE), $(SOURCES)))
4
5 .PHONY: all clean firm gcc compare
6
7 help:
8         @echo "Targets:"
9         @echo ""
10         @echo " gcc     Build files with gcc"
11         @echo " firm    Build files with firm/edg"
12         @echo " compare Compare results from firm with gcc executables"
13
14 all: compare
15
16 gcc: $(GCCEXES)
17
18 firm: $(FIRMEXES) $(FIRMASSEMBLERS)
19
20 compare: $(COMPARES)
21
22 gcc/%.result: gcc/%.exe
23         @test -z gcc || mkdir -p gcc
24         gcc/$*.exe >& $@ || true
25
26 firm/%.result: firm/%.exe
27         @test -z firm || mkdir -p firm
28         firm/$*.exe >& $@ || echo "$*.c" >> doesntrun.txt
29
30 compare_%.c: gcc/%.exe firm/%.exe gcc/%.result firm/%.result
31         diff -u gcc/$*.result firm/$*.result || echo "$*.c" >> broken.txt
32
33 gcc/%.exe: %.c
34         @test -z gcc || mkdir -p gcc
35         $(GCC) $(GCC_CFLAGS) $*.c -o $@
36
37 firm/%.s: %.c
38         @test -z firm || mkdir -p firm
39         cd firm ; $(EDG) $(EDG_CFLAGS) ../$*.c || echo "$*.c" >> ../compile_failed.txt
40         mv $*.s firm || echo "" > firm/$*.s
41
42 firm/%.exe: firm/%.s
43         $(GCC) firm/$*.s -o $@ || echo "$*.c" >> link_failed.txt
44
45 clean:
46         rm -f gcc/*
47         rm -f firm/*