1# Time-stamp: <07/05/31 01:03:15 ptr>
2#
3# Copyright (c) 1997-1999, 2002, 2003, 2005-2007
4# Petr Ovtchenkov
5#
6# Copyright (c) 2006, 2007
7# Francois Dumont
8#
9# Portion Copyright (c) 1999-2001
10# Parallel Graphics Ltd.
11#
12# Licensed under the Academic Free License version 3.0
13#
14
15ALL_TAGS = all-static all-shared
16ifdef LIBNAME
17INSTALL_TAGS = install-static install-shared
18else
19INSTALL_TAGS = install-shared
20endif
21
22ifneq ($(OSNAME),linux)
23
24# For Borland Cygwin/MSys are only build environment, they do not represent
25# the targetted OS so per default we keep all generated files in STLport
26# folder.
27BASE_INSTALL_DIR ?= ${STLPORT_DIR}
28
29CXX := bcc32
30CC := bcc32
31RC := brcc32
32
33DEFS ?=
34OPT ?=
35
36CFLAGS = -q -ff
37CXXFLAGS = -q -ff
38
39OPT += -w-ccc -w-rch -w-ngu -w-inl -w-eff
40
41# release-shared : OPT += -w-inl
42
43ifdef WITH_DYNAMIC_RTL
44release-static : OPT += -tWR
45dbg-static : OPT += -tWR
46stldbg-static : OPT += -tWR
47endif
48
49ifndef WITH_STATIC_RTL
50release-shared : OPT += -tWR
51dbg-shared : OPT += -tWR
52stldbg-shared : OPT += -tWR
53endif
54
55ifdef WITHOUT_RTTI
56OPT += -RT-
57endif
58
59ifndef WITHOUT_THREAD
60OPT += -tWM
61endif
62
63WINVER ?= 0x0501
64DEFS += -DWINVER=$(WINVER)
65
66OUTPUT_OPTION = -o$@
67LINK_OUTPUT_OPTION = $@
68CPPFLAGS = $(DEFS) $(OPT) $(INCLUDES)
69
70CDEPFLAGS = -E -M
71CCDEPFLAGS = -E -M
72RCFLAGS = -32 -r -i${STLPORT_INCLUDE_DIR} -dCOMP=bcc
73
74release-shared : RCFLAGS += -dBUILD_INFOS="-O2 -vi-"
75dbg-shared : RCFLAGS += -dBUILD=d -dBUILD_INFOS="-R -v -y -D_DEBUG"
76stldbg-shared : RCFLAGS += -dBUILD=stld -dBUILD_INFOS="-R -v -y -D_DEBUG -D_STLP_DEBUG"
77RC_OUTPUT_OPTION = -fo$@
78
79COMPILE.rc = ${RC} ${RCFLAGS}
80LINK.cc = ilink32 $(subst /,\\,$(LDFLAGS))
81
82LDFLAGS += -ap -D -Gn
83
84dbg-static : DEFS += -D_DEBUG
85dbg-shared : DEFS += -D_DEBUG
86stldbg-static : DEFS += -D_DEBUG
87stldbg-shared : DEFS += -D_DEBUG
88
89# STLport DEBUG mode specific defines
90stldbg-static :	    DEFS += -D_STLP_DEBUG
91stldbg-shared :     DEFS += -D_STLP_DEBUG
92stldbg-static-dep : DEFS += -D_STLP_DEBUG
93stldbg-shared-dep : DEFS += -D_STLP_DEBUG
94
95# optimization and debug compiler flags
96release-static : OPT += -O2 -vi-
97release-shared : OPT += -O2 -vi-
98
99LDLIBS += import32.lib kernel32.lib
100ifndef WITHOUT_THREAD
101ifndef WITH_STATIC_RTL
102release-shared : LDLIBS += cw32mti.lib
103dbg-shared : LDLIBS += cw32mti.lib
104stldbg-shared : LDLIBS += cw32mti.lib
105else
106release-shared : LDLIBS += cw32mt.lib
107dbg-shared : LDLIBS += cw32mt.lib
108stldbg-shared : LDLIBS += cw32mt.lib
109endif
110ifndef WITH_DYNAMIC_RTL
111release-static : LDLIBS += cw32mt.lib
112dbg-static : LDLIBS += cw32mt.lib
113stldbg-static : LDLIBS += cw32mt.lib
114else
115release-static : LDLIBS += cw32mti.lib
116dbg-static : LDLIBS += cw32mti.lib
117stldbg-static : LDLIBS += cw32mti.lib
118endif
119else
120ifndef WITH_STATIC_RTL
121release-shared : LDLIBS += cw32i.lib
122dbg-shared : LDLIBS += cw32i.lib
123stldbg-shared : LDLIBS += cw32i.lib
124else
125release-shared : LDLIBS += cw32.lib
126dbg-shared : LDLIBS += cw32.lib
127stldbg-shared : LDLIBS += cw32.lib
128endif
129ifndef WITH_DYNAMIC_RTL
130release-static : LDLIBS += cw32.lib
131dbg-static : LDLIBS += cw32.lib
132stldbg-static : LDLIBS += cw32.lib
133else
134release-static : LDLIBS += cw32i.lib
135dbg-static : LDLIBS += cw32i.lib
136stldbg-static : LDLIBS += cw32i.lib
137endif
138endif
139
140# map output option (see build/Makefiles/gmake/dmc.mak)
141
142MAP_OUTPUT_OPTION =
143
144else # linux
145
146CXX := bc++
147CC := bc++
148
149DEFS ?=
150OPT ?=
151
152CFLAGS = -q -ff -xp -w-par
153CXXFLAGS = -q -ff -xp -w-aus
154
155DEFS += -D_NO_VCL
156
157release-shared: DEFS += -D_RTLDLL
158dbg-shared:  DEFS += -D_RTLDLL
159stldbg-shared:  DEFS += -D_RTLDLL
160
161OPT += -w-ccc -w-rch -w-ngu -w-inl -w-eff
162
163ifdef WITHOUT_RTTI
164OPT += -RT-
165endif
166
167ifndef WITHOUT_THREAD
168DEFS += -D__MT__
169endif
170
171OUTPUT_OPTION = -o$@
172LINK_OUTPUT_OPTION = $@
173CPPFLAGS = $(DEFS) $(OPT) $(INCLUDES)
174
175LINK.cc = ilink $(LDFLAGS)
176
177LDFLAGS += -Gn
178
179dbg-static : DEFS += -D_DEBUG
180dbg-shared : DEFS += -D_DEBUG
181stldbg-static : DEFS += -D_DEBUG
182stldbg-shared : DEFS += -D_DEBUG
183
184# STLport DEBUG mode specific defines
185stldbg-static :     DEFS += -D_STLP_DEBUG
186stldbg-shared :     DEFS += -D_STLP_DEBUG
187stldbg-static-dep : DEFS += -D_STLP_DEBUG
188stldbg-shared-dep : DEFS += -D_STLP_DEBUG
189
190# optimization and debug compiler flags
191release-static : OPT += -O2 -vi-
192release-shared : OPT += -O2 -vi-
193
194dbg-static : OPT += -R -v -y
195dbg-shared : OPT += -R -v -y
196stldbg-static : OPT += -R -v -y
197stldbg-shared : OPT += -R -v -y
198
199ifndef WITHOUT_THREAD
200
201ifdef LIBNAME
202release-shared : LDLIBS += libborcrtl.so libborunwind.so libpthread.so.0 libc.so.6 libm.so libdl.so libc_nonshared.a
203dbg-shared : LDLIBS += libborcrtl.so libborunwind.so libpthread.so.0 libc.so.6 libm.so libdl.so libc_nonshared.a
204stldbg-shared : LDLIBS += libborcrtl.so libborunwind.so libpthread.so.0 libc.so.6 libm.so libdl.so libc_nonshared.a
205endif
206
207ifdef PRGNAME
208release-shared : LDLIBS += libborcrtl.so libborunwind.so libpthread.so.0 libc.so.6 libm.so libdl.so ../../../lib/libstlport.so
209dbg-shared : LDLIBS += libborcrtl.so libborunwind.so libpthread.so.0 libc.so.6 libm.so libdl.so ../../../lib/libstlportg.so
210stldbg-shared : LDLIBS += libborcrtl.so libborunwind.so libpthread.so.0 libc.so.6 libm.so libdl.so ../../../lib/libstlportstlg.so
211release-static : LDLIBS += libborcrtl.a libborunwind.a libpthread.so.0 libc.so.6 libm.so libdl.so libc_nonshared.a ../../../lib/libstlport.a
212dbg-static : LDLIBS += libborcrtl.a libborunwind.a libpthread.so.0 libc.so.6 libm.so libdl.so libc_nonshared.a ../../../lib/libstlportg.a
213stldbg-static : LDLIBS += libborcrtl.a libborunwind.a libpthread.so.0 libc.so.6 libm.so libdl.so libc_nonshared.a ../../../lib/libstlportstlg.a
214endif
215
216else # single-threaded
217
218ifdef LIBNAME
219release-shared : LDLIBS += libborcrtl.so libborunwind.so libc.so.6 libm.so libdl.so libc_nonshared.a
220dbg-shared : LDLIBS += libborcrtl.so libborunwind.so libc.so.6 libm.so libdl.so libc_nonshared.a
221stldbg-shared : LDLIBS += libborcrtl.so libborunwind.so libc.so.6 libm.so libdl.so libc_nonshared.a
222endif
223
224ifdef PRGNAME
225release-shared : LDLIBS += libborcrtl.so libborunwind.so libc.so.6 libm.so libdl.so ../../../lib/libstlport.so
226dbg-shared : LDLIBS += libborcrtl.so libborunwind.so libc.so.6 libm.so libdl.so ../../../lib/libstlportg.so
227stldbg-shared : LDLIBS += libborcrtl.so libborunwind.so libc.so.6 libm.so libdl.so ../../../lib/libstlportstlg.so
228release-static : LDLIBS += libborcrtl.a libborunwind.a libc.so.6 libm.so libdl.so libc_nonshared.a ../../../lib/libstlport.a
229dbg-static : LDLIBS += libborcrtl.a libborunwind.a libc.so.6 libm.so libdl.so libc_nonshared.a ../../../lib/libstlportg.a
230stldbg-static : LDLIBS += libborcrtl.a libborunwind.a libc.so.6 libm.so libdl.so libc_nonshared.a ../../../lib/libstlportst$
231endif
232
233endif
234
235# install dir defaults to /usr/local unless defined
236
237BASE_INSTALL_DIR ?= ${SRCROOT}/..
238
239endif # linux
240
241ifdef EXTRA_CXXFLAGS
242CXXFLAGS += $(EXTRA_CXXFLAGS)
243endif
244
245ifdef EXTRA_CFLAGS
246CFLAGS += $(EXTRA_CFLAGS)
247endif
248
249# dependency output parser (dependencies collector)
250DP_OUTPUT_DIR = | sed 's|\($*\)\.o[ :]*|$(OUTPUT_DIR)/\1.o $@ : |g' > $@; \
251                           [ -s $@ ] || rm -f $@
252
253DP_OUTPUT_DIR_DBG = | sed 's|\($*\)\.o[ :]*|$(OUTPUT_DIR_DBG)/\1.o $@ : |g' > $@; \
254                           [ -s $@ ] || rm -f $@
255
256DP_OUTPUT_DIR_STLDBG = | sed 's|\($*\)\.o[ :]*|$(OUTPUT_DIR_STLDBG)/\1.o $@ : |g' > $@; \
257                           [ -s $@ ] || rm -f $@
258
259