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