Make gcc tests depend on the part of GCC that actually gets updated.
[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
36 # Native Tool Definitions
37 NATGCC  = /usr/dcs/software/supported/bin/gcc
38 CC      = /opt/SUNWspro/bin/cc
39 AS      = /opt/SUNWspro/bin/cc
40 DIS     = /usr/ccs/bin/dis
41 CP      = /bin/cp -f
42 CFLAGS  += -g -xarch=v9
43
44 LLCLIB   = $(LEVEL)/test/runtime.o
45 LIBS    += $(LLCLIB)
46
47
48
49 ifeq ($(TRACE), yes)
50     LLCFLAGS += -trace
51 endif
52 ifeq ($(TRACEM), yes)
53     LLCFLAGS += -tracem
54 endif
55
56 clean ::
57         $(RM) a.out core
58         $(RM) -rf Output/
59
60 Output/%.ll: %.c $(LCC1) Output/.dir
61         $(LCC) $(LCCFLAGS) -S $< -o $@
62
63 Output/%.bc: Output/%.ll $(LGCCAS)
64         $(LGCCAS) $< -o $@
65
66 Output/%.bc: %.ll $(LAS)
67         $(LAS) $< -o $@
68
69 #
70 # Testing versions of provided utilities...
71 #
72 Output/%.tll: %.c $(LCC1) Output/.dir
73         @echo "======== Compiling $<"
74         $(LCC) $(LCCFLAGS) -S $< -o $@ || \
75             ( rm -f $@; $(FAILURE) $@ )
76
77 Output/%.tbc: Output/%.tll $(LAS)
78         @echo "======== Assembling $<"
79         $(LAS) -f $< -o $@ || \
80             ( rm -f $@; $(FAILURE) $@ )
81
82
83
84 #%.s: %.linked.bc
85 #       $(LLC) -f $(LLCFLAGS) $< -o $@
86
87 #%: %.o $(LIBS)
88 #       $(CC) $(LDFLAGS) $< $(LIBS) -o $@
89
90
91 ## Cancel built-in implicit rules that override above rules
92 %: %.s
93
94 %: %.c
95
96 %.o: %.c
97
98 ## The next two rules are for disassembling an executable or an object file
99 #%.dis: %
100 #       $(DIS) $< > $@
101
102 #%.dis: %.o
103 #       $(DIS) $< > $@
104
105