Jamfile 2.86 KB
Newer Older
1 2 3 4
#
# Jamfile to build CUnit - internal testing
# (see http://www.freetype.org/jam/index.html)
#
jds2's avatar
jds2 committed
5
# Copyright (C) 2004-2006  Jerry St.Clair
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#---------------------------------------------------------------------------

SubDir TOP CUnit Sources Test ;

TEST_PROG = test_cunit ;

SubDirHdrs $(CUNIT_HDR_DIR) ;
SubDirCcFlags 
  -I$(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Test 
  -DCUNIT_BUILD_TESTS
  -DCUNIT_DO_NOT_DEFINE_UNLESS_BUILDING_TESTS 
  -DMEMTRACE ;

# set location for target, source, and temporary files
34
LOCATE_TARGET = $(BUILD_DIR)$(SLASH)CUnit$(SLASH)test ;
jds2's avatar
jds2 committed
35

36 37 38 39
SEARCH_SOURCE +=
  $(TOP)$(SLASH)CUnit
  $(TOP)$(SLASH)CUnit$(SLASH)Headers
  $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Framework
jds2's avatar
jds2 committed
40
  ;
41 42 43 44 45 46 47

SOURCES =
  test_cunit.c                                                     
  CUError.c
  MyMem.c
  TestDB.c
  TestRun.c
jds2's avatar
jds2 committed
48 49
  Util.c 
  ;
50

jds2's avatar
jds2 committed
51 52 53 54
if $(BUILD_AUTOMATED)
{ 
  SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Automated ; 
  SOURCES += Automated.c ; 
55
}
jds2's avatar
jds2 committed
56 57 58 59
if $(BUILD_BASIC)
{ 
  SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Basic ; 
  SOURCES += Basic.c ; 
60
}
jds2's avatar
jds2 committed
61 62 63 64 65 66 67 68 69
if $(BUILD_CONSOLE)
{ 
  SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Console ; 
  SOURCES += Console.c ; 
}
if $(BUILD_CURSES)
{ 
  SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Curses ; 
  SOURCES += Curses.c ; 
70
}
jds2's avatar
jds2 committed
71 72 73 74 75 76 77 78 79
if $(BUILD_WINDOWS)
{ 
  SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Win ; 
  SOURCES += Win.c ; 
}

# extra symbolic targets for building test program
DEPENDS test : $(TEST_PROG)$(SUFEXE) ;
NOTFILE test ;
80

jds2's avatar
jds2 committed
81 82

if $(BUILD_TEST)
83
{
jds2's avatar
jds2 committed
84 85 86 87 88
  Main $(TEST_PROG) : $(SOURCES) ;
  MakeLocate $(TEST_PROG)$(SUFEXE) : $(BUILD_DIR) ;
  LINKLIBS on $(TEST_PROG)$(SUFEXE) = $(SYS_LIBS) ;
  
  if $(NT)
89
  {
jds2's avatar
jds2 committed
90 91 92 93 94 95 96 97 98 99
    if ($(BCCROOT) || ($(TOOLSET) = BORLANDC))
    {
      # need to fix Borland to include library location
      LINKFLAGS on $(TEST_PROG)$(SUFEXE) += -L$(STDLIBPATH) -tWC ;
    }
    else if $(MSVCNT) || $(TOOLSET) = VISUALC)
    {
      # VC won't allow use of local exit() without link flag
      LINKFLAGS on $(TEST_PROG)$(SUFEXE) += /FORCE:MULTIPLE ;
    }
100
  }
jds2's avatar
jds2 committed
101 102

  if $(INSTALL_TEST_DIR)
103
  {
jds2's avatar
jds2 committed
104
    InstallCUnitBin $(INSTALL_TEST_DIR) : $(TEST_PROG)$(SUFEXE) ;
105 106 107
  }
}