test/Libraries have been long gone for a long time now. Since noone noticed
[oota-llvm.git] / test / Makefile.tests
1 ##----------------------------------------------------------*- Makefile -*-===##
2 ##
3 ## Common rules for generating, linking, and compiling via LLVM.  This is
4 ## used to implement a robust testing framework for LLVM
5 ##
6 ##-------------------------------------------------------------------------===##
7
8 # If the user specified a TEST= option on the command line, we do not want to do
9 # the default testing type.  Instead, we change the default target to be the
10 # test:: target.
11 #
12 ifdef TEST
13 test::
14 endif
15
16 # We do not want to make .d files for tests! 
17 DISABLE_AUTO_DEPENDENCIES=1
18
19 include ${LEVEL}/Makefile.common
20
21 # Specify ENABLE_STATS on the command line to enable -stats and -time-passes
22 # output from gccas and gccld.
23 ifdef ENABLE_STATS
24 STATS = -stats -time-passes
25 endif
26
27 .PHONY: clean default
28
29 # These files, which might be intermediate results, should not be deleted by
30 # make
31 .PRECIOUS: Output/%.bc  Output/%.ll
32 .PRECIOUS: Output/%.tbc Output/%.tll
33 .PRECIOUS: Output/.dir
34 .PRECIOUS: Output/%.llvm.bc
35 .PRECIOUS: Output/%.llvm
36
37 # Find the location of the platform specific LLVM GCC libraries
38 LLVMGCCLIBDIR=$(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a))
39
40 # LLVM Tool Definitions (LLVMGCC, LLVMGXX, LLVMAS are provided by Makefile.rules)
41 LLI      = $(LLVMTOOLCURRENT)/lli$(EXEEXT)
42 LLC      = $(LLVMTOOLCURRENT)/llc$(EXEEXT)
43 LGCCAS   = $(LLVMTOOLCURRENT)/gccas$(EXEEXT)
44 LGCCLD   = $(LGCCLDPROG) -L$(LLVMGCCLIBDIR) -L$(LLVMGCCDIR)/lib
45 LDIS     = $(LLVMTOOLCURRENT)/llvm-dis$(EXEEXT)
46 LOPT     = $(LLVMTOOLCURRENT)/opt$(EXEEXT)
47 LLINK    = $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT)
48 LPROF    = $(LLVMTOOLCURRENT)/llvm-prof$(EXEEXT)
49 LANALYZE = $(LLVMTOOLCURRENT)/analyze$(EXEEXT)
50 LBUGPOINT= $(LLVMTOOLCURRENT)/bugpoint$(EXEEXT)
51
52 LCCFLAGS  += -O2 -Wall
53 LCXXFLAGS += -O2 -Wall
54 LLCFLAGS =
55 FAILURE  = $(LLVM_SRC_ROOT)/test/Failure.sh
56 TESTRUNR = @echo Running test: $<; \
57              PATH=$(LLVMTOOLCURRENT):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH) \
58                   $(LLVM_SRC_ROOT)/test/TestRunner.sh
59
60 LLCLIBS := $(LLCLIBS) -lm
61
62 clean::
63         $(RM) -f a.out core
64         $(RM) -rf Output/
65
66 # Compile from X.c to Output/X.ll
67 Output/%.ll: %.c $(LCC1) Output/.dir $(INCLUDES)
68         -$(LLVMGCC) $(CPPFLAGS) $(LCCFLAGS) -S $< -o $@
69
70 # Compile from X.cpp to Output/X.ll
71 Output/%.ll: %.cpp $(LCC1XX) Output/.dir $(INCLUDES)
72         -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) -S $< -o $@
73
74 # Compile from X.cc to Output/X.ll
75 Output/%.ll: %.cc $(LCC1XX) Output/.dir $(INCLUDES)
76         -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) -S $< -o $@
77
78 # LLVM Assemble from Output/X.ll to Output/X.bc.  Output/X.ll must have come
79 # from GCC output, so use GCCAS.
80 #
81 Output/%.bc: Output/%.ll $(LGCCAS)
82         -$(LGCCAS) $(STATS) $< -o $@
83
84 # LLVM Assemble from X.ll to Output/X.bc.  Because we are coming directly from
85 # LLVM source, use the non-transforming assembler.
86 #
87 Output/%.bc: %.ll $(LLVMAS) Output/.dir
88         -$(LLVMAS) -f $< -o $@
89
90 ## Cancel built-in implicit rules that override above rules
91 %: %.s
92
93 %: %.c
94
95 %.o: %.c
96