Fix a problem where dejagnu won't accept the value of global tcl variable
[oota-llvm.git] / test / Makefile
1 #===- test/Makefile ----------------------------------------*- Makefile -*--===#
2
3 #                     The LLVM Compiler Infrastructure
4 #
5 # This file was developed by the LLVM research group and is distributed under
6 # the University of Illinois Open Source License. See LICENSE.TXT for details.
7
8 #===------------------------------------------------------------------------===#
9
10 LEVEL  = ..
11 DIRS   = 
12
13 #
14 # Make Dejagnu the default for testing
15 #
16 all:: check-local
17
18 # Include other test rules
19 include Makefile.tests
20
21 #===------------------------------------------------------------------------===#
22 # DejaGNU testing support
23 #===------------------------------------------------------------------------===#
24
25 ifdef TESTSUITE
26 CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
27 RUNTESTFLAGS := --tool $(CLEANED_TESTSUITE)
28 endif
29
30 ifndef RUNLLVM2CPP
31 RUNTESTFLAGS += --ignore llvm2cpp.exp
32 endif
33
34 check-local:: site.exp
35         PATH="$(LLVMToolDir):$(LLVMExmplDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
36         $(RUNTEST) $(RUNTESTFLAGS)
37
38 clean::
39         $(RM) -rf `find $(LLVM_OBJ_ROOT)/test/Regression -name Output -type d -print`
40         $(RM) -rf `find $(LLVM_OBJ_ROOT)/test/Feature -name Output -type d -print`
41
42 site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config
43         @echo 'Making a new site.exp file...'
44         @echo '## these variables are automatically generated by make ##' >site.tmp
45         @echo '# Do not edit here.  If you wish to override these values' >>site.tmp
46         @echo '# edit the last section' >>site.tmp
47         @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
48         @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
49         @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
50         @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
51         @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
52         @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
53         @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
54         @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
55         @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
56         @echo 'set llvmgcc "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp
57         @echo 'set llvmgxx "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp
58         @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
59         @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
60         @test ! -f site.exp || \
61         sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
62         @-rm -f site.bak
63         @test ! -f site.exp || mv site.exp site.bak
64         @mv site.tmp site.exp