Bug 449522 - Context menu for HTML5 <video> elements. r=gavin, ui-r=boriss
[wine-gecko.git] / js / src / Makefile.ref
blob181c7bfb778232b8bbe121a03a5c9118293410ea
1 # -*- Mode: makefile -*-
2 # vim: ft=make
4 # ***** BEGIN LICENSE BLOCK *****
5 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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.
17 # The Original Code is Mozilla Communicator client code, released
18 # March 31, 1998.
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.
25 # Contributor(s):
26 #   Michael Ang <mang@subcarrier.org>
27 #   Kevin Buhr <buhr@stat.wisc.edu>
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.
41 # ***** END LICENSE BLOCK *****
44 # JSRef GNUmake makefile.
46 # Note: dependency rules are missing for some files (some
47 #       .h, all .msg, etc.)  Re-make clean if in doubt.
51 DEPTH = .
53 include config.mk
55 #NS_USE_NATIVE = 1
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
67 ifdef ENABLE_JIT
68 DEFINES += -DJS_TRACER
69 DEFINES += -DFEATURE_NANOJIT
70 INCLUDES += -Inanojit
71 endif
73 #ifndef BUILD_OPT
74 #DEFINES += -Ivprof
75 #endif
77 ifdef NARCISSUS
78 DEFINES += -DNARCISSUS
79 endif
81 # Look in OBJDIR to find jsautocfg.h and jsautokw.h
82 INCLUDES   += -I. -I$(OBJDIR)
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
94 ifdef JS_NO_THIN_LOCKS
95 DEFINES += -DJS_USE_ONLY_NSPR_LOCKS
96 endif
98 ifdef JS_HAS_FILE_OBJECT
99 DEFINES += -DJS_HAS_FILE_OBJECT
100 endif
104 # XCFLAGS may be set in the environment or on the gmake command line
106 #CFLAGS += -DDEBUG -DDEBUG_brendan -DJS_ARENAMETER -DJS_HASHMETER -DJS_DUMP_PROPTREE_STATS -DJS_DUMP_SCOPE_METERS -DJS_SCOPE_DEPTH_METER -DJS_BASIC_STATS
107 CFLAGS          += $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS)
108 INTERP_CFLAGS   += $(INTERP_OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(INTERP_XCFLAGS)
109 BUILTINS_CFLAGS += $(BUILTINS_OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(BUILTINS_XCFLAGS)
111 LDFLAGS         = $(XLDFLAGS)
112 LDFLAGS += $(OS_LDFLAGS)
114 ifdef MOZ_SHARK
115 DEFINES += -DMOZ_SHARK
116 CFLAGS += -F/System/Library/PrivateFrameworks
117 LDFLAGS += -F/System/Library/PrivateFrameworks -framework CHUD
118 endif
119 ifdef MOZ_CALLGRIND
120 DEFINES += -DMOZ_CALLGRIND
121 endif
122 ifdef MOZ_VTUNE
123 DEFINES += -DMOZ_VTUNE
124 CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include
125 OTHER_LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
126 endif
128 ifndef NO_LIBM
129 LDFLAGS += -lm
130 endif
132 # Prevent floating point errors caused by VC++ optimizations
133 ifeq ($(OS_ARCH),WINNT)
134 _MSC_VER = $(shell $(CXX) 2>&1 | sed -n 's/.*Compiler Version \([0-9]*\)\.\([0-9]*\).*/\1\2/p')
135 ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
136 CFLAGS += -Op
137 else
138 CFLAGS += -fp:precise
139 endif
140 endif # WINNT
143 #       Server-related changes :
145 ifdef NES40
146 DEFINES += -DNES40
147 endif
150 # Line editing support.
151 # Define JS_READLINE or JS_EDITLINE to enable line editing in the
152 # js command-line interpreter.
154 ifdef JS_READLINE
155 # For those platforms with the readline library installed.
156 DEFINES += -DEDITLINE
157 PROG_LIBS += -lreadline -ltermcap
158 else
159 ifdef JS_EDITLINE
160 # Use the editline library, built locally.
161 PREDIRS += editline
162 DEFINES += -DEDITLINE
163 PROG_LIBS += $(OBJDIR)/editline/libedit.a
164 endif
165 endif
167 # For purify
168 PURE_CFLAGS     = -DXP_UNIX $(OPTIMIZER) $(PURE_OS_CFLAGS) $(DEFINES) \
169                   $(INCLUDES) $(XCFLAGS)
172 # JS file lists
174 JS_HFILES =             \
175         jsarray.h       \
176         jsatom.h        \
177         jsbool.h        \
178         jscntxt.h       \
179         jsdate.h        \
180         jsemit.h        \
181         jsexn.h         \
182         jsfun.h         \
183         jsgc.h          \
184         jsinterp.h      \
185         jsiter.h        \
186         jslibmath.h     \
187         jslock.h        \
188         jsmath.h        \
189         jsnum.h         \
190         jsobj.h         \
191         json.h          \
192         jsopcode.h      \
193         jsparse.h       \
194         jsarena.h       \
195         jsclist.h       \
196         jsdhash.h       \
197         jsdtoa.h        \
198         jshash.h        \
199         jslong.h        \
200         jstypes.h       \
201         jsprvtd.h       \
202         jspubtd.h       \
203         jsregexp.h      \
204         jsscan.h        \
205         jsscope.h       \
206         jsscript.h      \
207         jsstr.h         \
208         jsversion.h     \
209         jsxdrapi.h      \
210         jsxml.h         \
211         $(NULL)
213 ifdef ENABLE_JIT
214 JS_HFILES +=                    \
215         jstracer.h              \
216         nanojit/Assembler.h     \
217         nanojit/LIR.h           \
218         nanojit/Native$(NANOJIT_ARCH).h \
219         nanojit/avmplus.h       \
220         nanojit/vm_fops.h       \
221         nanojit/Fragmento.h     \
222         nanojit/Native.h        \
223         nanojit/RegAlloc.h      \
224         nanojit/nanojit.h       \
225         nanojit/TraceTreeDrawer.h \
226         $(NULL)
227 endif
229 ifndef BUILD_OPT
230 #JS_HFILES +=            \
231 #        vprof/vprof.h   \
232 #        $(NULL)
233 endif
235 API_HFILES =            \
236         jsapi.h         \
237         jsdbgapi.h      \
238         $(NULL)
240 OTHER_HFILES =          \
241         jsbit.h         \
242         jscompat.h      \
243         jscpucfg.h      \
244         jsotypes.h      \
245         jsstddef.h      \
246         prmjtime.h      \
247         resource.h      \
248         jsopcode.tbl    \
249         jsproto.tbl     \
250         js.msg          \
251         jsshell.msg     \
252         jskeyword.tbl   \
253         $(NULL)
255 ifdef ENABLE_JIT
256 OTHER_HFILES += builtins.tbl
257 endif
259 ifndef PREBUILT_CPUCFG
260 OTHER_HFILES += $(OBJDIR)/jsautocfg.h
261 endif
262 OTHER_HFILES += $(OBJDIR)/jsautokw.h
264 HFILES = $(JS_HFILES) $(API_HFILES) $(OTHER_HFILES)
266 JS_CPPFILES =           \
267         jsapi.cpp       \
268         jsarena.cpp     \
269         jsarray.cpp     \
270         jsatom.cpp      \
271         jsbool.cpp      \
272         jscntxt.cpp     \
273         jsdate.cpp      \
274         jsdbgapi.cpp    \
275         jsdhash.cpp     \
276         jsdtoa.cpp      \
277         jsemit.cpp      \
278         jsexn.cpp       \
279         jsfun.cpp       \
280         jsgc.cpp        \
281         jshash.cpp      \
282         jsinterp.cpp    \
283         jsinvoke.cpp    \
284         jsiter.cpp      \
285         jslock.cpp      \
286         jslog2.cpp      \
287         jslong.cpp      \
288         jsmath.cpp      \
289         jsnum.cpp       \
290         jsobj.cpp       \
291         json.cpp        \
292         jsopcode.cpp    \
293         jsparse.cpp     \
294         jsprf.cpp       \
295         jsregexp.cpp    \
296         jsscan.cpp      \
297         jsscope.cpp     \
298         jsscript.cpp    \
299         jsstr.cpp       \
300         jsutil.cpp      \
301         jsxdrapi.cpp    \
302         jsxml.cpp       \
303         prmjtime.cpp    \
304         $(NULL)
306 ifdef ENABLE_JIT
307 JS_CPPFILES +=                 \
308         jsbuiltins.cpp         \
309         jstracer.cpp           \
310         nanojit/Assembler.cpp  \
311         nanojit/Fragmento.cpp  \
312         nanojit/LIR.cpp        \
313         nanojit/Native$(NANOJIT_ARCH).cpp \
314         nanojit/RegAlloc.cpp   \
315         nanojit/avmplus.cpp    \
316         $(NULL)
318 ifdef DEBUG
319 JS_CPPFILES += nanojit/TraceTreeDrawer.cpp
320 endif
321 endif
323 ifndef BUILD_OPT
324 #JS_CPPFILES +=                 \
325 #        vprof/vprof.cpp        \
326 #        $(NULL)
327 endif
329 ifdef JS_LIVECONNECT
330 DIRS      += liveconnect
331 endif
333 ifdef JS_HAS_FILE_OBJECT
334 JS_CPPFILES += jsfile.cpp
335 JS_HFILES += jsfile.h
336 endif
338 LIB_CPPFILES  = $(JS_CPPFILES)
339 LIB_ASFILES := $(wildcard *_$(OS_ARCH).s)
340 PROG_CPPFILES = js.cpp
342 ifdef USE_MSVC
343 LIBRARY = $(OBJDIR)/js32.lib
344 SHARED_LIBRARY = $(OBJDIR)/js32.dll
345 PROGRAM = $(OBJDIR)/js.exe
346 else
347 LIBRARY = $(OBJDIR)/libjs.a
348 SHARED_LIBRARY = $(OBJDIR)/libjs.$(SO_SUFFIX)
349 PROGRAM = $(OBJDIR)/js
350 endif
352 include rules.mk
354 MOZ_DEPTH = ../..
355 include jsconfig.mk
357 nsinstall-target:
358         cd ../../config; $(MAKE) OBJDIR=$(OBJDIR) OBJDIR_NAME=$(OBJDIR)
361 # Automatic header generation
364 AUTO_HEADERS = $(OBJDIR)/jsautokw.h $(OBJDIR)/jsautooplen.h
366 $(OBJDIR)/jsautokw.h: jskeyword.tbl
368 $(OBJDIR)/jsautooplen.h: jsopcode.tbl
370 GARBAGE += $(AUTO_HEADERS)
371 GARBAGE += $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen$(HOST_BIN_SUFFIX))
373 ifdef USE_MSVC
375 GARBAGE += $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen.obj)
377 $(AUTO_HEADERS): $(OBJDIR)/jsauto%.h: js%gen.cpp
378         @$(MAKE_OBJDIR)
379         $(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $<
380         link.exe -out:"$(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX)" $(EXE_LINK_FLAGS) $(OBJDIR)/js$*gen.obj
381         $(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $@
382 else
384 GARBAGE += $(AUTO_HEADERS:$(OBJDIR)/jsauto%.h=$(OBJDIR)/js%gen.d)
385 $(AUTO_HEADERS): $(OBJDIR)/jsauto%.h: js%gen.cpp
386         @$(MAKE_OBJDIR)
387         $(CXX) -o $(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $(CFLAGS) $(LDFLAGS) $<
388         $(OBJDIR)/js$*gen$(HOST_BIN_SUFFIX) $@
390 endif
392 # force creation of autoheaders before compiling any source that may use them
393 $(LIB_OBJS) : $(AUTO_HEADERS)
396 # JS shell executable
399 ifdef USE_MSVC
400 $(PROGRAM): $(PROG_OBJS) $(LIBRARY)
401         link.exe -out:"$@" $(EXE_LINK_FLAGS) $^
402 else
403 $(PROGRAM): $(PROG_OBJS) $(LIBRARY)
404         $(CXX) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) $(OTHER_LIBS) \
405             $(PROG_LIBS)
406 endif
408 $(PROGRAM).pure: $(PROG_OBJS) $(LIBRARY)
409         purify $(PUREFLAGS) \
410             $(CXX) -o $@ $(PURE_OS_CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) \
411                 $(OTHER_LIBS) $(PROG_LIBS)
413 ifndef PREBUILT_CPUCFG
414 $(filter-out jscpucfg.h $(OBJDIR)/jsautocfg.h, $(HFILES)) $(CPPFILES): $(OBJDIR)/jsautocfg.h
416 $(OBJDIR)/jsautocfg.h: $(OBJDIR)/jscpucfg
417         rm -f $@
418         $(OBJDIR)/jscpucfg > $@
420 $(OBJDIR)/jscpucfg: $(OBJDIR)/jscpucfg.o
421         $(CXX) $(OS_LDFLAGS) -o $@ $(OBJDIR)/jscpucfg.o
423 GARBAGE += $(OBJDIR)/jsautocfg.h $(OBJDIR)/jscpucfg \
424            $(OBJDIR)/jscpucfg.o $(OBJDIR)/jscpucfg.d
425 endif
427 # Automatic make dependencies files
428 DEPENDENCIES    = $(CPPFILES:%.cpp=$(OBJDIR)/%.d)
431 # Hardwire dependencies for some files 
433 ifdef USE_MSVC
434 OBJ=obj
435 else
436 OBJ=o
437 endif
439 $(OBJDIR)/jsinvoke.$(OBJ): jsinterp.h jsinterp.cpp
440 $(OBJDIR)/jsinvoke.obj : jsinterp.h jsinterp.cpp
442 -include $(DEPENDENCIES)
444 TARNAME = jsref.tar
445 TARFILES = files `cat files`
447 SUFFIXES: .i
448 %.i: %.cpp
449         $(CXX) -C -E $(CFLAGS) $< > $*.i