Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / security / coreconf / WIN32.mk
blobed92acb8ec0d18d07fac2e5afc454dc34e043dab
2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
13 # License.
15 # The Original Code is the Netscape security libraries.
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1994-2000
20 # the Initial Developer. All Rights Reserved.
22 # Contributor(s):
24 # Alternatively, the contents of this file may be used under the terms of
25 # either the GNU General Public License Version 2 or later (the "GPL"), or
26 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 # in which case the provisions of the GPL or the LGPL are applicable instead
28 # of those above. If you wish to allow use of your version of this file only
29 # under the terms of either the GPL or the LGPL, and not to allow others to
30 # use your version of this file under the terms of the MPL, indicate your
31 # decision by deleting the provisions above and replace them with the notice
32 # and other provisions required by the GPL or the LGPL. If you do not delete
33 # the provisions above, a recipient may use your version of this file under
34 # the terms of any one of the MPL, the GPL or the LGPL.
36 # ***** END LICENSE BLOCK *****
39 # Configuration common to all versions of Windows NT
40 # and Windows 95
43 DEFAULT_COMPILER = cl
45 ifdef NS_USE_GCC
46 CC = gcc
47 CCC = g++
48 LINK = ld
49 AR = ar
50 AR += cr $@
51 RANLIB = ranlib
52 BSDECHO = echo
53 RC = windres.exe -O coff --use-temp-file
54 LINK_DLL = $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
55 else
56 CC = cl
57 CCC = cl
58 LINK = link
59 AR = lib
60 AR += -NOLOGO -OUT:"$@"
61 RANLIB = echo
62 BSDECHO = echo
63 RC = rc.exe
64 MT = mt.exe
65 endif
67 ifdef BUILD_TREE
68 NSINSTALL_DIR = $(BUILD_TREE)/nss
69 else
70 NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
71 endif
72 NSINSTALL = nsinstall
74 MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
75 MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
76 # Note: MKDEPENDENCIES __MUST__ be a relative pathname, not absolute.
77 # If it is absolute, gmake will crash unless the named file exists.
78 MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk
80 INSTALL = $(NSINSTALL)
81 MAKE_OBJDIR = mkdir
82 MAKE_OBJDIR += $(OBJDIR)
83 GARBAGE += $(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb
84 XP_DEFINE += -DXP_PC
85 ifdef NS_USE_GCC
86 LIB_SUFFIX = a
87 else
88 LIB_SUFFIX = lib
89 endif
90 DLL_SUFFIX = dll
92 ifdef NS_USE_GCC
93 # The -mnop-fun-dllimport flag allows us to avoid a drawback of
94 # the dllimport attribute that a pointer to a function marked as
95 # dllimport cannot be used as as a constant address.
96 OS_CFLAGS += -mno-cygwin -mms-bitfields -mnop-fun-dllimport
97 _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
98 DLLFLAGS += -mno-cygwin -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
99 ifdef BUILD_OPT
100 ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
101 OPTIMIZER += -Os
102 else
103 OPTIMIZER += -O2
104 endif
105 DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
107 # Add symbolic information for a profiler
109 ifdef MOZ_PROFILE
110 OPTIMIZER += -g
111 endif
112 else
113 OPTIMIZER += -g
114 NULLSTRING :=
115 SPACE := $(NULLSTRING) # end of the line
116 USERNAME := $(subst $(SPACE),_,$(USERNAME))
117 USERNAME := $(subst -,_,$(USERNAME))
118 DEFINES += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME)
119 endif
120 else # !NS_USE_GCC
121 ifdef BUILD_OPT
122 OS_CFLAGS += -MD
123 ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
124 OPTIMIZER += -O1
125 else
126 OPTIMIZER += -O2
127 endif
128 DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
129 DLLFLAGS += -OUT:"$@"
131 # Add symbolic information for a profiler
133 ifdef MOZ_PROFILE
134 OPTIMIZER += -Z7
135 endif
136 ifdef MOZ_DEBUG_SYMBOLS
137 OPTIMIZER += -Zi
138 endif
139 ifneq (,$(MOZ_PROFILE)$(MOZ_DEBUG_SYMBOLS))
140 DLLFLAGS += -DEBUG -OPT:REF
141 LDFLAGS += -DEBUG -OPT:REF
142 endif
143 else
145 # Define USE_DEBUG_RTL if you want to use the debug runtime library
146 # (RTL) in the debug build
148 ifdef USE_DEBUG_RTL
149 OS_CFLAGS += -MDd
150 else
151 OS_CFLAGS += -MD
152 endif
153 OPTIMIZER += -Od -Z7
154 #OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od
155 NULLSTRING :=
156 SPACE := $(NULLSTRING) # end of the line
157 USERNAME := $(subst $(SPACE),_,$(USERNAME))
158 USERNAME := $(subst -,_,$(USERNAME))
159 DEFINES += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME)
160 DLLFLAGS += -DEBUG -OUT:"$@"
161 LDFLAGS += -DEBUG
162 ifndef MOZ_DEBUG_SYMBOLS
163 LDFLAGS += -PDB:NONE
164 endif
165 # Purify requires /FIXED:NO when linking EXEs.
166 LDFLAGS += /FIXED:NO
167 endif
168 endif # NS_USE_GCC
170 ifdef USE_64
171 DEFINES += -DWIN64
172 else
173 DEFINES += -DWIN32
174 endif
176 ifdef MAPFILE
177 ifndef NS_USE_GCC
178 DLLFLAGS += -DEF:$(MAPFILE)
179 endif
180 endif
181 # Change PROCESS to put the mapfile in the correct format for this platform
182 PROCESS_MAP_FILE = cp $< $@
186 # The following is NOT needed for the NSPR 2.0 library.
189 DEFINES += -D_WINDOWS
191 # override default, which is ASFLAGS = CFLAGS
192 ifdef NS_USE_GCC
193 AS = $(CC)
194 ASFLAGS = $(INCLUDES)
195 else
196 AS = ml.exe
197 ASFLAGS = -Cp -Sn -Zi -coff $(INCLUDES)
198 endif
201 # override the definitions of RELEASE_TREE found in tree.mk
203 ifndef RELEASE_TREE
204 ifdef BUILD_SHIP
205 ifdef USE_SHIPS
206 RELEASE_TREE = $(NTBUILD_SHIP)
207 else
208 RELEASE_TREE = //redbuild/components
209 endif
210 else
211 RELEASE_TREE = //redbuild/components
212 endif
213 endif
216 # override the definitions of IMPORT_LIB_PREFIX, LIB_PREFIX, and
217 # DLL_PREFIX in prefix.mk
220 ifndef IMPORT_LIB_PREFIX
221 ifdef NS_USE_GCC
222 IMPORT_LIB_PREFIX = lib
223 else
224 IMPORT_LIB_PREFIX = $(NULL)
225 endif
226 endif
228 ifndef LIB_PREFIX
229 ifdef NS_USE_GCC
230 LIB_PREFIX = lib
231 else
232 LIB_PREFIX = $(NULL)
233 endif
234 endif
236 ifndef DLL_PREFIX
237 DLL_PREFIX = $(NULL)
238 endif
241 # override the definitions of various _SUFFIX symbols in suffix.mk
245 # Object suffixes
247 ifndef OBJ_SUFFIX
248 ifdef NS_USE_GCC
249 OBJ_SUFFIX = .o
250 else
251 OBJ_SUFFIX = .obj
252 endif
253 endif
256 # Assembler source suffixes
258 ifndef ASM_SUFFIX
259 ifdef NS_USE_GCC
260 ASM_SUFFIX = .s
261 else
262 ASM_SUFFIX = .asm
263 endif
264 endif
267 # Library suffixes
270 ifndef IMPORT_LIB_SUFFIX
271 IMPORT_LIB_SUFFIX = .$(LIB_SUFFIX)
272 endif
274 ifndef DYNAMIC_LIB_SUFFIX_FOR_LINKING
275 DYNAMIC_LIB_SUFFIX_FOR_LINKING = $(IMPORT_LIB_SUFFIX)
276 endif
279 # Program suffixes
281 ifndef PROG_SUFFIX
282 PROG_SUFFIX = .exe
283 endif
286 # When the processor is NOT 386-based on Windows NT, override the
287 # value of $(CPU_TAG). For WinNT, 95, 16, not CE.
289 ifneq ($(CPU_ARCH),x386)
290 CPU_TAG = _$(CPU_ARCH)
291 endif
294 # override ruleset.mk, removing the "lib" prefix for library names, and
295 # adding the "32" after the LIBRARY_VERSION.
297 ifdef LIBRARY_NAME
298 SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).dll
299 IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).lib
300 endif
303 # override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY
305 ifndef TARGETS
306 TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM)
307 endif