1 |
siliconforks |
332 |
# -*- Mode: makefile -*- |
2 |
|
|
# |
3 |
|
|
# ***** BEGIN LICENSE BLOCK ***** |
4 |
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
5 |
|
|
# |
6 |
|
|
# The contents of this file are subject to the Mozilla Public License Version |
7 |
|
|
# 1.1 (the "License"); you may not use this file except in compliance with |
8 |
|
|
# the License. You may obtain a copy of the License at |
9 |
|
|
# http://www.mozilla.org/MPL/ |
10 |
|
|
# |
11 |
|
|
# Software distributed under the License is distributed on an "AS IS" basis, |
12 |
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
13 |
|
|
# for the specific language governing rights and limitations under the |
14 |
|
|
# License. |
15 |
|
|
# |
16 |
|
|
# The Original Code is Mozilla Communicator client code, released |
17 |
|
|
# March 31, 1998. |
18 |
|
|
# |
19 |
|
|
# The Initial Developer of the Original Code is |
20 |
|
|
# Netscape Communications Corporation. |
21 |
|
|
# Portions created by the Initial Developer are Copyright (C) 1998 |
22 |
|
|
# the Initial Developer. All Rights Reserved. |
23 |
|
|
# |
24 |
|
|
# Contributor(s): |
25 |
|
|
# |
26 |
|
|
# Alternatively, the contents of this file may be used under the terms of |
27 |
|
|
# either of the GNU General Public License Version 2 or later (the "GPL"), |
28 |
|
|
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
29 |
|
|
# in which case the provisions of the GPL or the LGPL are applicable instead |
30 |
|
|
# of those above. If you wish to allow use of your version of this file only |
31 |
|
|
# under the terms of either the GPL or the LGPL, and not to allow others to |
32 |
|
|
# use your version of this file under the terms of the MPL, indicate your |
33 |
|
|
# decision by deleting the provisions above and replace them with the notice |
34 |
|
|
# and other provisions required by the GPL or the LGPL. If you do not delete |
35 |
|
|
# the provisions above, a recipient may use your version of this file under |
36 |
|
|
# the terms of any one of the MPL, the GPL or the LGPL. |
37 |
|
|
# |
38 |
|
|
# ***** END LICENSE BLOCK ***** |
39 |
|
|
|
40 |
|
|
DEPTH = ../.. |
41 |
|
|
topsrcdir = @top_srcdir@ |
42 |
|
|
srcdir = @srcdir@ |
43 |
|
|
|
44 |
|
|
include $(DEPTH)/config/autoconf.mk |
45 |
|
|
|
46 |
|
|
MODULE = js |
47 |
|
|
LIBRARY_NAME = mozjs |
48 |
|
|
GRE_MODULE = 1 |
49 |
|
|
|
50 |
|
|
ifdef GNU_CC |
51 |
|
|
ifdef INTEL_CC |
52 |
|
|
# icc gets special optimize flags |
53 |
|
|
ifdef MOZ_PROFILE_GENERATE |
54 |
|
|
MODULE_OPTIMIZE_FLAGS = -O0 |
55 |
|
|
else |
56 |
|
|
MODULE_OPTIMIZE_FLAGS = -O2 -ip |
57 |
|
|
#XXX: do we want different INTERP_OPTIMIZER flags here? |
58 |
|
|
endif |
59 |
|
|
else |
60 |
|
|
MODULE_OPTIMIZE_FLAGS = -Os -fstrict-aliasing $(MOZ_OPTIMIZE_SIZE_TWEAK) |
61 |
|
|
# Special optimization flags for jsinterp.c |
62 |
|
|
INTERP_OPTIMIZER = -O3 -fstrict-aliasing |
63 |
|
|
endif |
64 |
|
|
else |
65 |
|
|
ifeq ($(OS_ARCH),SunOS) |
66 |
|
|
MODULE_OPTIMIZE_FLAGS = -xO4 |
67 |
|
|
endif |
68 |
|
|
ifeq ($(OS_ARCH),WINNT) |
69 |
|
|
MODULE_OPTIMIZE_FLAGS = -O2 -GL |
70 |
|
|
endif |
71 |
|
|
endif |
72 |
|
|
|
73 |
|
|
ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) |
74 |
|
|
LIBRARY_NAME = js$(MOZ_BITS)$(VERSION_NUMBER) |
75 |
|
|
RESFILE = js$(MOZ_BITS)40.res |
76 |
|
|
endif |
77 |
|
|
|
78 |
|
|
PACKAGE_FILE = js.pkg |
79 |
|
|
|
80 |
|
|
# JavaScript must be built shared, even for static builds, as it is used by |
81 |
|
|
# other modules which are always built shared. Failure to do so results in |
82 |
|
|
# the js code getting copied into xpinstall and jsd as well as mozilla-bin, |
83 |
|
|
# and then the static data cells used for locking no longer work. |
84 |
|
|
|
85 |
|
|
ifndef JS_STATIC_BUILD |
86 |
|
|
FORCE_SHARED_LIB = 1 |
87 |
|
|
endif |
88 |
|
|
|
89 |
|
|
ifeq (86,$(findstring 86,$(OS_TEST))) |
90 |
|
|
ifeq (64,$(findstring 64,$(OS_TEST))) |
91 |
|
|
else |
92 |
|
|
DEFINES += -DAVMPLUS_IA32 |
93 |
|
|
NANOJIT_ARCH = i386 |
94 |
|
|
ENABLE_JIT = 1 |
95 |
|
|
endif |
96 |
|
|
endif |
97 |
|
|
|
98 |
|
|
ifeq (arm,$(findstring arm,$(OS_TEST))) |
99 |
|
|
DEFINES += -DAVMPLUS_ARM |
100 |
|
|
NANOJIT_ARCH = ARM |
101 |
|
|
ENABLE_JIT = 1 |
102 |
|
|
endif |
103 |
|
|
|
104 |
|
|
ifneq (,$(filter Linux Darwin SunOS FreeBSD,$(OS_ARCH))) |
105 |
|
|
DEFINES += -DAVMPLUS_UNIX |
106 |
|
|
endif |
107 |
|
|
|
108 |
|
|
ifeq ($(OS_ARCH),Linux) |
109 |
|
|
DEFINES += -DAVMPLUS_LINUX |
110 |
|
|
endif |
111 |
|
|
|
112 |
|
|
ifeq ($(OS_ARCH),WINNT) |
113 |
|
|
DEFINES += -DAVMPLUS_WIN32 |
114 |
|
|
endif |
115 |
|
|
|
116 |
|
|
VPATH = $(srcdir) |
117 |
|
|
|
118 |
|
|
CPPSRCS = \ |
119 |
|
|
jsapi.cpp \ |
120 |
|
|
jsarena.cpp \ |
121 |
|
|
jsarray.cpp \ |
122 |
|
|
jsatom.cpp \ |
123 |
|
|
jsbool.cpp \ |
124 |
|
|
jscntxt.cpp \ |
125 |
|
|
jsdate.cpp \ |
126 |
|
|
jsdbgapi.cpp \ |
127 |
|
|
jsdhash.cpp \ |
128 |
|
|
jsdtoa.cpp \ |
129 |
|
|
jsemit.cpp \ |
130 |
|
|
jsexn.cpp \ |
131 |
|
|
jsfun.cpp \ |
132 |
|
|
jsgc.cpp \ |
133 |
|
|
jshash.cpp \ |
134 |
|
|
jsinterp.cpp \ |
135 |
|
|
jsinvoke.cpp \ |
136 |
|
|
jsiter.cpp \ |
137 |
|
|
jslock.cpp \ |
138 |
|
|
jslog2.cpp \ |
139 |
|
|
jslong.cpp \ |
140 |
|
|
jsmath.cpp \ |
141 |
|
|
jsnum.cpp \ |
142 |
|
|
jsobj.cpp \ |
143 |
|
|
json.cpp \ |
144 |
|
|
jsopcode.cpp \ |
145 |
|
|
jsparse.cpp \ |
146 |
|
|
jsprf.cpp \ |
147 |
|
|
jsregexp.cpp \ |
148 |
|
|
jsscan.cpp \ |
149 |
|
|
jsscope.cpp \ |
150 |
|
|
jsscript.cpp \ |
151 |
|
|
jsstr.cpp \ |
152 |
|
|
jsutil.cpp \ |
153 |
|
|
jsxdrapi.cpp \ |
154 |
|
|
jsxml.cpp \ |
155 |
|
|
prmjtime.cpp \ |
156 |
|
|
$(NULL) |
157 |
|
|
|
158 |
|
|
ifdef HAVE_DTRACE |
159 |
|
|
CSRCS += \ |
160 |
|
|
jsdtracef.c |
161 |
|
|
endif |
162 |
|
|
|
163 |
|
|
EXPORTS = \ |
164 |
|
|
jsautocfg.h \ |
165 |
|
|
jsautokw.h \ |
166 |
|
|
js.msg \ |
167 |
|
|
jsapi.h \ |
168 |
|
|
jsarray.h \ |
169 |
|
|
jsarena.h \ |
170 |
|
|
jsatom.h \ |
171 |
|
|
jsbit.h \ |
172 |
|
|
jsbool.h \ |
173 |
|
|
jsclist.h \ |
174 |
|
|
jscntxt.h \ |
175 |
|
|
jscompat.h \ |
176 |
|
|
jsdate.h \ |
177 |
|
|
jsdbgapi.h \ |
178 |
|
|
jsdhash.h \ |
179 |
|
|
jsdtoa.h \ |
180 |
|
|
jsemit.h \ |
181 |
|
|
jsfun.h \ |
182 |
|
|
jsgc.h \ |
183 |
|
|
jshash.h \ |
184 |
|
|
jsinterp.h \ |
185 |
|
|
jsiter.h \ |
186 |
|
|
jslock.h \ |
187 |
|
|
jslong.h \ |
188 |
|
|
jsmath.h \ |
189 |
|
|
jsnum.h \ |
190 |
|
|
jsobj.h \ |
191 |
|
|
json.h \ |
192 |
|
|
jsopcode.tbl \ |
193 |
|
|
jsopcode.h \ |
194 |
|
|
jsotypes.h \ |
195 |
|
|
jsparse.h \ |
196 |
|
|
jsprf.h \ |
197 |
|
|
jsproto.tbl \ |
198 |
|
|
jsprvtd.h \ |
199 |
|
|
jspubtd.h \ |
200 |
|
|
jsregexp.h \ |
201 |
|
|
jsscan.h \ |
202 |
|
|
jsscope.h \ |
203 |
|
|
jsscript.h \ |
204 |
|
|
jsstddef.h \ |
205 |
|
|
jsstr.h \ |
206 |
|
|
jstracer.h \ |
207 |
|
|
jstypes.h \ |
208 |
|
|
jsutil.h \ |
209 |
|
|
jsversion.h \ |
210 |
|
|
jsxdrapi.h \ |
211 |
|
|
jsxml.h \ |
212 |
|
|
$(NULL) |
213 |
|
|
|
214 |
|
|
ifdef ENABLE_JIT |
215 |
|
|
VPATH += $(srcdir)/nanojit |
216 |
|
|
|
217 |
|
|
EXPORTS += \ |
218 |
|
|
Assembler.h \ |
219 |
|
|
LIR.h \ |
220 |
|
|
avmplus.h \ |
221 |
|
|
vm_fops.h \ |
222 |
|
|
Fragmento.h \ |
223 |
|
|
Native.h \ |
224 |
|
|
Native$(NANOJIT_ARCH).h \ |
225 |
|
|
RegAlloc.h \ |
226 |
|
|
nanojit.h \ |
227 |
|
|
builtins.tbl \ |
228 |
|
|
$(NULL) |
229 |
|
|
|
230 |
|
|
CPPSRCS += \ |
231 |
|
|
jstracer.cpp \ |
232 |
|
|
Assembler.cpp \ |
233 |
|
|
Fragmento.cpp \ |
234 |
|
|
LIR.cpp \ |
235 |
|
|
RegAlloc.cpp \ |
236 |
|
|
avmplus.cpp \ |
237 |
|
|
Native$(NANOJIT_ARCH).cpp \ |
238 |
|
|
jsbuiltins.cpp \ |
239 |
|
|
$(NULL) |
240 |
|
|
|
241 |
|
|
ifdef DEBUG |
242 |
|
|
EXPORTS += TraceTreeDrawer.h |
243 |
|
|
CPPSRCS += TraceTreeDrawer.cpp |
244 |
|
|
endif |
245 |
|
|
|
246 |
|
|
DEFINES += -DFEATURE_NANOJIT -DJS_TRACER |
247 |
|
|
endif |
248 |
|
|
|
249 |
|
|
ifdef HAVE_DTRACE |
250 |
|
|
EXPORTS += \ |
251 |
|
|
jsdtracef.h \ |
252 |
|
|
javascript-trace.h \ |
253 |
|
|
$(NULL) |
254 |
|
|
endif |
255 |
|
|
|
256 |
|
|
ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) |
257 |
|
|
EXPORTS += jscpucfg.h |
258 |
|
|
endif |
259 |
|
|
|
260 |
|
|
JS_SAFE_ARENA = 1 |
261 |
|
|
|
262 |
|
|
DASH_R = -r |
263 |
|
|
|
264 |
|
|
ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH))) |
265 |
|
|
SDK_LIBRARY = $(IMPORT_LIBRARY) |
266 |
|
|
else |
267 |
|
|
SDK_LIBRARY = $(SHARED_LIBRARY) |
268 |
|
|
endif |
269 |
|
|
|
270 |
|
|
include $(topsrcdir)/config/config.mk |
271 |
|
|
|
272 |
|
|
EXTRA_DSO_LDOPTS += $(NSPR_LIBS) |
273 |
|
|
|
274 |
|
|
ifdef MOZ_MEMORY |
275 |
|
|
ifeq ($(OS_ARCH),SunOS) |
276 |
|
|
EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DIST)/lib) |
277 |
|
|
endif |
278 |
|
|
endif |
279 |
|
|
|
280 |
|
|
# When using gcc the assembly is inlined in the C-file (see jslock.cpp) |
281 |
|
|
ifeq ($(OS_ARCH),SunOS) |
282 |
|
|
ifneq (86,$(findstring 86,$(OS_TEST))) |
283 |
|
|
ifndef GNU_CC |
284 |
|
|
ASFILES = lock_$(OS_ARCH).s |
285 |
|
|
endif |
286 |
|
|
endif |
287 |
|
|
endif |
288 |
|
|
|
289 |
|
|
ifndef BUILD_OPT |
290 |
|
|
MOCHAFILE = 1 |
291 |
|
|
endif |
292 |
|
|
|
293 |
|
|
ifndef NSBUILDROOT |
294 |
|
|
JSJAVA_STUBHEADERS = \ |
295 |
|
|
-I$(topsrcdir)/sun-java/include/_gen \ |
296 |
|
|
-I$(topsrcdir)/sun-java/netscape/javascript/_jri \ |
297 |
|
|
-I$(topsrcdir)/sun-java/netscape/security/_jri |
298 |
|
|
else |
299 |
|
|
JSJAVA_STUBHEADERS = -I$(JRI_GEN_DIR) -I$(JDK_GEN_DIR) |
300 |
|
|
endif |
301 |
|
|
|
302 |
|
|
JSJAVA_CFLAGS = \ |
303 |
|
|
-I$(topsrcdir)/sun-java/md-include \ |
304 |
|
|
-I$(topsrcdir)/sun-java/include \ |
305 |
|
|
$(JSJAVA_STUBHEADERS) |
306 |
|
|
|
307 |
|
|
# Define keyword generator before rules.mk, see bug 323979 comment 50 |
308 |
|
|
|
309 |
|
|
HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX) |
310 |
|
|
GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX) |
311 |
|
|
|
312 |
|
|
HOST_SIMPLE_PROGRAMS += host_jsoplengen$(HOST_BIN_SUFFIX) |
313 |
|
|
GARBAGE += jsautooplen.h host_jsoplengen$(HOST_BIN_SUFFIX) |
314 |
|
|
|
315 |
|
|
USE_HOST_CXX = 1 |
316 |
|
|
|
317 |
|
|
ifdef HAVE_DTRACE |
318 |
|
|
ifneq ($(OS_ARCH),Darwin) |
319 |
|
|
DTRACE_PROBE_OBJ = $(LIBRARY_NAME)-dtrace.$(OBJ_SUFFIX) |
320 |
|
|
endif |
321 |
|
|
MOZILLA_DTRACE_SRC = $(srcdir)/javascript-trace.d |
322 |
|
|
endif |
323 |
|
|
|
324 |
|
|
include $(topsrcdir)/config/rules.mk |
325 |
|
|
|
326 |
|
|
# our build system doesn't handle subdir srcs very gracefully today |
327 |
|
|
export:: |
328 |
|
|
mkdir -p nanojit |
329 |
|
|
|
330 |
|
|
DEFINES += -DEXPORT_JS_API |
331 |
|
|
|
332 |
|
|
INCLUDES += -I$(srcdir) |
333 |
|
|
|
334 |
|
|
# MSVC '-Gy' cc flag and '/OPT:REF' linker flag cause JS_GetArgument and |
335 |
|
|
# JS_GetLocalVariable to be folded to the same address by the linker, |
336 |
|
|
# leading to a crash on startup. See bug 151066. So, in optimized builds, |
337 |
|
|
# add the /OPT:NOICF flag, which turns off 'identical COMDAT folding'. |
338 |
|
|
# |
339 |
|
|
# N.B.: 'identical COMDAT folding' that folds functions whose addresses |
340 |
|
|
# are taken violates the ISO C and C++ standards. |
341 |
|
|
ifndef MOZ_DEBUG |
342 |
|
|
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH)) |
343 |
|
|
LDFLAGS += -OPT:NOICF |
344 |
|
|
endif |
345 |
|
|
endif |
346 |
|
|
|
347 |
|
|
GARBAGE += jscpucfg.o jsautocfg.h jsautocfg.tmp jscpucfg |
348 |
|
|
|
349 |
|
|
ifneq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH))) |
350 |
|
|
TARGETS += jscpucfg$(HOST_BIN_SUFFIX) |
351 |
|
|
endif |
352 |
|
|
|
353 |
|
|
ifdef JS_SAFE_ARENA |
354 |
|
|
DEFINES += -DJS_USE_SAFE_ARENA |
355 |
|
|
endif |
356 |
|
|
|
357 |
|
|
ifdef JS_THREADSAFE |
358 |
|
|
DEFINES += -DJS_THREADSAFE |
359 |
|
|
endif |
360 |
|
|
|
361 |
|
|
ifdef JS_NO_THIN_LOCKS |
362 |
|
|
DEFINES += -DJS_USE_ONLY_NSPR_LOCKS |
363 |
|
|
endif |
364 |
|
|
|
365 |
|
|
ifdef JS_VERSION |
366 |
|
|
DEFINES += -DJS_VERSION=$(JS_VERSION) |
367 |
|
|
endif |
368 |
|
|
|
369 |
|
|
ifneq ($(findstring -L,$(NSPR_LIBS)),) |
370 |
|
|
NSPR_STATIC_PATH = $(subst -L,,$(findstring -L,$(NSPR_LIBS))) |
371 |
|
|
else |
372 |
|
|
NSPR_STATIC_PATH = $(DIST)/lib |
373 |
|
|
endif |
374 |
|
|
|
375 |
|
|
ifdef MOZ_SHARK |
376 |
|
|
CFLAGS += -F/System/Library/PrivateFrameworks |
377 |
|
|
CXXFLAGS += -F/System/Library/PrivateFrameworks |
378 |
|
|
LDFLAGS += -F/System/Library/PrivateFrameworks -framework CHUD |
379 |
|
|
endif |
380 |
|
|
|
381 |
|
|
ifdef MOZ_VTUNE |
382 |
|
|
CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include |
383 |
|
|
EXTRA_DSO_LDOPTS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib |
384 |
|
|
LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib |
385 |
|
|
endif |
386 |
|
|
|
387 |
|
|
# BeOS and HP-UX do not require the extra linking of "-lm" |
388 |
|
|
ifeq (,$(filter BeOS HP-UX WINNT WINCE OpenVMS,$(OS_ARCH))) |
389 |
|
|
EXTRA_LIBS += -lm |
390 |
|
|
endif |
391 |
|
|
|
392 |
|
|
# Prevent floating point errors caused by VC++ optimizations |
393 |
|
|
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_) |
394 |
|
|
ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER))) |
395 |
|
|
CFLAGS += -Op |
396 |
|
|
else |
397 |
|
|
CFLAGS += -fp:precise |
398 |
|
|
endif |
399 |
|
|
endif # WINNT |
400 |
|
|
|
401 |
|
|
ifeq ($(OS_ARCH),FreeBSD) |
402 |
|
|
EXTRA_LIBS += -pthread |
403 |
|
|
endif |
404 |
|
|
ifeq ($(OS_ARCH),IRIX) |
405 |
|
|
ifdef USE_N32 |
406 |
|
|
DASH_R += -n32 |
407 |
|
|
endif |
408 |
|
|
endif |
409 |
|
|
ifeq ($(OS_ARCH),Linux) |
410 |
|
|
EXTRA_LIBS += -ldl |
411 |
|
|
endif |
412 |
|
|
ifeq ($(OS_ARCH),OSF1) |
413 |
|
|
EXTRA_LIBS += -lc_r |
414 |
|
|
endif |
415 |
|
|
ifeq ($(OS_ARCH),SunOS) |
416 |
|
|
ifeq ($(TARGET_CPU),sparc) |
417 |
|
|
|
418 |
|
|
ifdef JS_ULTRASPARC_OPTS |
419 |
|
|
DEFINES += -DULTRA_SPARC |
420 |
|
|
ifdef GNU_CC |
421 |
|
|
CFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0 |
422 |
|
|
CXXFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0,-K,PIC |
423 |
|
|
else |
424 |
|
|
ASFLAGS += -xarch=v8plus -DULTRA_SPARC -P -L -D_ASM -D__STDC__=0 -K PIC |
425 |
|
|
endif # GNU_CC |
426 |
|
|
endif # JS_ULTRASPARC_OPTS |
427 |
|
|
|
428 |
|
|
endif |
429 |
|
|
ifeq ($(OS_RELEASE),4.1) |
430 |
|
|
EXTRA_LIBS += -ldl -lnsl |
431 |
|
|
else |
432 |
|
|
EXTRA_LIBS += -lposix4 -ldl -lnsl -lsocket |
433 |
|
|
endif |
434 |
|
|
endif |
435 |
|
|
|
436 |
|
|
ifdef MOZ_MEMORY |
437 |
|
|
ifeq ($(OS_ARCH),Darwin) |
438 |
|
|
LDFLAGS += -ljemalloc |
439 |
|
|
endif |
440 |
|
|
endif |
441 |
|
|
|
442 |
|
|
# Sun Studio x86 has an optimization bug with LIR.cpp, use -xO2 instead. |
443 |
|
|
ifeq ($(OS_ARCH),SunOS) |
444 |
|
|
ifeq (86,$(findstring 86,$(OS_TEST))) |
445 |
|
|
ifndef GNU_CC |
446 |
|
|
LIR.o: LIR.cpp Makefile.in |
447 |
|
|
$(REPORT_BUILD) |
448 |
|
|
@$(MAKE_DEPS_AUTO_CXX) |
449 |
|
|
$(CXX) -o $@ -c $(patsubst -xO%,-xO2,$(COMPILE_CFLAGS)) $< |
450 |
|
|
endif |
451 |
|
|
endif |
452 |
|
|
endif |
453 |
|
|
|
454 |
|
|
# Allow building jsinterp.c with special optimization flags |
455 |
|
|
ifdef INTERP_OPTIMIZER |
456 |
|
|
jsinterp.$(OBJ_SUFFIX): MODULE_OPTIMIZE_FLAGS=$(INTERP_OPTIMIZER) |
457 |
|
|
endif |
458 |
|
|
|
459 |
|
|
ifeq ($(OS_ARCH),IRIX) |
460 |
|
|
ifndef GNU_CC |
461 |
|
|
_COMPILE_CFLAGS = $(patsubst -O%,-O1,$(COMPILE_CFLAGS)) |
462 |
|
|
jsapi.o jsxdrapi.o jsarena.o jsarray.o jsatom.o jsemit.o jsfun.o jsinterp.o jsregexp.o jsparse.o jsopcode.o jsscript.o: %.o: %.cpp Makefile.in |
463 |
|
|
$(REPORT_BUILD) |
464 |
|
|
@$(MAKE_DEPS_AUTO_CXX) |
465 |
|
|
$(CXX) -o $@ -c $(_COMPILE_CFLAGS) $< |
466 |
|
|
endif |
467 |
|
|
endif |
468 |
|
|
|
469 |
|
|
# An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result. |
470 |
|
|
# This suppresses optimization for this single compilation unit. |
471 |
|
|
ifeq ($(OS_ARCH),AIX) |
472 |
|
|
jsatom.o: jsatom.cpp Makefile.in |
473 |
|
|
$(REPORT_BUILD) |
474 |
|
|
@$(MAKE_DEPS_AUTO_CXX) |
475 |
|
|
$(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $< |
476 |
|
|
jsdtoa.o: jsdtoa.cpp Makefile.in |
477 |
|
|
$(REPORT_BUILD) |
478 |
|
|
@$(MAKE_DEPS_AUTO_CXX) |
479 |
|
|
$(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $< |
480 |
|
|
endif |
481 |
|
|
|
482 |
|
|
jsopcode.h jsopcode.cpp: jsopcode.tbl |
483 |
|
|
|
484 |
|
|
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH))) |
485 |
|
|
jsautocfg.h: |
486 |
|
|
touch $@ |
487 |
|
|
else |
488 |
|
|
ifeq ($(OS_ARCH),WINCE) |
489 |
|
|
jsautocfg.h: |
490 |
|
|
touch $@ |
491 |
|
|
else |
492 |
|
|
jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX) |
493 |
|
|
@rm -f $@ jsautocfg.tmp |
494 |
|
|
./jscpucfg > jsautocfg.tmp |
495 |
|
|
mv jsautocfg.tmp $@ |
496 |
|
|
endif |
497 |
|
|
endif |
498 |
|
|
|
499 |
|
|
# jscpucfg is a strange target |
500 |
|
|
# Needs to be built with the host compiler but needs to include |
501 |
|
|
# the mdcpucfg for the target so it needs the appropriate target defines |
502 |
|
|
ifdef HOST_NSPR_MDCPUCFG |
503 |
|
|
HOST_CXX := $(HOST_CXX) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG) |
504 |
|
|
HOST_CXXFLAGS := $(patsubst -DXP_%,,$(HOST_CXXFLAGS)) |
505 |
|
|
endif |
506 |
|
|
|
507 |
|
|
ifdef CROSS_COMPILE |
508 |
|
|
# jscpucfg needs to know when it's supposed to produce a config for the target |
509 |
|
|
JSCPUCFG_DEFINES = $(ACDEFINES) |
510 |
|
|
|
511 |
|
|
# This is incredibly hacky. Darwin NSPR uses the same MDCPUCFG for multiple |
512 |
|
|
# processors, and determines which processor to configure for based on |
513 |
|
|
# #ifdef i386. This macro is among the NSPR defines, but is also automatically |
514 |
|
|
# defined by the compiler when building for i386. It therefore needs to be |
515 |
|
|
# defined here if targeting i386, and explicitly undefined otherwise. |
516 |
|
|
ifeq ($(OS_ARCH),Darwin) |
517 |
|
|
ifeq ($(TARGET_CPU),powerpc) |
518 |
|
|
JSCPUCFG_DEFINES += -Ui386 |
519 |
|
|
else |
520 |
|
|
JSCPUCFG_DEFINES += -Di386=1 |
521 |
|
|
endif |
522 |
|
|
endif |
523 |
|
|
endif |
524 |
|
|
|
525 |
|
|
ifeq ($(OS_ARCH),QNX) |
526 |
|
|
ifneq ($(OS_TARGET),NTO) |
527 |
|
|
# QNX's compiler apparently can't build a binary directly from a source file. |
528 |
|
|
jscpucfg.o: jscpucfg.cpp Makefile.in |
529 |
|
|
$(HOST_CXX) $(HOST_CXXFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $< |
530 |
|
|
|
531 |
|
|
jscpucfg: jscpucfg.o |
532 |
|
|
$(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $< |
533 |
|
|
endif |
534 |
|
|
else |
535 |
|
|
ifeq ($(OS_ARCH),WINCE) |
536 |
|
|
jscpucfg$(HOST_BIN_SUFFIX): |
537 |
|
|
echo no need to build jscpucfg $< |
538 |
|
|
else |
539 |
|
|
jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in |
540 |
|
|
$(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $< |
541 |
|
|
endif |
542 |
|
|
endif |
543 |
|
|
|
544 |
|
|
# Extra dependancies and rules for auto-generated headers |
545 |
|
|
host_jskwgen.$(OBJ_SUFFIX): jsversion.h jskeyword.tbl |
546 |
|
|
|
547 |
|
|
jsautokw.h: host_jskwgen$(HOST_BIN_SUFFIX) |
548 |
|
|
./host_jskwgen$(HOST_BIN_SUFFIX) $@ |
549 |
|
|
|
550 |
|
|
host_jsoplengen.$(OBJ_SUFFIX): jsopcode.tbl |
551 |
|
|
|
552 |
|
|
jsautooplen.h: host_jsoplengen$(HOST_BIN_SUFFIX) |
553 |
|
|
./host_jsoplengen$(HOST_BIN_SUFFIX) $@ |
554 |
|
|
|
555 |
|
|
# Force auto-header generation before compiling any source that may use them |
556 |
|
|
$(CPPSRCS:%.cpp=%.$(OBJ_SUFFIX)): jsautokw.h jsautooplen.h |
557 |
|
|
|
558 |
|
|
ifdef HAVE_DTRACE |
559 |
|
|
javascript-trace.h: $(srcdir)/javascript-trace.d |
560 |
|
|
dtrace -h -s $(srcdir)/javascript-trace.d -o javascript-trace.h.in |
561 |
|
|
sed 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \ |
562 |
|
|
javascript-trace.h.in > javascript-trace.h |
563 |
|
|
endif |