Bug 505523 - Property cache can skip JSClass::resolve or JSClass::addProperty hooks...
[mozilla-central.git] / js / src / Makefile.in
blobf45bb0398b14bbab7353b54ecc76fe1beb543336
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 run_for_side_effects := $(shell echo "MAKE: $(MAKE)")
45 include $(DEPTH)/config/autoconf.mk
47 DIRS = config
49 ifdef DEHYDRA_PATH
50 DIRS += analysis-tests
51 endif
53 ifdef JS_NATIVE_EDITLINE
54 DIRS += editline
55 endif
57 # editline needs to get built before the shell
58 ifndef JS_DISABLE_SHELL
59 DIRS += shell
60 endif
62 # FIXME: bug 515383 covers getting these working on wince
63 ifndef WINCE
64 ifdef ENABLE_TESTS
65 DIRS += jsapi-tests
66 endif
67 endif
69 ifdef ENABLE_TESTS
70 DIRS += tests
71 endif
73 MODULE = js
74 LIBRARY_NAME = mozjs
75 STATIC_LIBRARY_NAME = js_static
76 GRE_MODULE = 1
78 LIBS = $(NSPR_LIBS)
80 ifdef GNU_CXX
81 ifdef INTEL_CXX
82 # icc gets special optimize flags
83 ifdef MOZ_PROFILE_GENERATE
84 MODULE_OPTIMIZE_FLAGS = -O0
85 else
86 MODULE_OPTIMIZE_FLAGS = -O2 -ip
87 #XXX: do we want different INTERP_OPTIMIZER flags here?
88 endif
89 else # not INTEL_CXX
90 MODULE_OPTIMIZE_FLAGS = -O3 -fstrict-aliasing $(MOZ_OPTIMIZE_SIZE_TWEAK)
91 # Special optimization flags for jsinterp.c
92 INTERP_OPTIMIZER = -O3 -fstrict-aliasing
93 endif
94 else # not GNU_CXX
95 ifeq ($(OS_ARCH),SunOS)
96 MODULE_OPTIMIZE_FLAGS = -xO4
97 endif
98 ifeq ($(OS_ARCH),WINNT)
99 ifdef WINCE
100 # -GL is not supported on windows mobile while we are using the arm-wince-link command
101 MODULE_OPTIMIZE_FLAGS = -O2
102 else
103 MODULE_OPTIMIZE_FLAGS = -O2 -GL
104 endif
105 endif
106 endif
109 # JavaScript must be built shared, even for static builds, as it is used by
110 # other modules which are always built shared. Failure to do so results in
111 # the js code getting copied into xpinstall and jsd as well as mozilla-bin,
112 # and then the static data cells used for locking no longer work.
114 # In fact, we now build both a static and a shared library, as the
115 # JS shell would like to link to the static library.
117 FORCE_SHARED_LIB = 1
118 FORCE_STATIC_LIB = 1
120 VPATH = $(srcdir)
122 CPPSRCS = \
123 jsapi.cpp \
124 jsarena.cpp \
125 jsarray.cpp \
126 jsatom.cpp \
127 jsbool.cpp \
128 jscntxt.cpp \
129 jsdate.cpp \
130 jsdbgapi.cpp \
131 jsdhash.cpp \
132 jsdtoa.cpp \
133 jsemit.cpp \
134 jsexn.cpp \
135 jsfun.cpp \
136 jsgc.cpp \
137 jshash.cpp \
138 jsinterp.cpp \
139 jsinvoke.cpp \
140 jsiter.cpp \
141 jslock.cpp \
142 jslog2.cpp \
143 jsmath.cpp \
144 jsnum.cpp \
145 jsobj.cpp \
146 json.cpp \
147 jsopcode.cpp \
148 jsparse.cpp \
149 jsprf.cpp \
150 jsregexp.cpp \
151 jsscan.cpp \
152 jsscope.cpp \
153 jsscript.cpp \
154 jsstr.cpp \
155 jstask.cpp \
156 jsutil.cpp \
157 jsxdrapi.cpp \
158 jsxml.cpp \
159 prmjtime.cpp \
160 $(NULL)
162 ifdef HAVE_DTRACE
163 CPPSRCS += \
164 jsdtracef.cpp
165 endif
167 INSTALLED_HEADERS = \
168 js-config.h \
169 jsautocfg.h \
170 $(CURDIR)/jsautokw.h \
171 js.msg \
172 jsapi.h \
173 jsarray.h \
174 jsarena.h \
175 jsatom.h \
176 jsbit.h \
177 jsbool.h \
178 jsclist.h \
179 jscntxt.h \
180 jscompat.h \
181 jsdate.h \
182 jsdbgapi.h \
183 jsdhash.h \
184 jsdtoa.h \
185 jsemit.h \
186 jsfun.h \
187 jsgc.h \
188 jshash.h \
189 jsinterp.h \
190 jsinttypes.h \
191 jsiter.h \
192 jslock.h \
193 jslong.h \
194 jsmath.h \
195 jsnum.h \
196 jsobj.h \
197 jsobjinlines.h \
198 json.h \
199 jsopcode.tbl \
200 jsopcode.h \
201 jsotypes.h \
202 jsparse.h \
203 jsprf.h \
204 jsproto.tbl \
205 jsprvtd.h \
206 jspubtd.h \
207 jsregexp.h \
208 jsscan.h \
209 jsscope.h \
210 jsscript.h \
211 jsscriptinlines.h \
212 jsstaticcheck.h \
213 jsstr.h \
214 jstask.h \
215 jstracer.h \
216 jstypes.h \
217 jsutil.h \
218 jsvector.h \
219 jstl.h \
220 jsversion.h \
221 jsxdrapi.h \
222 jsxml.h \
223 $(NULL)
225 ifdef ENABLE_JIT
226 VPATH += $(srcdir)/nanojit
228 INSTALLED_HEADERS += \
229 jsbuiltins.h \
230 Assembler.h \
231 Allocator.h \
232 CodeAlloc.h \
233 Containers.h \
234 LIR.h \
235 avmplus.h \
236 Fragmento.h \
237 Native.h \
238 Native$(NANOJIT_ARCH).h \
239 RegAlloc.h \
240 nanojit.h \
241 VMPI.h \
242 $(NULL)
244 CPPSRCS += \
245 jstracer.cpp \
246 Assembler.cpp \
247 Allocator.cpp \
248 CodeAlloc.cpp \
249 Containers.cpp \
250 Fragmento.cpp \
251 LIR.cpp \
252 RegAlloc.cpp \
253 avmplus.cpp \
254 Native$(NANOJIT_ARCH).cpp \
255 jsbuiltins.cpp \
256 VMPI.cpp \
257 $(NULL)
259 ifdef WINCE
260 # don't need -c
261 AS_DASH_C_FLAG =
262 ASFLAGS += -arch 6
263 ASFILES += jswince.asm
264 endif
266 endif # ENABLE_JIT
268 ifdef HAVE_DTRACE
269 INSTALLED_HEADERS += \
270 jsdtracef.h \
271 $(CURDIR)/javascript-trace.h \
272 $(NULL)
273 endif
275 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
276 INSTALLED_HEADERS += jscpucfg.h
277 endif
279 EXPORTS = $(INSTALLED_HEADERS)
281 DASH_R = -r
283 ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
284 SDK_LIBRARY = $(IMPORT_LIBRARY)
285 else
286 SDK_LIBRARY = $(SHARED_LIBRARY)
287 endif
289 include $(topsrcdir)/config/config.mk
291 EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
293 ifdef MOZ_MEMORY
294 ifeq ($(OS_ARCH),SunOS)
295 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DIST)/lib)
296 endif
297 endif
299 ifndef BUILD_OPT
300 MOCHAFILE = 1
301 endif
303 # Define keyword generator before rules.mk, see bug 323979 comment 50
305 HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX)
306 GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX)
308 HOST_SIMPLE_PROGRAMS += host_jsoplengen$(HOST_BIN_SUFFIX)
309 GARBAGE += jsautooplen.h host_jsoplengen$(HOST_BIN_SUFFIX)
311 USE_HOST_CXX = 1
313 ifdef HAVE_DTRACE
314 ifneq ($(OS_ARCH),Darwin)
315 DTRACE_PROBE_OBJ = $(LIBRARY_NAME)-dtrace.$(OBJ_SUFFIX)
316 endif
317 MOZILLA_DTRACE_SRC = $(srcdir)/javascript-trace.d
318 endif
320 default::
322 ifneq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
323 ifneq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH)))
324 # nsinstall doesn't get built until we enter config/ in the exports phase,
325 # so we'll have to manually ensure it gets built here if we want to use
326 # $(EXPORTS)
327 export:: config/nsinstall$(HOST_BIN_SUFFIX)
328 $(PUBLIC) $(SDK_PUBLIC): config/nsinstall$(HOST_BIN_SUFFIX)
330 config/nsinstall$(HOST_BIN_SUFFIX): $(srcdir)/config/nsinstall.c $(srcdir)/config/pathsub.c
331 $(MAKE) -C config/ nsinstall$(HOST_BIN_SUFFIX)
332 endif
333 endif
335 include $(topsrcdir)/config/rules.mk
337 ifdef MOZ_SYNC_BUILD_FILES
338 # Because the SpiderMonkey can be distributed and built independently
339 # of the Mozilla source tree, it contains its own copies of many of
340 # the files used by the top-level Mozilla build process, from the
341 # 'config' and 'build' subtrees.
343 # To make it simpler to keep the copies in sync, we follow the policy
344 # that the SpiderMonkey copies must always be exact copies of those in
345 # the containing Mozilla tree. If you've made a change in one, it
346 # belongs in the other as well. If the change isn't right for both
347 # places, then that's something to bring up with the other developers.
349 # Some files are reasonable to diverge; for example,
350 # js/config/autoconf.mk.in doesn't need most of the stuff in
351 # config/autoconf.mk.in.
352 check-sync-dirs = $(PYTHON) $(srcdir)/config/check-sync-dirs.py
353 check::
354 $(check-sync-dirs) $(srcdir)/config $(MOZ_SYNC_BUILD_FILES)/config
355 $(check-sync-dirs) $(srcdir)/build $(MOZ_SYNC_BUILD_FILES)/build
357 check-valgrind::
358 $(check-sync-dirs) $(srcdir)/config $(MOZ_SYNC_BUILD_FILES)/config
359 $(check-sync-dirs) $(srcdir)/build $(MOZ_SYNC_BUILD_FILES)/build
360 endif
362 ifdef ENABLE_JIT
363 check::
364 $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/trace-test/trace-test.py \
365 --no-slow --no-progress --tinderbox $(DIST)/bin/js$(BIN_SUFFIX)
367 check-valgrind::
368 $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/trace-test/trace-test.py \
369 --valgrind --no-slow --no-progress --tinderbox $(DIST)/bin/js$(BIN_SUFFIX)
370 endif
372 DIST_GARBAGE = config.cache config.log config.status \
373 config/myrules.mk config/myconfig.mk \
374 unallmakefiles js-config js-config.h js-confdefs.h
376 distclean::
377 cat unallmakefiles | $(XARGS) rm -f
378 rm -f $(DIST_GARBAGE)
380 # our build system doesn't handle subdir srcs very gracefully today
381 export::
382 mkdir -p nanojit
384 DEFINES += -DEXPORT_JS_API
386 INCLUDES += -I$(srcdir)
388 GARBAGE += jscpucfg.o jsautocfg.h jsautocfg.tmp jscpucfg
390 ifneq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
391 TARGETS += jscpucfg$(HOST_BIN_SUFFIX)
392 endif
394 ifdef JS_THREADSAFE
395 DEFINES += -DJS_THREADSAFE
396 endif
398 ifdef JS_NO_THIN_LOCKS
399 DEFINES += -DJS_USE_ONLY_NSPR_LOCKS
400 endif
402 ifdef JS_VERSION
403 DEFINES += -DJS_VERSION=$(JS_VERSION)
404 endif
406 ifneq ($(findstring -L,$(NSPR_LIBS)),)
407 NSPR_STATIC_PATH = $(subst -L,,$(findstring -L,$(NSPR_LIBS)))
408 else
409 NSPR_STATIC_PATH = $(DIST)/lib
410 endif
412 ifdef MOZ_SHARK
413 CFLAGS += -F/System/Library/PrivateFrameworks
414 CXXFLAGS += -F/System/Library/PrivateFrameworks
415 LDFLAGS += -F/System/Library/PrivateFrameworks -framework CHUD
416 endif
418 ifdef MOZ_VTUNE
419 CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include
420 EXTRA_DSO_LDOPTS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
421 LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
422 endif
424 # BeOS and HP-UX do not require the extra linking of "-lm"
425 ifeq (,$(filter BeOS HP-UX WINNT WINCE OpenVMS OS2,$(OS_ARCH)))
426 EXTRA_LIBS += -lm
427 endif
429 # Prevent floating point errors caused by VC++ optimizations
430 ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
431 ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
432 CFLAGS += -Op
433 else
434 CFLAGS += -fp:precise
435 endif
436 endif # WINNT
438 ifeq ($(OS_ARCH),FreeBSD)
439 EXTRA_LIBS += -pthread
440 endif
441 ifeq ($(OS_ARCH),IRIX)
442 ifdef USE_N32
443 DASH_R += -n32
444 endif
445 endif
446 ifeq ($(OS_ARCH),Linux)
447 EXTRA_LIBS += -ldl
448 endif
449 ifeq ($(OS_ARCH),OSF1)
450 EXTRA_LIBS += -lc_r
451 endif
452 ifeq ($(OS_ARCH),SunOS)
453 ifeq ($(TARGET_CPU),sparc)
455 ifdef GNU_CC
456 CFLAGS += -mcpu=v9
457 CXXFLAGS += -mcpu=v9
458 endif # GNU_CC
460 endif
461 ifeq ($(OS_RELEASE),4.1)
462 EXTRA_LIBS += -ldl -lnsl
463 else
464 EXTRA_LIBS += -lposix4 -ldl -lnsl -lsocket
465 endif
466 endif
468 ifdef MOZ_MEMORY
469 ifeq ($(OS_ARCH),Darwin)
470 LDFLAGS += -ljemalloc
471 endif
472 endif
474 ifdef SOLARIS_SUNPRO_CXX
475 # Sun Studio x86 has an optimization bug with LIR.cpp, use -xO2 instead.
476 ifeq (86,$(findstring 86,$(OS_TEST)))
477 LIR.o: LIR.cpp Makefile.in
478 $(REPORT_BUILD)
479 @$(MAKE_DEPS_AUTO_CXX)
480 $(CXX) -o $@ -c $(patsubst -xO%,-xO2,$(COMPILE_CFLAGS)) $<
481 else
482 # Sun Studio SPARC doesn't work well with gcc inline asm, use lock_SunOS_sparc*.il
483 jslock.o: jslock.cpp Makefile.in lock_sparcv8plus.il lock_sparcv9.il
484 $(REPORT_BUILD)
485 @$(MAKE_DEPS_AUTO_CXX)
486 ifeq (sparcv9,$(findstring sparcv9,$(OS_TEST)))
487 $(CXX) -o $@ -c $(COMPILE_CFLAGS) $(srcdir)/lock_sparcv9.il $<
488 else
489 $(CXX) -o $@ -c $(COMPILE_CFLAGS) $(srcdir)/lock_sparcv8plus.il $<
490 endif # sparcv9
491 endif # x86
492 endif # SOLARIS_SUNPRO_CXX
494 # Allow building jsinterp.c with special optimization flags
495 ifdef INTERP_OPTIMIZER
496 jsinterp.$(OBJ_SUFFIX): MODULE_OPTIMIZE_FLAGS=$(INTERP_OPTIMIZER)
497 endif
499 ifeq ($(OS_ARCH),IRIX)
500 ifndef GNU_CC
501 _COMPILE_CFLAGS = $(patsubst -O%,-O1,$(COMPILE_CFLAGS))
502 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
503 $(REPORT_BUILD)
504 @$(MAKE_DEPS_AUTO_CXX)
505 $(CXX) -o $@ -c $(_COMPILE_CFLAGS) $<
506 endif
507 endif
509 # An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result.
510 # This suppresses optimization for this single compilation unit.
511 ifeq ($(OS_ARCH),AIX)
512 jsatom.o: jsatom.cpp Makefile.in
513 $(REPORT_BUILD)
514 @$(MAKE_DEPS_AUTO_CXX)
515 $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
516 jsdtoa.o: jsdtoa.cpp Makefile.in
517 $(REPORT_BUILD)
518 @$(MAKE_DEPS_AUTO_CXX)
519 $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
520 endif
522 export:: jsautocfg.h
524 ifeq (,$(CROSS_COMPILE)$(GNU_CC)$(filter-out WINNT,$(OS_ARCH)))
525 jsautocfg.h:
526 touch $@
527 else
528 ifeq ($(OS_ARCH),WINCE)
529 jsautocfg.h:
530 touch $@
531 else
532 jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX)
533 @rm -f $@ jsautocfg.tmp
534 ./jscpucfg > jsautocfg.tmp
535 mv jsautocfg.tmp $@
536 endif
537 endif
539 # jscpucfg is a strange target
540 # Needs to be built with the host compiler but needs to include
541 # the mdcpucfg for the target so it needs the appropriate target defines
542 ifdef HOST_NSPR_MDCPUCFG
543 HOST_CXX := $(HOST_CXX) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG)
544 HOST_CXXFLAGS := $(patsubst -DXP_%,,$(HOST_CXXFLAGS))
545 endif
547 ifdef CROSS_COMPILE
548 # jscpucfg needs to know when it's supposed to produce a config for the target
549 JSCPUCFG_DEFINES = $(ACDEFINES)
550 endif
552 ifeq ($(OS_ARCH),QNX)
553 ifneq ($(OS_TARGET),NTO)
554 # QNX's compiler apparently can't build a binary directly from a source file.
555 jscpucfg.o: jscpucfg.cpp Makefile.in
556 $(HOST_CXX) $(HOST_CXXFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $<
558 jscpucfg: jscpucfg.o
559 $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $<
560 endif
561 else
562 ifeq ($(OS_ARCH),WINCE)
563 jscpucfg$(HOST_BIN_SUFFIX):
564 echo no need to build jscpucfg $<
565 else
566 jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in
567 $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $<
568 endif
569 endif
571 # Compute the linker flags that programs linking against SpiderMonkey should
572 # pass to get SpiderMonkey and its dependencies, beyond just the -L and -l
573 # for the SpiderMonkey library itself.
574 # - EXTRA_DSO_LDOPTS includes the NSPR -L and -l flags.
575 # - OS_LIBS includes libraries selected by the configure script.
576 # - EXTRA_LIBS includes libraries selected by this Makefile.
577 JS_CONFIG_LIBS=$(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS)
579 # The configure script invokes this rule explicitly at configure time!
580 # It's important that js-config be ready by the time we're done
581 # configuring, because we may be running other configure scripts that
582 # would like to run js-config themselves, before js is built.
584 # This file and rules.mk go through a certain amount of work to decide
585 # which libraries to build, what to name them, and what flags to pass
586 # when linking them (and thus what flags its own clients must pass).
587 # All this information needs to go into the js-config script. To
588 # avoid trying to re-compute all that in the configure script, we just
589 # have the configure script generate this Makefile, and then invoke
590 # this rule.
591 at=@
592 js-config: js-config.in Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk $(topsrcdir)/config/rules.mk
593 rm -f js-config.tmp
594 sed < $< > js-config.tmp \
595 -e 's|$(at)prefix$(at)|$(prefix)|' \
596 -e 's|$(at)exec_prefix$(at)|$(exec_prefix)|' \
597 -e 's|$(at)includedir$(at)|$(includedir)|' \
598 -e 's|$(at)libdir$(at)|$(libdir)|' \
599 -e 's|$(at)MOZILLA_VERSION$(at)|$(MOZILLA_VERSION)|' \
600 -e 's|$(at)LIBRARY_NAME$(at)|$(LIBRARY_NAME)|' \
601 -e 's|$(at)NSPR_CFLAGS$(at)|$(NSPR_CFLAGS)|' \
602 -e 's|$(at)JS_CONFIG_LIBS$(at)|$(JS_CONFIG_LIBS)|' \
603 -e 's|$(at)MOZ_JS_LIBS$(at)|$(MOZ_JS_LIBS)|' \
604 && mv js-config.tmp $@ && chmod +x $@
606 SCRIPTS = js-config
607 SDK_BINARY = js-config
609 install:: $(INSTALLED_HEADERS)
610 $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE)
612 install:: $(SCRIPTS)
613 $(SYSINSTALL) $^ $(DESTDIR)$(bindir)
615 install:: $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
616 ifneq (,$(LIBRARY))
617 $(SYSINSTALL) $(LIBRARY) $(DESTDIR)$(libdir)
618 endif
619 ifneq (,$(SHARED_LIBRARY))
620 $(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir)
621 endif
622 ifneq (,$(IMPORT_LIBRARY))
623 $(SYSINSTALL) $(IMPORT_LIBRARY) $(DESTDIR)$(libdir)
624 endif
626 # Extra dependancies and rules for auto-generated headers
627 host_jskwgen.$(OBJ_SUFFIX): jsversion.h jskeyword.tbl
629 # Use CURDIR to avoid finding a jsautokw.h in the source tree (from a
630 # previous build?) via VPATH when we're building in a separate tree.
631 $(CURDIR)/jsautokw.h: host_jskwgen$(HOST_BIN_SUFFIX)
632 ./host_jskwgen$(HOST_BIN_SUFFIX) $@
634 host_jsoplengen.$(OBJ_SUFFIX): jsopcode.tbl
636 # Use CURDIR to avoid finding a jsautooplen.h in the source tree (from
637 # a previous build?) via VPATH when we're building in a separate tree.
638 $(CURDIR)/jsautooplen.h: host_jsoplengen$(HOST_BIN_SUFFIX)
639 ./host_jsoplengen$(HOST_BIN_SUFFIX) $@
641 # Force auto-header generation before compiling any source that may use them
642 $(CPPSRCS:%.cpp=%.$(OBJ_SUFFIX)): $(CURDIR)/jsautokw.h $(CURDIR)/jsautooplen.h
644 ifdef HAVE_DTRACE
645 $(CURDIR)/javascript-trace.h: $(srcdir)/javascript-trace.d
646 dtrace -h -s $(srcdir)/javascript-trace.d -o javascript-trace.h.in
647 sed 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
648 javascript-trace.h.in > javascript-trace.h
650 # We can't automatically generate dependencies on auto-generated headers;
651 # we have to list them explicitly.
652 $(addsuffix .$(OBJ_SUFFIX),jsdtracef jsinterp jsobj): $(CURDIR)/javascript-trace.h
653 endif
655 ifdef GNU_CC
656 ifndef CROSS_COMPILE
657 # If we don't have run-mozilla.sh *and* we're linking against NSPR, we don't
658 # know how to run the JS binary. Oh well
660 imacro_asm.js: imacro_asm.js.in jsopcode.tbl
661 $(CC) -c -x c -E -P -I$(srcdir) $< > $@
663 GARBAGE += imacros.c.tmp imacro_asm.js
665 ifneq (,$(wildcard $(RUN_TEST_PROGRAM))$(if $(NSPR_LIBS),,1))
666 libs:: imacro_asm.js $(srcdir)/imacros.jsasm
667 $(wildcard $(RUN_TEST_PROGRAM)) $(DIST)/bin/js$(BIN_SUFFIX) $< $(srcdir)/imacros.jsasm > imacros.c.tmp
668 @cmp -s imacros.c.tmp $(srcdir)/imacros.c.out || \
669 (echo "imacros.c.out is out of date. Run 'make update-imacros' to copy it to your source tree."; diff -U 4 $(srcdir)/imacros.c.out imacros.c.out; exit 1)
670 @echo "imacros.c.out is up to date"
672 update-imacros: imacros.c.tmp
673 cp $< $(srcdir)/imacros.c.out
675 # Code for importing the nanojit subtree from its repository.
677 NANOJIT_CENTRAL_REV=$(shell cat $(srcdir)/nanojit-import-rev)
678 NANOJIT_CENTRAL_REPO=http://hg.mozilla.org/projects/nanojit-central
679 NANOJIT_CENTRAL_LOCAL=$(CURDIR)/nanojit-central
680 CUR_REPO=$(srcdir)/../..
682 update-nanojit:
683 rm -Rf $(NANOJIT_CENTRAL_LOCAL) import-splicemap import-revmap
684 hg clone $(NANOJIT_CENTRAL_REPO) $(NANOJIT_CENTRAL_LOCAL)
685 python $(srcdir)/find-child.py \
686 --src=$(NANOJIT_CENTRAL_LOCAL) \
687 --dst=$(CUR_REPO) \
688 --start=$(NANOJIT_CENTRAL_REV) \
689 --filemap=$(srcdir)/nanojit-import-filemap \
690 >import-splicemap
691 hg convert --config convert.hg.saverev=True \
692 --config convert.hg.startrev=`cut -d ' ' -f 1 import-splicemap` \
693 --filemap=$(srcdir)/nanojit-import-filemap \
694 --splicemap=import-splicemap \
695 $(NANOJIT_CENTRAL_LOCAL) \
696 $(CUR_REPO) \
697 import-revmap
698 (cd $(srcdir) && hg up)
699 (cd $(NANOJIT_CENTRAL_LOCAL) && hg log -r tip --template "{node}\n") >$(srcdir)/nanojit-import-rev
700 (cd $(srcdir) && hg commit --message="Update nanojit-import-rev stamp." nanojit-import-rev)
702 .PHONY: update-imacros update-nanojit
703 endif
704 endif
705 endif