PageRenderTime 108ms CodeModel.GetById 30ms app.highlight 43ms RepoModel.GetById 18ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/js/Makefile.ref

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
Unknown | 483 lines | 413 code | 70 blank | 0 comment | 0 complexity | 4168ad38bbec17e834de6a85c8dfe4a0 MD5 | raw file
  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
 51DEPTH = .
 52
 53include config.mk
 54
 55#NS_USE_NATIVE = 1
 56
 57ifndef NANOJIT_ARCH
 58$(warning NANOJIT_ARCH not defined in config/$(OS_CONFIG).mk, JIT disabled)
 59else
 60ifdef DISABLE_JIT
 61$(warning disabling JIT per build specification)
 62else
 63ENABLE_JIT=1
 64endif
 65endif
 66
 67ifdef ENABLE_JIT
 68DEFINES += -DJS_TRACER
 69DEFINES += -DFEATURE_NANOJIT
 70INCLUDES += -Inanojit
 71endif
 72
 73#ifndef BUILD_OPT
 74#DEFINES += -Ivprof
 75#endif
 76
 77ifdef NARCISSUS
 78DEFINES += -DNARCISSUS
 79endif
 80
 81# Look in OBJDIR to find jsautocfg.h, jsautokw.h, and js-config.h
 82INCLUDES   += -I. -I$(OBJDIR)
 83
 84ifdef JS_THREADSAFE
 85DEFINES += -DJS_THREADSAFE
 86INCLUDES += -I$(DIST)/include/nspr
 87ifdef USE_MSVC
 88OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib
 89else
 90OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX)
 91endif
 92endif
 93
 94ifdef JS_NO_THIN_LOCKS
 95DEFINES += -DJS_USE_ONLY_NSPR_LOCKS
 96endif
 97
 98ifdef JS_HAS_FILE_OBJECT
 99DEFINES += -DJS_HAS_FILE_OBJECT
100endif
101
102ifdef JS_GC_ZEAL
103DEFINES += -DJS_GC_ZEAL
104endif
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
110CFLAGS          += $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS)
111
112LDFLAGS		= $(XLDFLAGS)
113LDFLAGS += $(OS_LDFLAGS)
114
115ifdef MOZ_SHARK
116DEFINES += -DMOZ_SHARK
117CFLAGS += -F/System/Library/PrivateFrameworks
118LDFLAGS += -F/System/Library/PrivateFrameworks -framework CHUD
119endif
120ifdef MOZ_CALLGRIND
121DEFINES += -DMOZ_CALLGRIND
122endif
123ifdef MOZ_VTUNE
124DEFINES += -DMOZ_VTUNE
125CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include
126OTHER_LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
127endif
128
129ifndef NO_LIBM
130LDFLAGS += -lm
131endif
132
133# Prevent floating point errors caused by VC++ optimizations
134ifeq ($(OS_ARCH),WINNT)
135_MSC_VER = $(shell $(CXX) 2>&1 | sed -n 's/.*Compiler Version \([0-9]*\)\.\([0-9]*\).*/\1\2/p')
136ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
137CFLAGS += -Op
138else
139CFLAGS += -fp:precise
140endif
141endif # WINNT
142
143#
144#	Server-related changes :
145#
146ifdef NES40
147DEFINES += -DNES40
148endif
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#
155ifdef JS_READLINE
156# For those platforms with the readline library installed.
157DEFINES += -DEDITLINE
158PROG_LIBS += -lreadline -ltermcap
159else
160ifdef JS_EDITLINE
161# Use the editline library, built locally.
162PREDIRS += editline
163DEFINES += -DEDITLINE
164PROG_LIBS += $(OBJDIR)/editline/libedit.a
165endif
166endif
167
168# For purify
169PURE_CFLAGS     = -DXP_UNIX $(OPTIMIZER) $(PURE_OS_CFLAGS) $(DEFINES) \
170                  $(INCLUDES) $(XCFLAGS)
171
172#
173# JS file lists
174#
175JS_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
214ifdef ENABLE_JIT
215JS_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	nanojit/TraceTreeDrawer.h \
227	$(NULL)
228endif
229
230ifndef BUILD_OPT
231#JS_HFILES +=            \
232#        vprof/vprof.h   \
233#        $(NULL)
234endif
235
236API_HFILES =		\
237	jsapi.h		\
238	jsdbgapi.h	\
239	$(NULL)
240
241OTHER_HFILES =		\
242	jsbit.h		\
243	jscompat.h	\
244	jscpucfg.h	\
245	jsotypes.h	\
246	jsstddef.h	\
247	prmjtime.h	\
248	resource.h	\
249	jsopcode.tbl	\
250	jsproto.tbl     \
251	js.msg		\
252	jsshell.msg	\
253	jskeyword.tbl	\
254	$(NULL)
255
256ifdef ENABLE_JIT
257OTHER_HFILES += builtins.tbl
258endif
259
260ifndef PREBUILT_CPUCFG
261OTHER_HFILES += $(OBJDIR)/jsautocfg.h
262endif
263OTHER_HFILES += $(OBJDIR)/jsautokw.h $(OBJDIR)/js-config.h
264
265HFILES = $(JS_HFILES) $(API_HFILES) $(OTHER_HFILES)
266
267JS_CPPFILES =		\
268	jsapi.cpp	\
269	jsarena.cpp	\
270	jsarray.cpp	\
271	jsatom.cpp	\
272	jsbool.cpp	\
273	jscntxt.cpp	\
274	jsdate.cpp	\
275	jsdbgapi.cpp	\
276	jsdhash.cpp	\
277	jsdtoa.cpp	\
278	jsemit.cpp	\
279	jsexn.cpp	\
280	jsfun.cpp	\
281	jsgc.cpp	\
282	jshash.cpp	\
283	jsinterp.cpp	\
284	jsinvoke.cpp    \
285	jsiter.cpp	\
286	jslock.cpp	\
287	jslog2.cpp	\
288	jslong.cpp	\
289	jsmath.cpp	\
290	jsnum.cpp	\
291	jsobj.cpp	\
292	json.cpp	\
293	jsopcode.cpp	\
294	jsparse.cpp	\
295	jsprf.cpp	\
296	jsregexp.cpp	\
297	jsscan.cpp	\
298	jsscope.cpp	\
299	jsscript.cpp	\
300	jsstr.cpp	\
301	jsutil.cpp	\
302	jsxdrapi.cpp	\
303	jsxml.cpp	\
304	prmjtime.cpp	\
305	$(NULL)
306
307ifdef ENABLE_JIT
308JS_CPPFILES +=		       \
309	jsbuiltins.cpp         \
310	jstracer.cpp	       \
311	nanojit/Assembler.cpp  \
312	nanojit/Fragmento.cpp  \
313	nanojit/LIR.cpp        \
314	nanojit/Native$(NANOJIT_ARCH).cpp \
315	nanojit/RegAlloc.cpp   \
316	nanojit/avmplus.cpp    \
317	$(NULL)
318
319ifdef DEBUG
320JS_CPPFILES += nanojit/TraceTreeDrawer.cpp
321endif
322endif
323
324ifndef BUILD_OPT
325#JS_CPPFILES +=                 \
326#        vprof/vprof.cpp        \
327#        $(NULL)
328endif
329
330ifdef JS_LIVECONNECT
331DIRS      += liveconnect
332endif
333
334ifdef JS_HAS_FILE_OBJECT
335JS_CPPFILES += jsfile.cpp
336JS_HFILES += jsfile.h
337endif
338
339LIB_CPPFILES  = $(JS_CPPFILES)
340LIB_ASFILES := $(wildcard *_$(OS_ARCH).s)
341PROG_CPPFILES = js.cpp
342
343ifdef USE_MSVC
344LIBRARY = $(OBJDIR)/js32.lib
345SHARED_LIBRARY = $(OBJDIR)/js32.dll
346PROGRAM = $(OBJDIR)/js.exe
347else
348LIBRARY = $(OBJDIR)/libjs.a
349SHARED_LIBRARY = $(OBJDIR)/libjs.$(SO_SUFFIX)
350PROGRAM = $(OBJDIR)/js
351endif
352
353include rules.mk
354
355MOZ_DEPTH = ../..
356include jsconfig.mk
357
358nsinstall-target:
359	cd ../../config; $(MAKE) OBJDIR=$(OBJDIR) OBJDIR_NAME=$(OBJDIR)
360
361#
362# Automatic header generation
363#
364
365AUTO_HEADERS =					\
366	$(OBJDIR)/jsautokw.h			\
367	$(OBJDIR)/jsautooplen.h			\
368	$(NULL)
369
370$(OBJDIR)/jsautokw.h: jskeyword.tbl
371
372$(OBJDIR)/jsautooplen.h: jsopcode.tbl
373
374GARBAGE += $(AUTO_HEADERS)
375GARBAGE	+= $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen$(HOST_BIN_SUFFIX))
376
377ifdef USE_MSVC
378
379GARBAGE	+= $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen.obj)
380
381$(AUTO_HEADERS): $(OBJDIR)/jsauto%.h: js%gen.cpp
382	@$(MAKE_OBJDIR)
383	$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(OPTIMIZER) $<
384	link.exe -out:"$(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX)" $(EXE_LINK_FLAGS) $(OBJDIR)/js$*gen.obj
385	$(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $@
386else
387
388GARBAGE	+= $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen.d)
389$(AUTO_HEADERS): $(OBJDIR)/jsauto%.h: js%gen.cpp
390	@$(MAKE_OBJDIR)
391	$(CXX) -o $(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $(CFLAGS) $(OPTIMIZER) $(LDFLAGS) $<
392	$(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $@
393
394endif
395
396# force creation of autoheaders before compiling any source that may use them
397$(LIB_OBJS) : $(AUTO_HEADERS)
398
399#
400# An installed header file describing configuration options that affect
401# the API.
402#
403
404# Avoid rebuilding unless js-config.h's contents actually change.  The
405# timestamp on js-config.h.stamp corresponds to the last time we
406# checked that js-config.h was up to date.  If the stamp changes but
407# js-config.h does not, then make concludes that targets depending on
408# js-config.h don't need to be rebuilt.  The dummy '@true' rule here
409# keeps make from concluding that js-config.h never changes.
410$(OBJDIR)/js-config.h: $(OBJDIR)/js-config.h.stamp
411	@true
412
413js-config-switch=$(if $(value $($1)),-e 's/\#undef $1/\#define $1/')
414$(OBJDIR)/js-config.h.stamp: js-config.h.in Makefile.ref
415	sed < $< > $(@:.stamp=.tmp)			\
416	    $(call js-config-switch,JS_THREADSAFE)	\
417	    $(call js-config-switch,JS_GC_ZEAL)		\
418	    -e :dummy
419	if ! [ -f $(@:.stamp=) ] || ! cmp $(@:.stamp=.tmp) $(@:.stamp=); then \
420	    mv $(@:.stamp=.tmp) $(@:.stamp=);				      \
421	fi
422	touch $@
423
424GARBAGE += $(OBJDIR)/js-config.h $(OBJDIR)/js-config.h.stamp
425
426# Force creation of js-config.h before compiling any source that may use it.
427$(LIB_OBJS) : $(OBJDIR)/js-config.h
428
429#
430# JS shell executable
431#
432
433ifdef USE_MSVC
434$(PROGRAM): $(PROG_OBJS) $(LIBRARY)
435	link.exe -out:"$@" $(EXE_LINK_FLAGS) $^
436else
437$(PROGRAM): $(PROG_OBJS) $(LIBRARY)
438	$(CXX) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) $(OTHER_LIBS) \
439	    $(PROG_LIBS)
440endif
441
442$(PROGRAM).pure: $(PROG_OBJS) $(LIBRARY)
443	purify $(PUREFLAGS) \
444	    $(CXX) -o $@ $(PURE_OS_CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) \
445		$(OTHER_LIBS) $(PROG_LIBS)
446
447ifndef PREBUILT_CPUCFG
448$(filter-out jscpucfg.h $(OBJDIR)/jsautocfg.h, $(HFILES)) $(CPPFILES): $(OBJDIR)/jsautocfg.h
449
450$(OBJDIR)/jsautocfg.h: $(OBJDIR)/jscpucfg
451	rm -f $@
452	$(OBJDIR)/jscpucfg > $@
453
454$(OBJDIR)/jscpucfg: $(OBJDIR)/jscpucfg.o
455	$(CXX) $(OS_LDFLAGS) -o $@ $(OBJDIR)/jscpucfg.o
456
457GARBAGE += $(OBJDIR)/jsautocfg.h $(OBJDIR)/jscpucfg \
458	   $(OBJDIR)/jscpucfg.o $(OBJDIR)/jscpucfg.d
459endif
460
461# Automatic make dependencies files
462DEPENDENCIES    = $(CPPFILES:%.cpp=$(OBJDIR)/%.d)
463
464#
465# Hardwire dependencies for some files 
466#
467ifdef USE_MSVC
468OBJ=obj
469else
470OBJ=o
471endif
472
473$(OBJDIR)/jsinvoke.$(OBJ): jsinterp.h jsinterp.cpp
474$(OBJDIR)/jsinvoke.obj : jsinterp.h jsinterp.cpp
475
476-include $(DEPENDENCIES)
477
478TARNAME = jsref.tar
479TARFILES = files `cat files`
480
481SUFFIXES: .i
482%.i: %.cpp
483	$(CXX) -C -E $(CFLAGS) $< > $*.i