blob: 1c75e44d0778ddf11e3f728268e532951716dc76 [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
Misha Brukman8fb520e2009-01-01 02:24:48 +000017include $(LEVEL)/Makefile.common
18
Misha Brukmanb0426e82009-04-01 00:35:00 +000019LLVMUnitTestExe = $(BuildMode)/$(TESTNAME)Tests$(EXEEXT)
20
Misha Brukman8fb520e2009-01-01 02:24:48 +000021CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/
22CPP.Flags += -Wno-variadic-macros
Nick Lewyckya15dc032009-02-26 07:44:16 +000023LIBS += -lGoogleTest -lUnitTestMain
Misha Brukman8fb520e2009-01-01 02:24:48 +000024
25$(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
26 $(Echo) Linking $(BuildMode) unit test $(TESTNAME) $(StripWarnMsg)
Nick Lewyckya15dc032009-02-26 07:44:16 +000027 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
Misha Brukman8fb520e2009-01-01 02:24:48 +000028 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
29 $(Echo) ======= Finished Linking $(BuildMode) Unit test $(TESTNAME) \
30 $(StripWarnMsg)
31
32all:: $(LLVMUnitTestExe)
33 $(LLVMUnitTestExe)
34
35endif