Add TESTRUNR var
[oota-llvm.git] / test / Makefile.tests
1 ##-----------------------------------------------------------*-Makefile-*-
2 ## Common rules for generating, linking, and compiling via LLVM.  This is
3 ## used to implement a robust testing framework for LLVM
4 ##------------------------------------------------------------------------
5
6 ## NOTE: This is preliminary and will change in the future
7
8
9 include ${LEVEL}/Makefile.common
10
11 .PHONY: clean default
12
13 # These files, which might be intermediate results, should not be deleted by
14 # make
15 .PRECIOUS: Output/%.bc  Output/%.ll
16 .PRECIOUS: Output/%.tbc Output/%.tll
17 .PRECIOUS: Output/.dir
18
19 # LLVM Tool Definitions...
20 #
21 LCC      = /home/vadve/lattner/cvs/gcc_install/bin/gcc
22 LCC1     = /home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/cc1
23 TOOLS    = $(LEVEL)/tools/Debug
24 LLI      = $(TOOLS)/lli
25 LLC      = $(TOOLS)/llc
26 LAS      = $(TOOLS)/as
27 LGCCAS   = $(TOOLS)/gccas
28 LDIS     = $(TOOLS)/dis 
29 LOPT     = $(TOOLS)/opt
30 LLINK    = $(TOOLS)/link
31
32 LCCFLAGS  += -O2 -Wall
33 LLCFLAGS =
34 FAILURE  = $(LEVEL)/test/Failure.sh
35 TESTRUNR = $(LEVEL)/test/TestRunner.sh
36
37 # Native Tool Definitions
38 NATGCC  = /usr/dcs/software/supported/bin/gcc
39 CC      = /opt/SUNWspro/bin/cc
40 AS      = /opt/SUNWspro/bin/cc
41 DIS     = /usr/ccs/bin/dis
42 CP      = /bin/cp -f
43 CFLAGS  += -g -xarch=v9
44
45 LLCLIB   = $(LEVEL)/test/runtime.o
46 LIBS    += $(LLCLIB)
47
48
49
50 ifeq ($(TRACE), yes)
51     LLCFLAGS += -trace
52 endif
53 ifeq ($(TRACEM), yes)
54     LLCFLAGS += -tracem
55 endif
56
57 clean ::
58         $(RM) a.out core
59         $(RM) -rf Output/
60
61 Output/%.ll: %.c $(LCC1) Output/.dir
62         $(LCC) $(LCCFLAGS) -S $< -o $@
63
64 Output/%.bc: Output/%.ll $(LGCCAS)
65         $(LGCCAS) $< -o $@
66
67 Output/%.bc: %.ll $(LAS) Output/.dir
68         $(LAS) -f $< -o $@
69
70 #
71 # Testing versions of provided utilities...
72 #
73 Output/%.tll: %.c $(LCC1) Output/.dir
74         @echo "======== Compiling $<"
75         $(LCC) $(LCCFLAGS) -S $< -o $@ || \
76             ( rm -f $@; $(FAILURE) $@ )
77
78 Output/%.tbc: Output/%.tll $(LAS)
79         @echo "======== Assembling $<"
80         $(LAS) -f $< -o $@ || \
81             ( rm -f $@; $(FAILURE) $@ )
82
83
84
85 #%.s: %.linked.bc
86 #       $(LLC) -f $(LLCFLAGS) $< -o $@
87
88 #%: %.o $(LIBS)
89 #       $(CC) $(LDFLAGS) $< $(LIBS) -o $@
90
91
92 ## Cancel built-in implicit rules that override above rules
93 %: %.s
94
95 %: %.c
96
97 %.o: %.c
98
99 ## The next two rules are for disassembling an executable or an object file
100 #%.dis: %
101 #       $(DIS) $< > $@
102
103 #%.dis: %.o
104 #       $(DIS) $< > $@
105
106