Bug 463806 - [PATCH][@font-face] Downloaded font activation on Mac may fail due to...
[wine-gecko.git] / js / src / Makefile.in
blobce3bc1e03e001ce6bbf1e92a9d244669169cc3e0
1 # -*- Mode: makefile -*-
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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.
16 # The Original Code is Mozilla Communicator client code, released
17 # March 31, 1998.
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.
24 # Contributor(s):
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.
38 # ***** END LICENSE BLOCK *****
40 DEPTH = .
41 topsrcdir = @top_srcdir@
42 srcdir = @srcdir@
44 DIRS = config
46 include $(DEPTH)/config/autoconf.mk
48 ifndef JS_MOZ_INSTALL
49 # This is the appropriate behavior for GNU-style 'make install'. For
50 # Mozilla in-tree behavior, leaving NSDISTMODE unset is the right
51 # thing; config/js/Makefile.in sets JS_MOZ_INSTALL in that case.
52 NSDISTMODE = copy
53 endif
55 MODULE = js
56 LIBRARY_NAME = mozjs
57 GRE_MODULE = 1
59 PROGRAM = js$(BIN_SUFFIX)
60 # The shell uses some 'HIDDEN' symbols to produce statistics, so we
61 # link directly against the .o files, not against the JS shared
62 # library.
63 PROGOBJS = js.$(OBJ_SUFFIX) $(OBJS)
64 LIBS = $(NSPR_LIBS)
66 ifdef GNU_CXX
67 ifdef INTEL_CXX
68 # icc gets special optimize flags
69 ifdef MOZ_PROFILE_GENERATE
70 MODULE_OPTIMIZE_FLAGS = -O0
71 else
72 MODULE_OPTIMIZE_FLAGS = -O2 -ip
73 #XXX: do we want different INTERP_OPTIMIZER flags here?
74 endif
75 else # not INTEL_CXX
76 MODULE_OPTIMIZE_FLAGS = -Os -fstrict-aliasing $(MOZ_OPTIMIZE_SIZE_TWEAK)
77 # Special optimization flags for jsinterp.c
78 INTERP_OPTIMIZER = -O3 -fstrict-aliasing
79 endif
80 else # not GNU_CXX
81 ifeq ($(OS_ARCH),SunOS)
82 MODULE_OPTIMIZE_FLAGS = -xO4
83 endif
84 ifeq ($(OS_ARCH),WINNT)
85 ifdef WINCE
86 # -GL is not supported on windows mobile while we are using the arm-wince-link command
87 MODULE_OPTIMIZE_FLAGS = -O2
88 else
89 MODULE_OPTIMIZE_FLAGS = -O2 -GL
90 endif
91 endif
92 endif
95 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
96 LIBRARY_NAME = js$(MOZ_BITS)$(VERSION_NUMBER)
97 endif
99 # JavaScript must be built shared, even for static builds, as it is used by
100 # other modules which are always built shared. Failure to do so results in
101 # the js code getting copied into xpinstall and jsd as well as mozilla-bin,
102 # and then the static data cells used for locking no longer work.
104 ifndef JS_STATIC_BUILD
105 FORCE_SHARED_LIB = 1
106 endif
108 ifeq (86,$(findstring 86,$(OS_TEST)))
109 ifeq (64,$(findstring 64,$(OS_TEST)))
110 else
111 DEFINES += -DAVMPLUS_IA32
112 NANOJIT_ARCH = i386
113 ENABLE_JIT = 1
114 endif
115 endif
117 ifeq (arm,$(findstring arm,$(OS_TEST)))
118 DEFINES += -DAVMPLUS_ARM
119 NANOJIT_ARCH = ARM
120 ENABLE_JIT = 1
121 endif
123 ifneq (,$(filter Linux Darwin SunOS FreeBSD,$(OS_ARCH)))
124 DEFINES += -DAVMPLUS_UNIX
125 endif
127 ifeq ($(OS_ARCH),Linux)
128 DEFINES += -DAVMPLUS_LINUX
129 endif
131 ifeq ($(OS_ARCH),WINNT)
132 DEFINES += -DAVMPLUS_WIN32
133 endif
135 VPATH = $(srcdir)
137 CPPSRCS = \
138 jsapi.cpp \
139 jsarena.cpp \
140 jsarray.cpp \
141 jsatom.cpp \
142 jsbool.cpp \
143 jscntxt.cpp \
144 jsdate.cpp \
145 jsdbgapi.cpp \
146 jsdhash.cpp \
147 jsdtoa.cpp \
148 jsemit.cpp \
149 jsexn.cpp \
150 jsfun.cpp \
151 jsgc.cpp \
152 jshash.cpp \
153 jsinterp.cpp \
154 jsinvoke.cpp \
155 jsiter.cpp \
156 jslock.cpp \
157 jslog2.cpp \
158 jslong.cpp \
159 jsmath.cpp \
160 jsnum.cpp \
161 jsobj.cpp \
162 json.cpp \
163 jsopcode.cpp \
164 jsparse.cpp \
165 jsprf.cpp \
166 jsregexp.cpp \
167 jsscan.cpp \
168 jsscope.cpp \
169 jsscript.cpp \
170 jsstr.cpp \
171 jsutil.cpp \
172 jsxdrapi.cpp \
173 jsxml.cpp \
174 prmjtime.cpp \
175 $(NULL)
177 ifdef HAVE_DTRACE
178 CSRCS += \
179 jsdtracef.c
180 endif
182 INSTALLED_HEADERS = \
183 js-config.h \
184 jsautocfg.h \
185 jsautokw.h \
186 js.msg \
187 jsapi.h \
188 jsarray.h \
189 jsarena.h \
190 jsatom.h \
191 jsbit.h \
192 jsbool.h \
193 jsclist.h \
194 jscntxt.h \
195 jscompat.h \
196 jsdate.h \
197 jsdbgapi.h \
198 jsdhash.h \
199 jsdtoa.h \
200 jsemit.h \
201 jsfun.h \
202 jsgc.h \
203 jshash.h \
204 jsinterp.h \
205 jsiter.h \
206 jslock.h \
207 jslong.h \
208 jsmath.h \
209 jsnum.h \
210 jsobj.h \
211 json.h \
212 jsopcode.tbl \
213 jsopcode.h \
214 jsotypes.h \
215 jsparse.h \
216 jsprf.h \
217 jsproto.tbl \
218 jsprvtd.h \
219 jspubtd.h \
220 jsregexp.h \
221 jsscan.h \
222 jsscope.h \
223 jsscript.h \
224 jsstaticcheck.h \
225 jsstddef.h \
226 jsstr.h \
227 jstracer.h \
228 jstypes.h \
229 jsutil.h \
230 jsversion.h \
231 jsxdrapi.h \
232 jsxml.h \
233 $(NULL)
235 ifdef ENABLE_JIT
236 VPATH += $(srcdir)/nanojit
238 INSTALLED_HEADERS += \
239 builtins.tbl \
240 jsbuiltins.h \
241 Assembler.h \
242 LIR.h \
243 avmplus.h \
244 Fragmento.h \
245 Native.h \
246 Native$(NANOJIT_ARCH).h \
247 RegAlloc.h \
248 nanojit.h \
249 TraceTreeDrawer.h \
250 $(NULL)
252 CPPSRCS += \
253 jstracer.cpp \
254 Assembler.cpp \
255 Fragmento.cpp \
256 LIR.cpp \
257 RegAlloc.cpp \
258 avmplus.cpp \
259 Native$(NANOJIT_ARCH).cpp \
260 jsbuiltins.cpp \
261 $(NULL)
263 ifdef DEBUG
264 CPPSRCS += TraceTreeDrawer.cpp
265 endif
267 DEFINES += -DFEATURE_NANOJIT -DJS_TRACER
268 endif
270 ifdef HAVE_DTRACE
271 INSTALLED_HEADERS += \
272 jsdtracef.h \
273 $(CURDIR)/javascript-trace.h \
274 $(NULL)
275 endif
277 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
278 INSTALLED_HEADERS += jscpucfg.h
279 endif
281 JS_SAFE_ARENA = 1
283 DASH_R = -r
285 ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
286 SDK_LIBRARY = $(IMPORT_LIBRARY)
287 else
288 SDK_LIBRARY = $(SHARED_LIBRARY)
289 endif
291 include $(topsrcdir)/config/config.mk
293 EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
295 ifdef MOZ_MEMORY
296 ifeq ($(OS_ARCH),SunOS)
297 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DIST)/lib)
298 endif
299 endif
301 # When using gcc the assembly is inlined in the C-file (see jslock.cpp)
302 ifeq ($(OS_ARCH),SunOS)
303 ifneq (86,$(findstring 86,$(OS_TEST)))
304 ifndef GNU_CC
305 ASFILES = lock_$(OS_ARCH).s
306 endif
307 endif
308 endif
310 ifndef BUILD_OPT
311 MOCHAFILE = 1
312 endif
314 ifndef NSBUILDROOT
315 JSJAVA_STUBHEADERS = \
316 -I$(topsrcdir)/sun-java/include/_gen \
317 -I$(topsrcdir)/sun-java/netscape/javascript/_jri \
318 -I$(topsrcdir)/sun-java/netscape/security/_jri
319 else
320 JSJAVA_STUBHEADERS = -I$(JRI_GEN_DIR) -I$(JDK_GEN_DIR)
321 endif
323 JSJAVA_CFLAGS = \
324 -I$(topsrcdir)/sun-java/md-include \
325 -I$(topsrcdir)/sun-java/include \
326 $(JSJAVA_STUBHEADERS)
328 # Define keyword generator before rules.mk, see bug 323979 comment 50
330 HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX)
331 GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX)
333 HOST_SIMPLE_PROGRAMS += host_jsoplengen$(HOST_BIN_SUFFIX)
334 GARBAGE += jsautooplen.h host_jsoplengen$(HOST_BIN_SUFFIX)
336 USE_HOST_CXX = 1
338 ifdef HAVE_DTRACE
339 ifneq ($(OS_ARCH),Darwin)
340 DTRACE_PROBE_OBJ = $(LIBRARY_NAME)-dtrace.$(OBJ_SUFFIX)
341 endif
342 MOZILLA_DTRACE_SRC = $(srcdir)/javascript-trace.d
343 endif
345 include $(topsrcdir)/config/rules.mk
347 ifdef MOZ_SYNC_BUILD_FILES
348 # Because the SpiderMonkey can be distributed and built independently
349 # of the Mozilla source tree, it contains its own copies of many of
350 # the files used by the top-level Mozilla build process, from the
351 # 'config' and 'build' subtrees.
353 # To make it simpler to keep the copies in sync, we follow the policy
354 # that the SpiderMonkey copies must always be exact copies of those in
355 # the containing Mozilla tree. If you've made a change in one, it
356 # belongs in the other as well. If the change isn't right for both
357 # places, then that's something to bring up with the other developers.
359 # Some files are reasonable to diverge; for example,
360 # js/config/autoconf.mk.in doesn't need most of the stuff in
361 # config/autoconf.mk.in.
362 check-sync-dirs = $(PYTHON) $(srcdir)/config/check-sync-dirs.py
363 check::
364 $(check-sync-dirs) $(srcdir)/config $(MOZ_SYNC_BUILD_FILES)/config
365 $(check-sync-dirs) $(srcdir)/build $(MOZ_SYNC_BUILD_FILES)/build
366 endif
368 # our build system doesn't handle subdir srcs very gracefully today
369 export::
370 mkdir -p nanojit
372 DEFINES += -DEXPORT_JS_API
374 INCLUDES += -I$(srcdir)
376 # MSVC '-Gy' cc flag and '/OPT:REF' linker flag cause JS_GetArgument and
377 # JS_GetLocalVariable to be folded to the same address by the linker,
378 # leading to a crash on startup. See bug 151066. So, in optimized builds,
379 # add the /OPT:NOICF flag, which turns off 'identical COMDAT folding'.
381 # N.B.: 'identical COMDAT folding' that folds functions whose addresses
382 # are taken violates the ISO C and C++ standards.
383 ifndef MOZ_DEBUG
384 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
385 LDFLAGS += -OPT:NOICF
386 endif
387 endif
389 GARBAGE += jscpucfg.o jsautocfg.h jsautocfg.tmp jscpucfg
391 ifneq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
392 TARGETS += jscpucfg$(HOST_BIN_SUFFIX)
393 endif
395 ifdef JS_SAFE_ARENA
396 DEFINES += -DJS_USE_SAFE_ARENA
397 endif
399 ifdef JS_THREADSAFE
400 DEFINES += -DJS_THREADSAFE
401 endif
403 ifdef JS_NO_THIN_LOCKS
404 DEFINES += -DJS_USE_ONLY_NSPR_LOCKS
405 endif
407 ifdef JS_VERSION
408 DEFINES += -DJS_VERSION=$(JS_VERSION)
409 endif
411 ifneq ($(findstring -L,$(NSPR_LIBS)),)
412 NSPR_STATIC_PATH = $(subst -L,,$(findstring -L,$(NSPR_LIBS)))
413 else
414 NSPR_STATIC_PATH = $(DIST)/lib
415 endif
417 ifdef MOZ_SHARK
418 CFLAGS += -F/System/Library/PrivateFrameworks
419 CXXFLAGS += -F/System/Library/PrivateFrameworks
420 LDFLAGS += -F/System/Library/PrivateFrameworks -framework CHUD
421 endif
423 ifdef MOZ_VTUNE
424 CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include
425 EXTRA_DSO_LDOPTS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
426 LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
427 endif
429 # BeOS and HP-UX do not require the extra linking of "-lm"
430 ifeq (,$(filter BeOS HP-UX WINNT WINCE OpenVMS,$(OS_ARCH)))
431 EXTRA_LIBS += -lm
432 endif
434 # Prevent floating point errors caused by VC++ optimizations
435 ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
436 ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
437 CFLAGS += -Op
438 else
439 CFLAGS += -fp:precise
440 endif
441 endif # WINNT
443 ifeq ($(OS_ARCH),FreeBSD)
444 EXTRA_LIBS += -pthread
445 endif
446 ifeq ($(OS_ARCH),IRIX)
447 ifdef USE_N32
448 DASH_R += -n32
449 endif
450 endif
451 ifeq ($(OS_ARCH),Linux)
452 EXTRA_LIBS += -ldl
453 endif
454 ifeq ($(OS_ARCH),OSF1)
455 EXTRA_LIBS += -lc_r
456 endif
457 ifeq ($(OS_ARCH),SunOS)
458 ifeq ($(TARGET_CPU),sparc)
460 ifdef JS_ULTRASPARC_OPTS
461 DEFINES += -DULTRA_SPARC
462 ifdef GNU_CC
463 CFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0
464 CXXFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0,-K,PIC
465 else
466 ASFLAGS += -xarch=v8plus -DULTRA_SPARC -P -L -D_ASM -D__STDC__=0 -K PIC
467 endif # GNU_CC
468 endif # JS_ULTRASPARC_OPTS
470 endif
471 ifeq ($(OS_RELEASE),4.1)
472 EXTRA_LIBS += -ldl -lnsl
473 else
474 EXTRA_LIBS += -lposix4 -ldl -lnsl -lsocket
475 endif
476 endif
478 ifdef MOZ_MEMORY
479 ifeq ($(OS_ARCH),Darwin)
480 LDFLAGS += -ljemalloc
481 endif
482 endif
484 # Sun Studio x86 has an optimization bug with LIR.cpp, use -xO2 instead.
485 ifeq ($(OS_ARCH),SunOS)
486 ifeq (86,$(findstring 86,$(OS_TEST)))
487 ifndef GNU_CC
488 LIR.o: LIR.cpp Makefile.in
489 $(REPORT_BUILD)
490 @$(MAKE_DEPS_AUTO_CXX)
491 $(CXX) -o $@ -c $(patsubst -xO%,-xO2,$(COMPILE_CFLAGS)) $<
492 endif
493 endif
494 endif
496 # Allow building jsinterp.c with special optimization flags
497 ifdef INTERP_OPTIMIZER
498 jsinterp.$(OBJ_SUFFIX): MODULE_OPTIMIZE_FLAGS=$(INTERP_OPTIMIZER)
499 endif
501 ifeq ($(OS_ARCH),IRIX)
502 ifndef GNU_CC
503 _COMPILE_CFLAGS = $(patsubst -O%,-O1,$(COMPILE_CFLAGS))
504 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
505 $(REPORT_BUILD)
506 @$(MAKE_DEPS_AUTO_CXX)
507 $(CXX) -o $@ -c $(_COMPILE_CFLAGS) $<
508 endif
509 endif
511 # An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result.
512 # This suppresses optimization for this single compilation unit.
513 ifeq ($(OS_ARCH),AIX)
514 jsatom.o: jsatom.cpp Makefile.in
515 $(REPORT_BUILD)
516 @$(MAKE_DEPS_AUTO_CXX)
517 $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
518 jsdtoa.o: jsdtoa.cpp Makefile.in
519 $(REPORT_BUILD)
520 @$(MAKE_DEPS_AUTO_CXX)
521 $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
522 endif
524 jsopcode.h jsopcode.cpp: jsopcode.tbl
526 export:: jsautocfg.h
528 ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
529 jsautocfg.h:
530 touch $@
531 else
532 ifeq ($(OS_ARCH),WINCE)
533 jsautocfg.h:
534 touch $@
535 else
536 jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX)
537 @rm -f $@ jsautocfg.tmp
538 ./jscpucfg > jsautocfg.tmp
539 mv jsautocfg.tmp $@
540 endif
541 endif
543 # jscpucfg is a strange target
544 # Needs to be built with the host compiler but needs to include
545 # the mdcpucfg for the target so it needs the appropriate target defines
546 ifdef HOST_NSPR_MDCPUCFG
547 HOST_CXX := $(HOST_CXX) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG)
548 HOST_CXXFLAGS := $(patsubst -DXP_%,,$(HOST_CXXFLAGS))
549 endif
551 ifdef CROSS_COMPILE
552 # jscpucfg needs to know when it's supposed to produce a config for the target
553 JSCPUCFG_DEFINES = $(ACDEFINES)
554 endif
556 ifeq ($(OS_ARCH),QNX)
557 ifneq ($(OS_TARGET),NTO)
558 # QNX's compiler apparently can't build a binary directly from a source file.
559 jscpucfg.o: jscpucfg.cpp Makefile.in
560 $(HOST_CXX) $(HOST_CXXFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $<
562 jscpucfg: jscpucfg.o
563 $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $<
564 endif
565 else
566 ifeq ($(OS_ARCH),WINCE)
567 jscpucfg$(HOST_BIN_SUFFIX):
568 echo no need to build jscpucfg $<
569 else
570 jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in
571 $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $<
572 endif
573 endif
575 # Compute the linker flags that programs linking against SpiderMonkey should
576 # pass to get SpiderMonkey and its dependencies, beyond just the -L and -l
577 # for the SpiderMonkey library itself.
578 # - EXTRA_DSO_LDOPTS includes the NSPR -L and -l flags.
579 # - OS_LIBS includes libraries selected by the configure script.
580 # - EXTRA_LIBS includes libraries selected by this Makefile.
581 JS_CONFIG_LIBS=$(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS)
583 # The configure script invokes this rule explicitly at configure time!
584 # It's important that js-config be ready by the time we're done
585 # configuring, because we may be running other configure scripts that
586 # would like to run js-config themselves, before js is built.
588 # This file and rules.mk go through a certain amount of work to decide
589 # which libraries to build, what to name them, and what flags to pass
590 # when linking them (and thus what flags its own clients must pass).
591 # All this information needs to go into the js-config script. To
592 # avoid trying to re-compute all that in the configure script, we just
593 # have the configure script generate this Makefile, and then invoke
594 # this rule.
595 at=@
596 js-config: js-config.in Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk $(topsrcdir)/config/rules.mk
597 rm -f js-config.tmp
598 sed < $< > js-config.tmp \
599 -e 's|$(at)prefix$(at)|$(prefix)|' \
600 -e 's|$(at)exec_prefix$(at)|$(exec_prefix)|' \
601 -e 's|$(at)includedir$(at)|$(includedir)|' \
602 -e 's|$(at)libdir$(at)|$(libdir)|' \
603 -e 's|$(at)MOZILLA_VERSION$(at)|$(MOZILLA_VERSION)|' \
604 -e 's|$(at)LIBRARY_NAME$(at)|$(LIBRARY_NAME)|' \
605 -e 's|$(at)NSPR_CFLAGS$(at)|$(NSPR_CFLAGS)|' \
606 -e 's|$(at)JS_CONFIG_LIBS$(at)|$(JS_CONFIG_LIBS)|' \
607 -e 's|$(at)MOZ_JS_LIBS$(at)|$(MOZ_JS_LIBS)|' \
608 && mv js-config.tmp $@ && chmod +x $@
610 SCRIPTS = js-config
612 install:: $(INSTALLED_HEADERS)
613 $(INSTALL) $(IFLAGS1) $^ $(includedir)/$(MODULE)
615 install:: $(SCRIPTS) $(PROGRAM)
616 $(INSTALL) $(IFLAGS2) $^ $(bindir)
618 # The Mozilla top-level makefiles use install-runtime-libs directly to
619 # place an additional copy of the libraries in the 'dist/bin'
620 # directory.
621 install:: install-runtime-libs
622 install-runtime-libs:: $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
623 ifneq (,$(LIBRARY))
624 $(INSTALL) $(IFLAGS1) $(LIBRARY) $(libdir)
625 endif
626 ifneq (,$(SHARED_LIBRARY))
627 $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(libdir)
628 endif
629 ifneq (,$(IMPORT_LIBRARY))
630 $(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(libdir)
631 endif
633 # Extra dependancies and rules for auto-generated headers
634 host_jskwgen.$(OBJ_SUFFIX): jsversion.h jskeyword.tbl
636 # Use CURDIR to avoid finding a jsautokw.h in the source tree (from a
637 # previous build?) via VPATH when we're building in a separate tree.
638 $(CURDIR)/jsautokw.h: host_jskwgen$(HOST_BIN_SUFFIX)
639 ./host_jskwgen$(HOST_BIN_SUFFIX) $@
641 host_jsoplengen.$(OBJ_SUFFIX): jsopcode.tbl
643 # Use CURDIR to avoid finding a jsautooplen.h in the source tree (from
644 # a previous build?) via VPATH when we're building in a separate tree.
645 $(CURDIR)/jsautooplen.h: host_jsoplengen$(HOST_BIN_SUFFIX)
646 ./host_jsoplengen$(HOST_BIN_SUFFIX) $@
648 # Force auto-header generation before compiling any source that may use them
649 $(CPPSRCS:%.cpp=%.$(OBJ_SUFFIX)): $(CURDIR)/jsautokw.h $(CURDIR)/jsautooplen.h
651 ifdef HAVE_DTRACE
652 $(CURDIR)/javascript-trace.h: $(srcdir)/javascript-trace.d
653 dtrace -h -s $(srcdir)/javascript-trace.d -o javascript-trace.h.in
654 sed 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
655 javascript-trace.h.in > javascript-trace.h
657 # We can't automatically generate dependencies on auto-generated headers;
658 # we have to list them explicitly.
659 $(addsuffix .$(OBJ_SUFFIX),jsdtracef jsinterp jsobj): $(CURDIR)/javascript-trace.h
660 endif