Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 1 | ##===- 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. |
| 15 | ifdef TESTNAME |
| 16 | |
Jeffrey Yasskin | 9815582 | 2010-01-26 23:30:46 +0000 | [diff] [blame] | 17 | CPP.Flags += -DGTEST_HAS_RTTI=0 |
| 18 | # gcc's TR1 <tuple> header depends on RTTI, so force googletest to use |
| 19 | # its own tuple implementation. When we import googletest >=1.4.0, we |
| 20 | # can drop this line. |
| 21 | CPP.Flags += -DGTEST_HAS_TR1_TUPLE=0 |
Chris Lattner | 43b5f93 | 2010-01-24 20:43:08 +0000 | [diff] [blame] | 22 | |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 23 | include $(LEVEL)/Makefile.common |
| 24 | |
Misha Brukman | b0426e8 | 2009-04-01 00:35:00 +0000 | [diff] [blame] | 25 | LLVMUnitTestExe = $(BuildMode)/$(TESTNAME)Tests$(EXEEXT) |
| 26 | |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 27 | CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/ |
Julien Lerouge | cadd4b9 | 2009-10-26 20:01:35 +0000 | [diff] [blame] | 28 | CPP.Flags += $(NO_VARIADIC_MACROS) |
Benjamin Kramer | e2b208a | 2009-10-02 19:52:33 +0000 | [diff] [blame] | 29 | TESTLIBS = -lGoogleTest -lUnitTestMain |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 30 | |
| 31 | $(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) |
| 32 | $(Echo) Linking $(BuildMode) unit test $(TESTNAME) $(StripWarnMsg) |
Nick Lewycky | a15dc03 | 2009-02-26 07:44:16 +0000 | [diff] [blame] | 33 | $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \ |
Benjamin Kramer | e2b208a | 2009-10-02 19:52:33 +0000 | [diff] [blame] | 34 | $(TESTLIBS) $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS) |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 35 | $(Echo) ======= Finished Linking $(BuildMode) Unit test $(TESTNAME) \ |
| 36 | $(StripWarnMsg) |
| 37 | |
| 38 | all:: $(LLVMUnitTestExe) |
Daniel Dunbar | 7f068f4 | 2009-09-13 22:39:27 +0000 | [diff] [blame] | 39 | |
| 40 | unitcheck:: $(LLVMUnitTestExe) |
Jeffrey Yasskin | 2155d45 | 2010-02-18 04:43:02 +0000 | [diff] [blame] | 41 | $(LLVMUnitTestExe) |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 42 | |
| 43 | endif |