Try to fix unit test linking on linux ...
[oota-llvm.git] / unittests / Makefile.unittest
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
17 include $(LEVEL)/Makefile.common
18
19 LLVMUnitTestExe = $(BuildMode)/$(TESTNAME)Tests$(EXEEXT)
20
21 CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/
22 CPP.Flags += -Wno-variadic-macros
23 TESTLIBS = -lGoogleTest -lUnitTestMain
24
25 $(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
26         $(Echo) Linking $(BuildMode) unit test $(TESTNAME) $(StripWarnMsg)
27         $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
28         $(TESTLIBS) $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
29         $(Echo) ======= Finished Linking $(BuildMode) Unit test $(TESTNAME) \
30           $(StripWarnMsg)
31
32 all:: $(LLVMUnitTestExe)
33
34 unitcheck:: $(LLVMUnitTestExe)
35         $(LLVMUnitTestExe)
36
37 endif