xref: /trunk/main/stlport/makefile.mk (revision 7871dc3e)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24PRJ=.
25
26PRJNAME=so_stlport
27TARGET=so_stlport
28
29# --- Settings -----------------------------------------------------
30
31.INCLUDE :	settings.mk
32
33.IF "$(USE_SYSTEM_STL)"=="YES"
34
35.IF "$(OS)"=="SOLARIS" && "$(COM)"!="GCC"
36# System STL when building with SunStudio is just a version of STLport
37# which comes with the compiler
38all:
39	@echo "Nothing to do"
40.ELSE #"$(OS)"=="SOLARIS" && "$(COM)"!="GCC"
41#
42# If you choose to build without stlport, some headers will be used to bring the
43# sgi extensions into the std namespace:
44$(INCCOM)$/stlport$/functional \
45$(INCCOM)$/stlport$/hash_map \
46$(INCCOM)$/stlport$/hash_set \
47$(INCCOM)$/stlport$/numeric \
48$(INCCOM)$/stlport$/slist \
49$(INCCOM)$/stlport$/rope \
50$(INCCOM)$/stlport$/vector: systemstl$/$$(@:f)
51    $(MKDIRHIER) $(@:d)
52    $(COPY) $< $@
53.ENDIF #"$(OS)"=="SOLARIS" && "$(COM)"!="GCC"
54
55.ELSE # "$(USE_SYSTEM_STL)"
56
57# --- Files --------------------------------------------------------
58.EXPORT : CC CXX
59.IF "$(COMID)"=="gcc3"
60	TARFILE_NAME=STLport-4.5
61    TARFILE_MD5=18f577b374d60b3c760a3a3350407632
62    PATCH_FILES=STLport-4.5.patch STLport-4.5-gcc43_warnings.patch
63.ELIF "$(GUI)"=="WNT"
64    .IF "$(CCNUMVER)"<="001300000000"
65        TARFILE_NAME=STLport-4.0
66        TARFILE_MD5=c441926f3a552ed3e5b274b62e86af16
67        PATCH_FILES=STLport-4.0.patch
68    .ELSE
69        TARFILE_NAME=STLport-4.5-0119
70        TARFILE_MD5=7376930b0d3f3d77a685d94c4a3acda8
71        PATCH_FILES=STLport-4.5-0119.patch
72    .ENDIF
73.ELSE
74    TARFILE_NAME=STLport-4.0
75    TARFILE_MD5=c441926f3a552ed3e5b274b62e86af16
76    PATCH_FILES=STLport-4.0.patch STLport-4.0-sunstudio12u1.patch
77        # To disable warnings from within STLport headers on unxsoli4 and
78        # unxsols4, STLport-4.0.patch had to be extended mechanically by
79        #
80        #   cd unxsol.../misc/build/STLport-4.0/stlport && \
81        #   find . -type f -exec sed -i \
82        #     -e 's/^\([ \t]*__STL_BEGIN_NAMESPACE[ \t]*\)$/#if defined \
83        #       __SUNPRO_CC\n#pragma disable_warn\n#endif\n&/' \
84        #     -e 's/^\([ \t]*__STL_END_NAMESPACE[ \t]*\)$/&\n#if defined \
85        #       __SUNPRO_CC\n#pragma enable_warn\n#endif/' {} \;
86        #
87        # (causing lots of files to become modified) and by additionally
88        # changing unxsol.../misc/build/STLport-4.0/stlport/math.h,
89        # unxsol.../misc/build/STLport-4.0/stlport/stl/_config.h,
90        # unxsol.../misc/build/STLport-4.0/stlport/stl/_list.h, and
91        # unxsol.../misc/build/STLport-4.0/stlport/stl/type_traits.h manually.
92        # (Obviously due to the way the C++ compiler generates code for
93        # instantiations of inline function templates from STLport headers, it
94        # does not work to simply add "#pragma disable_warn" to stl/_prolog.h
95        # and "#pragma enable_warn" to stl/_epilog.h, as seemingly some internal
96        # STLport headers are read in by the compiler only at the end of a
97        # compilation unit, outside the scope of stl/_prolog.h and
98        # stl/_epilog.h.)
99.ENDIF
100
101ADDITIONAL_FILES=src$/gcc-3.0.mak src$/gcc-3.0-freebsd.mak src$/sunpro8.mak src$/sunpro11.mak src$/gcc-3.0-mingw.mak \
102	src$/gcc-3.0-os2.mak src$/gcc-3.0-os2.def src$/common_macros_os2.mak
103
104
105CONFIGURE_ACTION=none
106CONFIGURE_FLAGS=
107
108BUILD_DIR=src
109
110.IF "$(COM)"=="MSC"
111BUILD_ACTION=nmake
112.IF "$(CCNUMVER)"<="001400000000"
113BUILD_FLAGS=-f vc7.mak EXFLAGS="/EHsc"
114.ELSE			# "$(CCNUMVER)"<="001400000000"
115BUILD_FLAGS=-f vc7.mak EXFLAGS="/EHa /Zc:wchar_t-" CCNUMVER=$(CCNUMVER)
116.ENDIF			# "$(CCNUMVER)"<="001400000000"
117.ENDIF
118
119.IF "$(COM)"=="GCC"
120	.IF "$(COMID)"=="gcc3"
121		# FreeBSD needs a special makefile
122		.IF "$(OS)"=="FREEBSD"
123			BUILD_FLAGS=-f gcc-3.0-freebsd.mak
124		.ELIF "$(OS)"=="OS2"
125			BUILD_FLAGS=-f gcc-3.0-os2.mak
126		.ELIF "$(GUI)"=="WNT"
127			BUILD_FLAGS=-f gcc-3.0-mingw.mak
128		.ELSE
129			BUILD_FLAGS=-f gcc-3.0.mak
130		.ENDIF
131	.ELSE # "$(COMID)"=="gcc3"
132		.IF "$(OS)"=="FREEBSD"
133			BUILD_FLAGS=-f gcc-freebsd.mak
134		.ELSE
135			BUILD_FLAGS=-f gcc.mak
136		.ENDIF
137	.ENDIF # "$(COMID)"=="gcc3"
138	BUILD_ACTION=$(GNUMAKE)
139	# build in parallel
140	BUILD_FLAGS+= -j$(MAXPROCESS)
141.ENDIF
142.IF "$(HAVE_LD_HASH_STYLE)"  == "TRUE"
143CXX+= -Wl,--hash-style=both
144.ENDIF
145
146.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)"  == "TRUE"
147CXX+= -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
148.ENDIF
149
150.IF "$(COM)"=="C52"
151BUILD_ACTION=make
152.IF "$(CCNUMVER)">="00050008"
153BUILD_FLAGS=-f sunpro11.mak
154.ELIF "$(CCNUMVER)">="00050005"
155BUILD_FLAGS=-f sunpro8.mak
156.ELSE
157BUILD_FLAGS=-f sunpro6.mak
158.ENDIF # "$(CCNUMVER)">="00050008"
159
160OUT2INC= \
161    stlport$/SC5$/*.SUNWCCh
162.ENDIF
163
164OUTDIR2INC= \
165    stlport
166
167.IF "$(GUI)"=="WNT"
168.IF "$(COM)"=="GCC"
169
170OUT2LIB= \
171    lib$/lib*_static.a
172
173OUT2BIN= \
174    lib$/*.dll
175
176.ELSE
177
178OUT2LIB= \
179    lib$/*.lib
180
181OUT2BIN= \
182    lib$/*.dll \
183    lib$/*.pdb
184
185.ENDIF # "$(COM)"=="GCC"
186
187.ELIF "$(GUI)"=="OS2"
188
189OUT2LIB= lib$/*.lib
190OUT2BIN= lib$/*.dll
191
192.ELSE          # "$(GUI)"=="WNT"
193
194OUT2LIB= \
195    lib$/lib*
196
197.ENDIF          # "$(GUI)"=="WNT"
198
199# --- Targets ------------------------------------------------------
200
201.IF "$(STLPORT4)"!="NO_STLPORT4"
202all :
203       @echo "         An already available installation of STLport has been chosen in the configure process."
204       @echo "         Therefore the version provided here does not need to be built in addition."
205.ELIF "$(OS)"=="MACOSX"
206all:
207    @echo '--with-stlport=yes is not supported on Mac OS X'
208    false
209.ENDIF
210
211.INCLUDE : 	set_ext.mk
212.INCLUDE :	target.mk
213.INCLUDE :	tg_ext.mk
214
215.IF "$(GUI)"=="WNT"
216.IF "$(COM)"!="GCC"
217.IF "$(CCNUMVER)"<="001300000000"
218
219$(MISC)$/$(TARFILE_ROOTDIR) : avoid_win32_patches
220avoid_win32_patches :
221	@$(ECHONL)
222	@echo ERROR! this module can't use automated patch creation
223	@echo on windows.
224	@$(ECHONL)
225	force_dmake_to_error
226
227$(PACKAGE_DIR)$/so_custom_patch :  $(PACKAGE_DIR)$/$(PATCH_FLAG_FILE)
228    win32_custom.bat $(PACKAGE_DIR) $(BACK_PATH) && $(TOUCH) $@
229
230$(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/so_custom_patch
231
232.IF "$(USE_NEW_SDK)"!=""
233$(PACKAGE_DIR)$/win32_sdk_patch :  $(PACKAGE_DIR)$/$(PATCH_FLAG_FILE)
234    win32_sdk.bat $(PACKAGE_DIR) $(BACK_PATH) && $(TOUCH) $@
235
236$(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/win32_sdk_patch
237.ENDIF			# "$(USE_NEW_SDK)"!=""
238.ENDIF			# COMVER<=001300000000
239.ENDIF "$(COM)"=="GCC"
240.ENDIF          # "$(GUI)"=="WNT"
241
242.ENDIF # "$(USE_SYSTEM_STL)"
243