blob: 259e297cef7cc2f97b72ad0a15bf2c9b0a5b9d99 [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
17LLVMUnitTestDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/unittests
18LLVMUnitTestExe := $(LLVMUnitTestDir)/$(TESTNAME)Tests$(EXEEXT)
19
20include $(LEVEL)/Makefile.common
21
22CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/
23CPP.Flags += -Wno-variadic-macros
24LD.Flags += -lGoogleTest -lUnitTestMain
25
26$(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
27 $(Echo) Linking $(BuildMode) unit test $(TESTNAME) $(StripWarnMsg)
28 $(Verb) $(LTLink) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
29 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
30 $(Echo) ======= Finished Linking $(BuildMode) Unit test $(TESTNAME) \
31 $(StripWarnMsg)
32
33all:: $(LLVMUnitTestExe)
34 $(LLVMUnitTestExe)
35
36endif