Fix out-of-date name.
[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 LGCCLD   = $(TOOLS)/gccld -L/home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/
29 LDIS     = $(TOOLS)/dis 
30 LOPT     = $(TOOLS)/opt
31 LLINK    = $(TOOLS)/link
32
33 LCCFLAGS  += -O2 -Wall
34 LLCFLAGS =
35 FAILURE  = $(LEVEL)/test/Failure.sh
36 TESTRUNR = $(LEVEL)/test/TestRunner.sh
37
38 # Native Tool Definitions
39 NATGCC  = /usr/dcs/software/supported/bin/gcc
40 CC      = /opt/SUNWspro/bin/cc
41 AS      = /opt/SUNWspro/bin/cc
42 DIS     = /usr/ccs/bin/dis
43 CP      = /bin/cp -f
44 CFLAGS  += -g -xarch=v9
45
46 LLCLIB   = $(LEVEL)/test/Libraries/runtime.o
47 LIBS    += $(LLCLIB)
48
49
50
51 ifeq ($(TRACE), yes)
52     LLCFLAGS += -trace
53 endif
54 ifeq ($(TRACEM), yes)
55     LLCFLAGS += -tracem
56 endif
57
58 clean ::
59         $(RM) a.out core
60         $(RM) -rf Output/
61
62 # Compile from X.c to Output/X.ll
63 Output/%.ll: %.c $(LCC1) Output/.dir
64         $(LCC) $(LCCFLAGS) -S $< -o $@
65
66 # LLVM Assemble from Output/X.ll to Output/X.bc.  Output/X.ll must have come
67 # from GCC output, so use GCCAS.
68 #
69 Output/%.bc: Output/%.ll $(LGCCAS)
70         $(LGCCAS) $< -o $@
71
72 # LLVM Assemble from X.ll to Output/X.bc.  Because we are coming directly from
73 # LLVM source, use the non-transforming assembler.
74 #
75 Output/%.bc: %.ll $(LAS) Output/.dir
76         $(LAS) -f $< -o $@
77
78 # Compile a linked program to machine code for this processor.
79 #
80 Output/%.llc.s: Output/%.llvm.bc
81         $(LLC) $(LLCFLAGS) -f $< -o $@
82
83 # Assemble (and link) an LLVM-linked program using the system assembler...
84 #
85 Output/%.llc: Output/%.llc.s
86         $(CC) $(CFLAGS) $< $(LIBS) -o $@
87
88 #
89 # Testing versions of provided utilities...
90 #
91 Output/%.tll: %.c $(LCC1) Output/.dir
92         @echo "======== Compiling $<"
93         $(LCC) $(LCCFLAGS) -S $< -o $@ || \
94             ( rm -f $@; $(FAILURE) $@ )
95
96 Output/%.tbc: Output/%.tll $(LAS)
97         @echo "======== Assembling $<"
98         $(LAS) -f $< -o $@ || \
99             ( rm -f $@; $(FAILURE) $@ )
100
101
102 ## Cancel built-in implicit rules that override above rules
103 %: %.s
104
105 %: %.c
106
107 %.o: %.c
108