Debian Codegraph @

CUnit/Jamfile

raw
1 #
2 # Jamfile to build CUnit - Source root Directory
3 # (see http://www.freetype.org/jam/index.html)
4 #
5 # Copyright (C) 2004-2006 Jerry St.Clair
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Library General Public
9 # License as published by the Free Software Foundation; either
10 # version 2 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Library General Public License for more details.
16 #
17 # You should have received a copy of the GNU Library General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #---------------------------------------------------------------------------
21
22 SubDir TOP CUnit ;
23
24 SubDirHdrs $(CUNIT_HDR_DIR) $(CUNIT_WIN_DIR) ;
25
26 # set location for target, source, and temporary files
27 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)CUnit ;
28
29 SEARCH_SOURCE +=
30 $(TOP)$(SLASH)CUnit
31 $(TOP)$(SLASH)CUnit$(SLASH)Headers
32 $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Framework
33 ;
34
35 SOURCES =
36 CUError.c
37 MyMem.c
38 TestDB.c
39 TestRun.c
40 Util.c
41 ;
42
43 if $(BUILD_AUTOMATED)
44 {
45 SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Automated ;
46 SOURCES += Automated.c ;
47 }
48 if $(BUILD_BASIC)
49 {
50 SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Basic ;
51 SOURCES += Basic.c ;
52 }
53 if $(BUILD_CONSOLE)
54 {
55 SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Console ;
56 SOURCES += Console.c ;
57 }
58 if $(BUILD_CURSES)
59 {
60 SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Curses ;
61 SOURCES += Curses.c ;
62 }
63 if $(BUILD_WINDOWS)
64 {
65 SEARCH_SOURCE += $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Win ;
66 SOURCES += Win.c ;
67 }
68
69 if $(BUILD_SHARED_LIB)
70 {
71 if $(NT)
72 {
73 # extra symbolic targets for building CUnit library
74 DEPENDS cunit CUnit libcunit : $(CUNIT_LIB_NAME)$(SUFSHR) ;
75
76 SubDirCcFlags -DCU_DLL -DCU_BUILD_DLL ;
77
78 Main $(CUNIT_LIB_NAME)$(SUFSHR) : $(SOURCES) ;
79 MakeLocate $(CUNIT_LIB_NAME)$(SUFSHR) : $(BUILD_DIR) ;
80
81 if $(BCCROOT) || ( $(TOOLSET) = BORLANDC )
82 {
83 LINKFLAGS on $(CUNIT_LIB_NAME)$(SUFSHR) += -WD -lGi ;
84 }
85 else if $(MSVCNT) || ( $(TOOLSET) = VISUALC )
86 {
87 LINKFLAGS on $(CUNIT_LIB_NAME)$(SUFSHR) = $(LINKFLAGS) /DLL /IMPLIB:$(BUILD_DIR)$(SLASH)$(CUNIT_LIB_NAME)_dll$(SUFLIB) ;
88 }
89 else if $(MINGW) || ( $(TOOLSET) = MINGW )
90 {
91 SubDirCcFlags -fPIC ;
92 LINKFLAGS on $(CUNIT_LIB_NAME)$(SUFSHR) +=
93 -shared
94 libcunit_dll.def
95 -Wl,--out-implib,$(BUILD_DIR)$(SLASH)$(CUNIT_LIB_NAME)_dll$(SUFLIB)
96 ;
97 }
98 else
99 {
100 EXIT Building of CUnit shared library is not supported for this compiler on Windows. ;
101 }
102
103 MakeImportLibrary $(CUNIT_LIB_NAME)$(SUFSHR) : $(CUNIT_LIB_NAME)_dll$(SUFLIB) ;
104
105 # install import library
106 if $(INSTALL_LIB_DIR)
107 {
108 InstallLib $(INSTALL_LIB_DIR) : $(CUNIT_LIB_NAME)_dll$(SUFLIB) ;
109 }
110
111 # install shared library
112 if $(INSTALL_BIN_DIR)
113 {
114 InstallBin $(INSTALL_BIN_DIR) : $(CUNIT_LIB_NAME)$(SUFSHR) ;
115 }
116
117 }
118
119 else if $(UNIX) || ( $(OS) = LINUX )
120 {
121 # extra symbolic targets for building CUnit library
122 DEPENDS cunit CUnit libcunit : $(CUNIT_LIB_NAME)$(SUFSHR).$(VERSION).$(RELEASE) ;
123
124 Main $(CUNIT_LIB_NAME)$(SUFSHR).$(VERSION).$(RELEASE) : $(SOURCES) ;
125 MakeLocate $(CUNIT_LIB_NAME)$(SUFSHR).$(VERSION).$(RELEASE) : $(BUILD_DIR) ;
126
127 CCFLAGS on $(SOURCES) += -fPIC ;
128 LINKFLAGS on $(CUNIT_LIB_NAME)$(SUFSHR).$(VERSION).$(RELEASE) +=
129 -shared
130 -Wl,-soname,$(CUNIT_LIB_NAME)$(SUFSHR).$(VERSION_MAJOR)
131 ;
132
133 # install shared library
134 if $(INSTALL_LIB_DIR)
135 {
136 InstallLib $(INSTALL_BIN_DIR) : $(CUNIT_LIB_NAME)$(SUFSHR).$(VERSION).$(RELEASE) ;
137 }
138 }
139 }
140
141 if $(BUILD_STATIC_LIB)
142 {
143 Library $(CUNIT_LIB_NAME) : $(SOURCES) ;
144 MakeLocate $(CUNIT_LIB_NAME)$(SUFLIB) : $(BUILD_DIR) ;
145
146 # install static library
147 if $(INSTALL_LIB_DIR)
148 {
149 InstallLib $(INSTALL_LIB_DIR) : $(CUNIT_LIB_NAME)$(SUFLIB) ;
150 }
151
152 }
153
154 SubInclude TOP CUnit Headers ;
155 SubInclude TOP CUnit Sources Test ;
156
157