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 | |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 17 | include $(LEVEL)/Makefile.common |
| 18 | |
Misha Brukman | b0426e8 | 2009-04-01 00:35:00 +0000 | [diff] [blame] | 19 | LLVMUnitTestExe = $(BuildMode)/$(TESTNAME)Tests$(EXEEXT) |
| 20 | |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 21 | CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/ |
| 22 | CPP.Flags += -Wno-variadic-macros |
Nick Lewycky | a15dc03 | 2009-02-26 07:44:16 +0000 | [diff] [blame] | 23 | LIBS += -lGoogleTest -lUnitTestMain |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 24 | |
| 25 | $(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) |
| 26 | $(Echo) Linking $(BuildMode) unit test $(TESTNAME) $(StripWarnMsg) |
Nick Lewycky | a15dc03 | 2009-02-26 07:44:16 +0000 | [diff] [blame] | 27 | $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \ |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 28 | $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS) |
| 29 | $(Echo) ======= Finished Linking $(BuildMode) Unit test $(TESTNAME) \ |
| 30 | $(StripWarnMsg) |
| 31 | |
| 32 | all:: $(LLVMUnitTestExe) |
Daniel Dunbar | 7f068f4 | 2009-09-13 22:39:27 +0000 | [diff] [blame] | 33 | |
| 34 | unitcheck:: $(LLVMUnitTestExe) |
Misha Brukman | 8fb520e | 2009-01-01 02:24:48 +0000 | [diff] [blame] | 35 | $(LLVMUnitTestExe) |
| 36 | |
| 37 | endif |