/[jscoverage]/trunk/js/Makefile.ref
ViewVC logotype

Contents of /trunk/js/Makefile.ref

Parent Directory Parent Directory | Revision Log Revision Log


Revision 507 - (show annotations)
Sun Jan 10 07:23:34 2010 UTC (9 years, 7 months ago) by siliconforks
File size: 10724 byte(s)
Update SpiderMonkey from Firefox 3.6rc1.

1 # -*- Mode: makefile -*-
2 # vim: ft=make
3 #
4 # ***** BEGIN LICENSE BLOCK *****
5 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 #
7 # The contents of this file are subject to the Mozilla Public License Version
8 # 1.1 (the "License"); you may not use this file except in compliance with
9 # the License. You may obtain a copy of the License at
10 # http://www.mozilla.org/MPL/
11 #
12 # Software distributed under the License is distributed on an "AS IS" basis,
13 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 # for the specific language governing rights and limitations under the
15 # License.
16 #
17 # The Original Code is Mozilla Communicator client code, released
18 # March 31, 1998.
19 #
20 # The Initial Developer of the Original Code is
21 # Netscape Communications Corporation.
22 # Portions created by the Initial Developer are Copyright (C) 1998
23 # the Initial Developer. All Rights Reserved.
24 #
25 # Contributor(s):
26 # Michael Ang <mang@subcarrier.org>
27 # Kevin Buhr <buhr@stat.wisc.edu>
28 #
29 # Alternatively, the contents of this file may be used under the terms of
30 # either of the GNU General Public License Version 2 or later (the "GPL"),
31 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
32 # in which case the provisions of the GPL or the LGPL are applicable instead
33 # of those above. If you wish to allow use of your version of this file only
34 # under the terms of either the GPL or the LGPL, and not to allow others to
35 # use your version of this file under the terms of the MPL, indicate your
36 # decision by deleting the provisions above and replace them with the notice
37 # and other provisions required by the GPL or the LGPL. If you do not delete
38 # the provisions above, a recipient may use your version of this file under
39 # the terms of any one of the MPL, the GPL or the LGPL.
40 #
41 # ***** END LICENSE BLOCK *****
42
43 #
44 # JSRef GNUmake makefile.
45 #
46 # Note: dependency rules are missing for some files (some
47 # .h, all .msg, etc.) Re-make clean if in doubt.
48 #
49
50
51 DEPTH = .
52
53 include config.mk
54
55 #NS_USE_NATIVE = 1
56
57 ifndef NANOJIT_ARCH
58 $(warning NANOJIT_ARCH not defined in config/$(OS_CONFIG).mk, JIT disabled)
59 else
60 ifdef DISABLE_JIT
61 $(warning disabling JIT per build specification)
62 else
63 ENABLE_JIT=1
64 endif
65 endif
66
67 ifdef ENABLE_JIT
68 DEFINES += -DJS_TRACER
69 DEFINES += -DFEATURE_NANOJIT
70 INCLUDES += -Inanojit
71 endif
72
73 #ifndef BUILD_OPT
74 #DEFINES += -Ivprof
75 #endif
76
77 ifdef NARCISSUS
78 DEFINES += -DNARCISSUS
79 endif
80
81 # Look in OBJDIR to find jsautocfg.h, jsautokw.h, and js-config.h
82 INCLUDES += -I. -I$(OBJDIR)
83
84 ifdef JS_THREADSAFE
85 DEFINES += -DJS_THREADSAFE
86 INCLUDES += -I$(DIST)/include/nspr
87 ifdef USE_MSVC
88 OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib
89 else
90 OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX)
91 endif
92 endif
93
94 ifdef JS_NO_THIN_LOCKS
95 DEFINES += -DJS_USE_ONLY_NSPR_LOCKS
96 endif
97
98 ifdef JS_HAS_FILE_OBJECT
99 DEFINES += -DJS_HAS_FILE_OBJECT
100 endif
101
102 ifdef JS_GC_ZEAL
103 DEFINES += -DJS_GC_ZEAL
104 endif
105
106 #
107 # XCFLAGS may be set in the environment or on the gmake command line
108 #
109 #CFLAGS += -DDEBUG -DDEBUG_brendan -DJS_ARENAMETER -DJS_HASHMETER -DJS_DUMP_PROPTREE_STATS -DJS_DUMP_SCOPE_METERS -DJS_SCOPE_DEPTH_METER -DJS_BASIC_STATS
110 CFLAGS += $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS)
111
112 LDFLAGS = $(XLDFLAGS)
113 LDFLAGS += $(OS_LDFLAGS)
114
115 ifdef MOZ_SHARK
116 DEFINES += -DMOZ_SHARK
117 CFLAGS += -F/System/Library/PrivateFrameworks
118 LDFLAGS += -F/System/Library/PrivateFrameworks -framework CHUD
119 endif
120 ifdef MOZ_CALLGRIND
121 DEFINES += -DMOZ_CALLGRIND
122 endif
123 ifdef MOZ_VTUNE
124 DEFINES += -DMOZ_VTUNE
125 CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include
126 OTHER_LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
127 endif
128
129 ifndef NO_LIBM
130 LDFLAGS += -lm
131 endif
132
133 # Prevent floating point errors caused by VC++ optimizations
134 ifeq ($(OS_ARCH),WINNT)
135 _MSC_VER = $(shell $(CXX) 2>&1 | sed -n 's/.*Compiler Version \([0-9]*\)\.\([0-9]*\).*/\1\2/p')
136 ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
137 CFLAGS += -Op
138 else
139 CFLAGS += -fp:precise
140 endif
141 endif # WINNT
142
143 #
144 # Server-related changes :
145 #
146 ifdef NES40
147 DEFINES += -DNES40
148 endif
149
150 #
151 # Line editing support.
152 # Define JS_READLINE or JS_EDITLINE to enable line editing in the
153 # js command-line interpreter.
154 #
155 ifdef JS_READLINE
156 # For those platforms with the readline library installed.
157 DEFINES += -DEDITLINE
158 PROG_LIBS += -lreadline -ltermcap
159 else
160 ifdef JS_EDITLINE
161 # Use the editline library, built locally.
162 PREDIRS += editline
163 DEFINES += -DEDITLINE
164 PROG_LIBS += $(OBJDIR)/editline/libedit.a
165 endif
166 endif
167
168 # For purify
169 PURE_CFLAGS = -DXP_UNIX $(OPTIMIZER) $(PURE_OS_CFLAGS) $(DEFINES) \
170 $(INCLUDES) $(XCFLAGS)
171
172 #
173 # JS file lists
174 #
175 JS_HFILES = \
176 jsarray.h \
177 jsatom.h \
178 jsbool.h \
179 jscntxt.h \
180 jsdate.h \
181 jsemit.h \
182 jsexn.h \
183 jsfun.h \
184 jsgc.h \
185 jsinterp.h \
186 jsiter.h \
187 jslibmath.h \
188 jslock.h \
189 jsmath.h \
190 jsnum.h \
191 jsobj.h \
192 json.h \
193 jsopcode.h \
194 jsparse.h \
195 jsarena.h \
196 jsclist.h \
197 jsdhash.h \
198 jsdtoa.h \
199 jshash.h \
200 jslong.h \
201 jstypes.h \
202 jsprvtd.h \
203 jspubtd.h \
204 jsregexp.h \
205 jsscan.h \
206 jsscope.h \
207 jsscript.h \
208 jsstr.h \
209 jsversion.h \
210 jsxdrapi.h \
211 jsxml.h \
212 $(NULL)
213
214 ifdef ENABLE_JIT
215 JS_HFILES += \
216 jstracer.h \
217 nanojit/Assembler.h \
218 nanojit/LIR.h \
219 nanojit/Native$(NANOJIT_ARCH).h \
220 nanojit/avmplus.h \
221 nanojit/vm_fops.h \
222 nanojit/Fragmento.h \
223 nanojit/Native.h \
224 nanojit/RegAlloc.h \
225 nanojit/nanojit.h \
226 $(NULL)
227 endif
228
229 ifndef BUILD_OPT
230 #JS_HFILES += \
231 # vprof/vprof.h \
232 # $(NULL)
233 endif
234
235 API_HFILES = \
236 jsapi.h \
237 jsdbgapi.h \
238 $(NULL)
239
240 OTHER_HFILES = \
241 jsbit.h \
242 jscompat.h \
243 jscpucfg.h \
244 jsotypes.h \
245 prmjtime.h \
246 resource.h \
247 jsopcode.tbl \
248 jsproto.tbl \
249 js.msg \
250 jsshell.msg \
251 jskeyword.tbl \
252 $(NULL)
253
254 ifndef PREBUILT_CPUCFG
255 OTHER_HFILES += $(OBJDIR)/jsautocfg.h
256 endif
257 OTHER_HFILES += $(OBJDIR)/jsautokw.h $(OBJDIR)/js-config.h
258
259 HFILES = $(JS_HFILES) $(API_HFILES) $(OTHER_HFILES)
260
261 JS_CPPFILES = \
262 jsapi.cpp \
263 jsarena.cpp \
264 jsarray.cpp \
265 jsatom.cpp \
266 jsbool.cpp \
267 jscntxt.cpp \
268 jsdate.cpp \
269 jsdbgapi.cpp \
270 jsdhash.cpp \
271 jsdtoa.cpp \
272 jsemit.cpp \
273 jsexn.cpp \
274 jsfun.cpp \
275 jsgc.cpp \
276 jshash.cpp \
277 jsinterp.cpp \
278 jsinvoke.cpp \
279 jsiter.cpp \
280 jslock.cpp \
281 jslog2.cpp \
282 jslong.cpp \
283 jsmath.cpp \
284 jsnum.cpp \
285 jsobj.cpp \
286 json.cpp \
287 jsopcode.cpp \
288 jsparse.cpp \
289 jsprf.cpp \
290 jsregexp.cpp \
291 jsscan.cpp \
292 jsscope.cpp \
293 jsscript.cpp \
294 jsstr.cpp \
295 jsutil.cpp \
296 jsxdrapi.cpp \
297 jsxml.cpp \
298 prmjtime.cpp \
299 $(NULL)
300
301 ifdef ENABLE_JIT
302 JS_CPPFILES += \
303 jsbuiltins.cpp \
304 jstracer.cpp \
305 nanojit/Assembler.cpp \
306 nanojit/Fragmento.cpp \
307 nanojit/LIR.cpp \
308 nanojit/Native$(NANOJIT_ARCH).cpp \
309 nanojit/RegAlloc.cpp \
310 nanojit/avmplus.cpp \
311 $(NULL)
312
313 endif
314
315 ifndef BUILD_OPT
316 #JS_CPPFILES += \
317 # vprof/vprof.cpp \
318 # $(NULL)
319 endif
320
321 ifdef JS_HAS_FILE_OBJECT
322 JS_CPPFILES += jsfile.cpp
323 JS_HFILES += jsfile.h
324 endif
325
326 LIB_CPPFILES = $(JS_CPPFILES)
327 LIB_ASFILES := $(wildcard *_$(OS_ARCH).s)
328 PROG_CPPFILES = js.cpp
329
330 ifdef USE_MSVC
331 LIBRARY = $(OBJDIR)/js32.lib
332 SHARED_LIBRARY = $(OBJDIR)/js32.dll
333 PROGRAM = $(OBJDIR)/js.exe
334 else
335 LIBRARY = $(OBJDIR)/libjs.a
336 SHARED_LIBRARY = $(OBJDIR)/libjs.$(SO_SUFFIX)
337 PROGRAM = $(OBJDIR)/js
338 endif
339
340 include rules.mk
341
342 MOZ_DEPTH = ../..
343 include jsconfig.mk
344
345 nsinstall-target:
346 cd ../../config; $(MAKE) OBJDIR=$(OBJDIR) OBJDIR_NAME=$(OBJDIR)
347
348 #
349 # Automatic header generation
350 #
351
352 AUTO_HEADERS = \
353 $(OBJDIR)/jsautokw.h \
354 $(OBJDIR)/jsautooplen.h \
355 $(NULL)
356
357 $(OBJDIR)/jsautokw.h: jskeyword.tbl
358
359 $(OBJDIR)/jsautooplen.h: jsopcode.tbl
360
361 GARBAGE += $(AUTO_HEADERS)
362 GARBAGE += $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen$(HOST_BIN_SUFFIX))
363
364 ifdef USE_MSVC
365
366 GARBAGE += $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen.obj)
367
368 $(AUTO_HEADERS): $(OBJDIR)/jsauto%.h: js%gen.cpp
369 @$(MAKE_OBJDIR)
370 $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(OPTIMIZER) $<
371 link.exe -out:"$(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX)" $(EXE_LINK_FLAGS) $(OBJDIR)/js$*gen.obj
372 $(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $@
373 else
374
375 GARBAGE += $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen.d)
376 $(AUTO_HEADERS): $(OBJDIR)/jsauto%.h: js%gen.cpp
377 @$(MAKE_OBJDIR)
378 $(CXX) -o $(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $(CFLAGS) $(OPTIMIZER) $(LDFLAGS) $<
379 $(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $@
380
381 endif
382
383 # force creation of autoheaders before compiling any source that may use them
384 $(LIB_OBJS) : $(AUTO_HEADERS)
385
386 #
387 # An installed header file describing configuration options that affect
388 # the API.
389 #
390
391 # Avoid rebuilding unless js-config.h's contents actually change. The
392 # timestamp on js-config.h.stamp corresponds to the last time we
393 # checked that js-config.h was up to date. If the stamp changes but
394 # js-config.h does not, then make concludes that targets depending on
395 # js-config.h don't need to be rebuilt. The dummy '@true' rule here
396 # keeps make from concluding that js-config.h never changes.
397 $(OBJDIR)/js-config.h: $(OBJDIR)/js-config.h.stamp
398 @true
399
400 js-config-switch=$(if $(value $($1)),-e 's/\#undef $1/\#define $1/')
401 $(OBJDIR)/js-config.h.stamp: js-config.h.in Makefile.ref
402 sed < $< > $(@:.stamp=.tmp) \
403 $(call js-config-switch,JS_THREADSAFE) \
404 $(call js-config-switch,JS_GC_ZEAL) \
405 -e :dummy
406 if ! [ -f $(@:.stamp=) ] || ! cmp $(@:.stamp=.tmp) $(@:.stamp=); then \
407 mv $(@:.stamp=.tmp) $(@:.stamp=); \
408 fi
409 touch $@
410
411 GARBAGE += $(OBJDIR)/js-config.h $(OBJDIR)/js-config.h.stamp
412
413 # Force creation of js-config.h before compiling any source that may use it.
414 $(LIB_OBJS) : $(OBJDIR)/js-config.h
415
416 #
417 # JS shell executable
418 #
419
420 ifdef USE_MSVC
421 $(PROGRAM): $(PROG_OBJS) $(LIBRARY)
422 link.exe -out:"$@" $(EXE_LINK_FLAGS) $^
423 else
424 $(PROGRAM): $(PROG_OBJS) $(LIBRARY)
425 $(CXX) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) $(OTHER_LIBS) \
426 $(PROG_LIBS)
427 endif
428
429 $(PROGRAM).pure: $(PROG_OBJS) $(LIBRARY)
430 purify $(PUREFLAGS) \
431 $(CXX) -o $@ $(PURE_OS_CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) \
432 $(OTHER_LIBS) $(PROG_LIBS)
433
434 ifndef PREBUILT_CPUCFG
435 $(filter-out jscpucfg.h $(OBJDIR)/jsautocfg.h, $(HFILES)) $(CPPFILES): $(OBJDIR)/jsautocfg.h
436
437 $(OBJDIR)/jsautocfg.h: $(OBJDIR)/jscpucfg
438 rm -f $@
439 $(OBJDIR)/jscpucfg > $@
440
441 $(OBJDIR)/jscpucfg: $(OBJDIR)/jscpucfg.o
442 $(CXX) $(OS_LDFLAGS) -o $@ $(OBJDIR)/jscpucfg.o
443
444 GARBAGE += $(OBJDIR)/jsautocfg.h $(OBJDIR)/jscpucfg \
445 $(OBJDIR)/jscpucfg.o $(OBJDIR)/jscpucfg.d
446 endif
447
448 # Automatic make dependencies files
449 DEPENDENCIES = $(CPPFILES:%.cpp=$(OBJDIR)/%.d)
450
451 #
452 # Hardwire dependencies for some files
453 #
454 ifdef USE_MSVC
455 OBJ=obj
456 else
457 OBJ=o
458 endif
459
460 $(OBJDIR)/jsinvoke.$(OBJ): jsinterp.h jsinterp.cpp
461 $(OBJDIR)/jsinvoke.obj : jsinterp.h jsinterp.cpp
462
463 -include $(DEPENDENCIES)
464
465 TARNAME = jsref.tar
466 TARFILES = files `cat files`
467
468 SUFFIXES: .i
469 %.i: %.cpp
470 $(CXX) -C -E $(CFLAGS) $< > $*.i

  ViewVC Help
Powered by ViewVC 1.1.24