Chris Lattner | 12d632c | 2004-11-07 05:05:37 +0000 | [diff] [blame] | 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 | |
Vikram S. Adve | 38b8620 | 2001-11-05 00:22:16 +0000 | [diff] [blame] | 10 | LEVEL = .. |
Reid Spencer | eb32ffe | 2004-09-05 08:18:23 +0000 | [diff] [blame] | 11 | DIRS = |
Chris Lattner | 52a4e85 | 2002-01-23 21:36:59 +0000 | [diff] [blame] | 12 | |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 13 | # |
Tanya Lattner | 9f97b4c | 2004-12-04 06:25:08 +0000 | [diff] [blame] | 14 | # Make Dejagnu the default for testing |
John Criswell | ee29d2a | 2003-09-06 15:12:21 +0000 | [diff] [blame] | 15 | # |
Reid Spencer | 135e1d8 | 2004-12-06 05:35:38 +0000 | [diff] [blame] | 16 | all:: check-local |
John Criswell | ee29d2a | 2003-09-06 15:12:21 +0000 | [diff] [blame] | 17 | |
John Criswell | d184c67 | 2003-10-27 17:46:42 +0000 | [diff] [blame] | 18 | # Include other test rules |
John Criswell | d184c67 | 2003-10-27 17:46:42 +0000 | [diff] [blame] | 19 | include Makefile.tests |
| 20 | |
Chris Lattner | 12d632c | 2004-11-07 05:05:37 +0000 | [diff] [blame] | 21 | #===------------------------------------------------------------------------===# |
| 22 | # DejaGNU testing support |
| 23 | #===------------------------------------------------------------------------===# |
| 24 | |
Tanya Lattner | 491e9cd | 2004-11-07 21:39:41 +0000 | [diff] [blame] | 25 | ifdef TESTSUITE |
Chris Lattner | 60bdce6 | 2004-12-12 21:39:49 +0000 | [diff] [blame] | 26 | CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE)) |
Reid Spencer | b18ec66 | 2006-11-11 01:02:45 +0000 | [diff] [blame] | 27 | CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE)) |
Chris Lattner | 60bdce6 | 2004-12-12 21:39:49 +0000 | [diff] [blame] | 28 | RUNTESTFLAGS := --tool $(CLEANED_TESTSUITE) |
Tanya Lattner | 491e9cd | 2004-11-07 21:39:41 +0000 | [diff] [blame] | 29 | endif |
| 30 | |
Reid Spencer | 15d4059 | 2006-05-28 04:21:40 +0000 | [diff] [blame] | 31 | ifndef RUNLLVM2CPP |
| 32 | RUNTESTFLAGS += --ignore llvm2cpp.exp |
| 33 | endif |
| 34 | |
Chris Lattner | 03ed625 | 2006-08-01 00:07:58 +0000 | [diff] [blame] | 35 | ifneq ($(RUNTEST),) |
Reid Spencer | 135e1d8 | 2004-12-06 05:35:38 +0000 | [diff] [blame] | 36 | check-local:: site.exp |
Reid Spencer | ec68fd4 | 2007-02-11 20:18:32 +0000 | [diff] [blame] | 37 | ( ulimit -t 600 ; ulimit -d 512000 ; \ |
| 38 | PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \ |
| 39 | $(RUNTEST) $(RUNTESTFLAGS) ) |
Chris Lattner | 03ed625 | 2006-08-01 00:07:58 +0000 | [diff] [blame] | 40 | else |
| 41 | check-local:: site.exp |
| 42 | @echo "*** dejagnu not found. Make sure runtest is in your PATH, then reconfigure llvm." |
| 43 | endif |
Tanya Lattner | 491e9cd | 2004-11-07 21:39:41 +0000 | [diff] [blame] | 44 | |
Tanya Lattner | 9f97b4c | 2004-12-04 06:25:08 +0000 | [diff] [blame] | 45 | clean:: |
Reid Spencer | fb15c00 | 2007-01-17 07:59:14 +0000 | [diff] [blame] | 46 | $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print` |
Tanya Lattner | 7a7cb4c | 2004-11-07 04:59:52 +0000 | [diff] [blame] | 47 | |
| 48 | site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config |
| 49 | @echo 'Making a new site.exp file...' |
| 50 | @echo '## these variables are automatically generated by make ##' >site.tmp |
| 51 | @echo '# Do not edit here. If you wish to override these values' >>site.tmp |
| 52 | @echo '# edit the last section' >>site.tmp |
Reid Spencer | db4264f | 2006-04-13 20:33:59 +0000 | [diff] [blame] | 53 | @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp |
| 54 | @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp |
Tanya Lattner | 78887f4 | 2004-11-30 19:13:06 +0000 | [diff] [blame] | 55 | @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp |
Reid Spencer | 492196c | 2006-05-28 07:22:42 +0000 | [diff] [blame] | 56 | @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp |
| 57 | @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp |
Reid Spencer | 15d4059 | 2006-05-28 04:21:40 +0000 | [diff] [blame] | 58 | @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp |
| 59 | @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp |
Reid Spencer | db4264f | 2006-04-13 20:33:59 +0000 | [diff] [blame] | 60 | @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp |
| 61 | @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp |
Reid Spencer | 2a43970 | 2005-05-20 20:13:41 +0000 | [diff] [blame] | 62 | @echo 'set llvmgcc "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp |
| 63 | @echo 'set llvmgxx "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp |
Reid Spencer | 805ab07 | 2006-04-06 22:22:08 +0000 | [diff] [blame] | 64 | @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp |
Reid Spencer | 82d5ee5 | 2007-01-30 16:06:55 +0000 | [diff] [blame] | 65 | @echo 'set gxxcmd "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts)"' >> site.tmp |
Tanya Lattner | 7a7cb4c | 2004-11-07 04:59:52 +0000 | [diff] [blame] | 66 | @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp |
| 67 | @test ! -f site.exp || \ |
| 68 | sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp |
| 69 | @-rm -f site.bak |
| 70 | @test ! -f site.exp || mv site.exp site.bak |
| 71 | @mv site.tmp site.exp |