blob: 656f5e2f412a35a724c0f4823f05de6e4d1b558f [file] [log] [blame]
Misha Brukman8fb520e2009-01-01 02:24:48 +00001##===- unittests/Makefile.unittest -------------------------*- Makefile -*-===##
2#
3# The LLVM Compiler Infrastructure
4#
5# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
7#
8##===----------------------------------------------------------------------===##
9#
10# This file is included by all of the unit test makefiles.
11#
12##===----------------------------------------------------------------------===##
13
14# Set up variables for building a unit test.
15ifdef TESTNAME
16
Chris Lattner43b5f932010-01-24 20:43:08 +000017REQUIRES_RTTI = 1
18
Misha Brukman8fb520e2009-01-01 02:24:48 +000019include $(LEVEL)/Makefile.common
20
Misha Brukmanb0426e82009-04-01 00:35:00 +000021LLVMUnitTestExe = $(BuildMode)/$(TESTNAME)Tests$(EXEEXT)
22
Misha Brukman8fb520e2009-01-01 02:24:48 +000023CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/
Julien Lerougecadd4b92009-10-26 20:01:35 +000024CPP.Flags += $(NO_VARIADIC_MACROS)
Benjamin Kramere2b208a2009-10-02 19:52:33 +000025TESTLIBS = -lGoogleTest -lUnitTestMain
Misha Brukman8fb520e2009-01-01 02:24:48 +000026
27$(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
28 $(Echo) Linking $(BuildMode) unit test $(TESTNAME) $(StripWarnMsg)
Nick Lewyckya15dc032009-02-26 07:44:16 +000029 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
Benjamin Kramere2b208a2009-10-02 19:52:33 +000030 $(TESTLIBS) $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
Misha Brukman8fb520e2009-01-01 02:24:48 +000031 $(Echo) ======= Finished Linking $(BuildMode) Unit test $(TESTNAME) \
32 $(StripWarnMsg)
33
34all:: $(LLVMUnitTestExe)
Daniel Dunbar7f068f42009-09-13 22:39:27 +000035
36unitcheck:: $(LLVMUnitTestExe)
Misha Brukman8fb520e2009-01-01 02:24:48 +000037 $(LLVMUnitTestExe)
38
39endif