Reverse previous change.
[oota-llvm.git] / test / Makefile
1 LLC  := ../tools/Debug/llc
2 AS   := ../tools/Debug/as
3 LLCOPTS := -dsched y
4 ARCHFLAGS = ## -xarch=v9
5
6 CC = /opt/SUNWspro/bin/cc
7 CCFLAGS = -g $(ARCHFLAGS)
8 ## CC = gcc
9 ## CCFLAGS = -g $(ARCHFLAGS) ## -mcpu=v9
10
11 TESTS := $(wildcard *.ll)
12
13 LLCTESTS := $(shell /bin/ls *.ll | grep -v testswitch | grep -v opttest | grep -v xx | grep -v calltest )
14
15
16 test all : testasmdis testopt testcodegen
17         @echo "All tests successfully completed!"
18
19 testasmdis  : $(TESTS:%.ll=%.ll.asmdis)
20         @echo "All assembler/disassembler test succeeded!"
21
22 testopt     : $(TESTS:%.ll=%.ll.opt)
23
24 testselect  : $(LLCTESTS:%.ll=%.mc)
25
26 testsched   : $(LLCTESTS:%.ll=%.mc)
27
28 testcodegen : $(LLCTESTS:%.ll=%.mc)
29
30 testsparc   : $(LLCTESTS:%.ll=%.s)
31
32 clean :
33         rm -f *.[123] *.bc *.mc *.s core
34
35 %.asmdis: %
36         @echo "Running assembler/disassembler test on $<"
37         @./TestAsmDisasm.sh $<
38
39 %.opt: %
40         @echo "Running optimizier test on $<"
41         @./TestOptimizer.sh $<
42
43 %.bc: %.ll
44         $(AS) $< -f
45
46 %.mc: %.ll $(LLC) $(AS)
47         @echo "Generating machine instructions for $<"
48         $(AS) < $< | $(LLC) $(LLCOPTS) > $@
49
50 %.s: %.ll $(LLC) $(AS)
51         $(AS) < $<  | $(LLC) > $@
52
53 ## %.o: %.s %.ll
54 ##      /usr/ccs/bin/as $(ARCHFLAGS) $<
55
56
57 %.o: %.s
58         $(CC) -c $(CCFLAGS) $< -xarch=v9
59
60 %: %.o
61         $(CC) -o $@ $< -xarch=v9
62
63