blob: 5ecc4a227c5214bbfdfac40a960ae843b723168e [file] [log] [blame]
Chris Lattner12d632c2004-11-07 05:05:37 +00001#===- 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. Adve38b86202001-11-05 00:22:16 +000010LEVEL = ..
Reid Spencereb32ffe2004-09-05 08:18:23 +000011DIRS =
Chris Lattner52a4e852002-01-23 21:36:59 +000012
John Criswell299e15e2003-08-21 15:09:29 +000013#
Tanya Lattner9f97b4c2004-12-04 06:25:08 +000014# Make Dejagnu the default for testing
John Criswellee29d2a2003-09-06 15:12:21 +000015#
Reid Spencer135e1d82004-12-06 05:35:38 +000016all:: check-local
John Criswellee29d2a2003-09-06 15:12:21 +000017
John Criswelld184c672003-10-27 17:46:42 +000018# Include other test rules
John Criswelld184c672003-10-27 17:46:42 +000019include Makefile.tests
20
Chris Lattner12d632c2004-11-07 05:05:37 +000021#===------------------------------------------------------------------------===#
22# DejaGNU testing support
23#===------------------------------------------------------------------------===#
24
Tanya Lattner491e9cd2004-11-07 21:39:41 +000025ifdef TESTSUITE
Chris Lattner60bdce62004-12-12 21:39:49 +000026CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
Reid Spencerb18ec662006-11-11 01:02:45 +000027CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
Chris Lattner60bdce62004-12-12 21:39:49 +000028RUNTESTFLAGS := --tool $(CLEANED_TESTSUITE)
Tanya Lattner491e9cd2004-11-07 21:39:41 +000029endif
30
Reid Spencer15d40592006-05-28 04:21:40 +000031ifndef RUNLLVM2CPP
32RUNTESTFLAGS += --ignore llvm2cpp.exp
33endif
34
Chris Lattner03ed6252006-08-01 00:07:58 +000035ifneq ($(RUNTEST),)
Reid Spencer135e1d82004-12-06 05:35:38 +000036check-local:: site.exp
Reid Spencerec68fd42007-02-11 20:18:32 +000037 ( ulimit -t 600 ; ulimit -d 512000 ; \
38 PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
39 $(RUNTEST) $(RUNTESTFLAGS) )
Chris Lattner03ed6252006-08-01 00:07:58 +000040else
41check-local:: site.exp
42 @echo "*** dejagnu not found. Make sure runtest is in your PATH, then reconfigure llvm."
43endif
Tanya Lattner491e9cd2004-11-07 21:39:41 +000044
Tanya Lattner9f97b4c2004-12-04 06:25:08 +000045clean::
Reid Spencerfb15c002007-01-17 07:59:14 +000046 $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
Tanya Lattner7a7cb4c2004-11-07 04:59:52 +000047
48site.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 Spencerdb4264f2006-04-13 20:33:59 +000053 @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
54 @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
Tanya Lattner78887f42004-11-30 19:13:06 +000055 @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
Reid Spencer492196c2006-05-28 07:22:42 +000056 @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
57 @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
Reid Spencer15d40592006-05-28 04:21:40 +000058 @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
59 @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
Reid Spencerdb4264f2006-04-13 20:33:59 +000060 @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
61 @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
Reid Spencer2a439702005-05-20 20:13:41 +000062 @echo 'set llvmgcc "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp
63 @echo 'set llvmgxx "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp
Reid Spencer805ab072006-04-06 22:22:08 +000064 @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
Reid Spencer82d5ee52007-01-30 16:06:55 +000065 @echo 'set gxxcmd "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts)"' >> site.tmp
Tanya Lattner7a7cb4c2004-11-07 04:59:52 +000066 @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