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
16 # The Original Code is Mozilla Communicator client code, released
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.
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 *****
41 topsrcdir
= @top_srcdir@
44 run_for_side_effects
:= $(shell echo
"MAKE: $(MAKE)")
45 include $(DEPTH
)/config
/autoconf.mk
50 DIRS
+= analysis-tests
53 ifdef JS_NATIVE_EDITLINE
57 # editline needs to get built before the shell
58 ifndef JS_DISABLE_SHELL
62 # FIXME: bug 515383 covers getting these working on wince
63 # bug 530688 covers Android
64 ifneq (,$(filter-out WINCE ANDROID
,$(OS_ARCH
)))
76 STATIC_LIBRARY_NAME
= js_static
83 # icc gets special optimize flags
84 ifdef MOZ_PROFILE_GENERATE
85 MODULE_OPTIMIZE_FLAGS
= -O0
87 MODULE_OPTIMIZE_FLAGS
= -O2
-ip
91 MODULE_OPTIMIZE_FLAGS
= -O3
-fstrict-aliasing
93 # We normally want -fomit-frame-pointer, but we want an explicit
94 # -fno-omit-frame-pointer if we're using a sampling profiler.
96 MODULE_OPTIMIZE_FLAGS
+= -fomit-frame-pointer
98 MODULE_OPTIMIZE_FLAGS
+= -fno-omit-frame-pointer
103 ifeq ($(OS_ARCH
),SunOS
)
104 MODULE_OPTIMIZE_FLAGS
= -xO4
106 ifeq ($(OS_ARCH
),WINNT
)
107 MODULE_OPTIMIZE_FLAGS
= -O2
112 # JavaScript must be built shared, even for static builds, as it is used by
113 # other modules which are always built shared. Failure to do so results in
114 # the js code getting copied into xpinstall and jsd as well as mozilla-bin,
115 # and then the static data cells used for locking no longer work.
117 # In fact, we now build both a static and a shared library, as the
118 # JS shell would like to link to the static library.
120 ifdef JS_SHARED_LIBRARY
165 jspropertycache.
cpp \
182 INSTALLED_HEADERS
= \
185 $(CURDIR
)/jsautokw.h \
229 jspropertycacheinlines.h \
260 ifdef ENABLE_TRACEJIT
265 INSTALLED_HEADERS
+= \
277 Native
$(NANOJIT_ARCH
).h \
297 Native
$(NANOJIT_ARCH
).
cpp \
307 ASFILES
+= jswince.asm
310 endif # ENABLE_TRACEJIT
311 ifdef ENABLE_METHODJIT
313 ###############################################
314 # BEGIN include sources for the method JIT
316 VPATH
+= $(srcdir)/methodjit
318 CPPSRCS
+= MethodJIT.
cpp \
330 TrampolineCompiler.
cpp \
332 # PICStubCompiler.cpp \
334 ifeq (86, $(findstring 86,$(TARGET_CPU
)))
335 ifeq (x86_64
, $(TARGET_CPU
))
337 ASFILES
+= TrampolineMasmX64.asm
339 ifdef SOLARIS_SUNPRO_CXX
340 ASFILES
+= TrampolineSUNWX64.s
342 #CPPSRCS += only_on_x86_64.cpp
344 #CPPSRCS += only_on_x86.cpp
345 ifdef SOLARIS_SUNPRO_CXX
346 ASFILES
+= TrampolineSUNWX86.s
350 ifeq (arm
, $(TARGET_CPU
))
351 #CPPSRCS += only_on_arm.cpp
354 # END enclude sources for the method JIT
355 #############################################
359 ###############################################
360 # BEGIN include sources for V8 dtoa
362 VPATH
+= $(srcdir)/v8-dtoa \
365 CPPSRCS
+= checks.
cc \
375 # END enclude sources for V8 dtoa
376 #############################################
378 ifeq (,$(filter-out powerpc sparc
,$(TARGET_CPU
)))
380 VPATH
+= $(srcdir)/assembler \
381 $(srcdir)/assembler
/wtf \
382 $(srcdir)/yarr
/pcre \
385 CPPSRCS
+= pcre_compile.
cpp \
389 pcre_ucp_searchfuncs.
cpp \
393 ###############################################
394 # BEGIN include sources for the Nitro assembler
396 VPATH
+= $(srcdir)/assembler \
397 $(srcdir)/assembler
/wtf \
398 $(srcdir)/assembler
/jit \
399 $(srcdir)/assembler
/assembler \
400 $(srcdir)/methodjit \
402 $(srcdir)/yarr
/yarr \
403 $(srcdir)/yarr
/pcre \
407 CPPSRCS
+= Assertions.
cpp \
408 ExecutableAllocatorPosix.
cpp \
409 ExecutableAllocatorWin.
cpp \
410 ExecutableAllocatorOS2.
cpp \
411 ExecutableAllocator.
cpp \
414 MacroAssemblerARM.
cpp \
415 MacroAssemblerX86Common.
cpp \
422 pcre_ucp_searchfuncs.
cpp \
425 ifeq (86, $(findstring 86,$(TARGET_CPU
)))
426 ifeq (x86_64
, $(TARGET_CPU
))
427 #CPPSRCS += only_on_x86_64.cpp
429 #CPPSRCS += only_on_x86.cpp
432 ifeq (arm
, $(TARGET_CPU
))
433 #CPPSRCS += only_on_arm.cpp
436 # END enclude sources for the Nitro assembler
437 #############################################
442 VPATH
+= $(srcdir)/ctypes
450 -Ictypes
/libffi
/include \
454 ifeq ($(OS_ARCH
),OS2
)
455 SHARED_LIBRARY_LIBS
+= \
456 ctypes
/libffi
/.libs
/ffi.a \
459 SHARED_LIBRARY_LIBS
+= \
460 ctypes
/libffi
/.libs
/libffi.
$(LIB_SUFFIX
) \
464 endif # JS_HAS_CTYPES
467 INSTALLED_HEADERS
+= \
468 $(CURDIR
)/javascript-trace.h \
472 # PerfMeasurement is available regardless of low-level support for it;
473 # it just doesn't necessarily do anything useful. There is one
474 # implementation source file per supported operating system, plus a stub
475 # for unsupported OSes, plus the Javascript wrapper.
476 VPATH
+= $(srcdir)/perf
477 INSTALLED_HEADERS
+= jsperf.h
478 CPPSRCS
+= jsperf.
cpp
479 ifdef HAVE_LINUX_PERF_EVENT_H
480 CPPSRCS
+= pm_linux.
cpp
482 CPPSRCS
+= pm_stub.
cpp
485 ifeq (,$(filter-out WINNT WINCE
,$(OS_ARCH
)))
486 INSTALLED_HEADERS
+= jscpucfg.h
489 EXPORTS
= $(INSTALLED_HEADERS
)
493 ifneq (,$(filter OS2 WINCE WINNT
,$(OS_ARCH
)))
494 SDK_LIBRARY
= $(IMPORT_LIBRARY
)
496 SDK_LIBRARY
= $(SHARED_LIBRARY
)
499 include $(topsrcdir
)/config
/config.mk
501 EXTRA_DSO_LDOPTS
+= $(NSPR_LIBS
)
507 # Define keyword generator before rules.mk, see bug 323979 comment 50
509 HOST_SIMPLE_PROGRAMS
+= host_jskwgen
$(HOST_BIN_SUFFIX
)
510 GARBAGE
+= jsautokw.h host_jskwgen
$(HOST_BIN_SUFFIX
)
512 HOST_SIMPLE_PROGRAMS
+= host_jsoplengen
$(HOST_BIN_SUFFIX
)
513 GARBAGE
+= jsautooplen.h host_jsoplengen
$(HOST_BIN_SUFFIX
)
518 ifneq ($(OS_ARCH
),Darwin
)
519 DTRACE_PROBE_OBJ
= $(LIBRARY_NAME
)-dtrace.
$(OBJ_SUFFIX
)
521 MOZILLA_DTRACE_SRC
= $(srcdir)/javascript-trace.d
526 ifneq (,$(CROSS_COMPILE
)$(filter-out WINNT OS2
,$(OS_ARCH
)))
527 ifneq (,$(filter-out SYMBIAN WINCE
,$(OS_ARCH
)))
528 # nsinstall doesn't get built until we enter config/ in the exports phase,
529 # so we'll have to manually ensure it gets built here if we want to use
531 export:: config
/nsinstall
$(HOST_BIN_SUFFIX
)
532 $(PUBLIC
) $(SDK_PUBLIC
): config
/nsinstall
$(HOST_BIN_SUFFIX
)
534 config
/nsinstall
$(HOST_BIN_SUFFIX
): $(srcdir)/config
/nsinstall.c
$(srcdir)/config
/pathsub.c
535 $(MAKE
) -C config
/ nsinstall
$(HOST_BIN_SUFFIX
)
539 include $(topsrcdir
)/config
/rules.mk
542 # Build libffi proper as part of the 'exports' target, so things get built
543 # in the right order.
545 $(call SUBMAKE
,,ctypes
/libffi
)
548 $(call SUBMAKE
,$@
,ctypes
/libffi
)
551 ifdef MOZ_SYNC_BUILD_FILES
552 # Because the SpiderMonkey can be distributed and built independently
553 # of the Mozilla source tree, it contains its own copies of many of
554 # the files used by the top-level Mozilla build process, from the
555 # 'config' and 'build' subtrees.
557 # To make it simpler to keep the copies in sync, we follow the policy
558 # that the SpiderMonkey copies must always be exact copies of those in
559 # the containing Mozilla tree. If you've made a change in one, it
560 # belongs in the other as well. If the change isn't right for both
561 # places, then that's something to bring up with the other developers.
563 # Some files are reasonable to diverge; for example,
564 # js/config/autoconf.mk.in doesn't need most of the stuff in
565 # config/autoconf.mk.in.
566 check-sync-dirs
= $(PYTHON
) $(srcdir)/config
/check-sync-dirs.py
568 $(check-sync-dirs
) $(srcdir)/config
$(MOZ_SYNC_BUILD_FILES
)/config
569 $(check-sync-dirs
) $(srcdir)/build
$(MOZ_SYNC_BUILD_FILES
)/build
572 $(check-sync-dirs
) $(srcdir)/config
$(MOZ_SYNC_BUILD_FILES
)/config
573 $(check-sync-dirs
) $(srcdir)/build
$(MOZ_SYNC_BUILD_FILES
)/build
576 # The "find any vanilla new/new[] calls" script is tailored to Linux, so
577 # only run it there. That should be enough to catch any such calls that
579 ifeq ($(OS_ARCH
),Linux
)
581 $(srcdir)/config
/find_vanilla_new_calls
$(LIBRARY
)
584 ifdef ENABLE_TRACEJIT
587 $(wildcard $(RUN_TEST_PROGRAM
)) $(PYTHON
) -u
$(srcdir)/jit-test
/jit_test.py \
588 --no-slow
--no-progress
--tinderbox
--jitflags
=m
,j
,mj
,mjp
,mjd
$(DIST
)/bin
/js
$(BIN_SUFFIX
)
591 $(wildcard $(RUN_TEST_PROGRAM
)) $(PYTHON
) -u
$(srcdir)/jit-test
/jit_test.py \
592 --valgrind
--no-slow
--no-progress
--tinderbox
--jitflags
=m
,j
,mj
,mjp
,mjd
$(DIST
)/bin
/js
$(BIN_SUFFIX
)
596 DIST_GARBAGE
= config.cache config.log config.status \
598 unallmakefiles js-config js-config.h js-confdefs.h
601 cat unallmakefiles |
$(XARGS
) rm -f
602 rm -f
$(DIST_GARBAGE
)
604 # our build system doesn't handle subdir srcs very gracefully today
608 DEFINES
+= -DEXPORT_JS_API
610 # Some platforms that have stdint.h include it in system headers. So
611 # to reliably get limit macros defined, we'd always have to define the
612 # one below before including any header, but that's obscure and
613 # fragile, so we do it here.
614 DEFINES
+= -D__STDC_LIMIT_MACROS
616 INCLUDES
+= -I
$(srcdir)
618 GARBAGE
+= jscpucfg.o jsautocfg.h jsautocfg.tmp jscpucfg
620 ifneq (,$(CROSS_COMPILE
)$(filter-out WINNT
,$(OS_ARCH
)))
621 TARGETS
+= jscpucfg
$(HOST_BIN_SUFFIX
)
625 DEFINES
+= -DJS_THREADSAFE
629 DEFINES
+= -DJS_HAS_CTYPES
630 DEFINES
+= -DDLL_PREFIX
=\"$(DLL_PREFIX
)\" -DDLL_SUFFIX
=\"$(DLL_SUFFIX
)\"
633 ifdef JS_NO_THIN_LOCKS
634 DEFINES
+= -DJS_USE_ONLY_NSPR_LOCKS
638 DEFINES
+= -DJS_VERSION
=$(JS_VERSION
)
641 ifneq ($(findstring -L
,$(NSPR_LIBS
)),)
642 NSPR_STATIC_PATH
= $(subst -L
,,$(findstring -L
,$(NSPR_LIBS
)))
644 NSPR_STATIC_PATH
= $(DIST
)/lib
648 CXXFLAGS
+= -IC
:/Program\ Files
/Intel
/VTune
/Analyzer
/Include
649 EXTRA_DSO_LDOPTS
+= C
:/Program\ Files
/Intel
/VTune
/Analyzer
/Lib
/VtuneApi.lib
650 LIBS
+= C
:/Program\ Files
/Intel
/VTune
/Analyzer
/Lib
/VtuneApi.lib
653 # BeOS and HP-UX do not require the extra linking of "-lm"
654 ifeq (,$(filter BeOS HP-UX WINNT WINCE OpenVMS OS2
,$(OS_ARCH
)))
658 # Prevent floating point errors caused by VC++ optimizations
659 ifeq ($(OS_ARCH
)_
$(GNU_CC
),WINNT_
)
660 ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER
)))
663 CFLAGS
+= -fp
:precise
667 ifeq ($(OS_ARCH
),FreeBSD
)
668 EXTRA_LIBS
+= -pthread
670 ifeq ($(OS_ARCH
),IRIX
)
675 ifeq ($(OS_ARCH
),Linux
)
678 ifeq ($(OS_ARCH
),OSF1
)
681 ifeq ($(OS_ARCH
),SunOS
)
682 ifeq ($(TARGET_CPU
),sparc
)
690 ifeq ($(OS_RELEASE
),4.1)
691 EXTRA_LIBS
+= -ldl
-lnsl
693 EXTRA_LIBS
+= -lposix4
-ldl
-lnsl
-lsocket
698 ifeq ($(OS_ARCH
),Darwin
)
699 LDFLAGS
+= -ljemalloc
703 ifdef SOLARIS_SUNPRO_CXX
704 ifeq ($(TARGET_CPU
),sparc
)
705 # Sun Studio SPARC doesn't work well with gcc inline asm, use lock_SunOS_sparc*.il
706 jslock.o
: jslock.
cpp Makefile.in lock_sparcv8plus.il lock_sparcv9.il
708 @
$(MAKE_DEPS_AUTO_CXX
)
709 ifeq (sparcv9
,$(findstring sparcv9
,$(OS_TEST
)))
710 $(CXX
) -o
$@
-c
$(COMPILE_CFLAGS
) $(srcdir)/lock_sparcv9.il
$<
712 $(CXX
) -o
$@
-c
$(COMPILE_CFLAGS
) $(srcdir)/lock_sparcv8plus.il
$<
715 endif # SOLARIS_SUNPRO_CXX
717 ifeq ($(OS_ARCH
),IRIX
)
719 _COMPILE_CFLAGS
= $(patsubst -O
%,-O1
,$(COMPILE_CFLAGS
))
720 jsapi.o jsxdrapi.o jsarena.o jsarray.o jsatom.o jsemit.o jsfun.o jsinterp.o jsreflect.o jsregexp.o jsparse.o jsopcode.o jsscript.o
: %.o
: %.
cpp Makefile.in
722 @
$(MAKE_DEPS_AUTO_CXX
)
723 $(CXX
) -o
$@
-c
$(_COMPILE_CFLAGS
) $<
727 # An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result.
728 # This suppresses optimization for this single compilation unit.
729 ifeq ($(OS_ARCH
),AIX
)
730 jsatom.o
: jsatom.
cpp Makefile.in
732 @
$(MAKE_DEPS_AUTO_CXX
)
733 $(CXX
) -o
$@
-c
$(filter-out $(MOZ_OPTIMIZE_FLAGS
), $(COMPILE_CFLAGS
)) $<
734 jsdtoa.o
: jsdtoa.
cpp Makefile.in
736 @
$(MAKE_DEPS_AUTO_CXX
)
737 $(CXX
) -o
$@
-c
$(filter-out $(MOZ_OPTIMIZE_FLAGS
), $(COMPILE_CFLAGS
)) $<
742 ifeq (,$(CROSS_COMPILE
)$(GNU_CC
)$(filter-out WINNT
,$(OS_ARCH
)))
746 ifeq ($(OS_ARCH
),WINCE
)
750 jsautocfg.h
: jscpucfg
$(HOST_BIN_SUFFIX
)
751 @
rm -f
$@ jsautocfg.tmp
752 .
/jscpucfg
> jsautocfg.tmp
757 # jscpucfg is a strange target
758 # Needs to be built with the host compiler but needs to include
759 # the mdcpucfg for the target so it needs the appropriate target defines
760 ifdef HOST_NSPR_MDCPUCFG
761 HOST_CXX
:= $(HOST_CXX
) -DMDCPUCFG
=$(TARGET_NSPR_MDCPUCFG
)
762 HOST_CXXFLAGS
:= $(patsubst -DXP_
%,,$(HOST_CXXFLAGS
))
766 # jscpucfg needs to know when it's supposed to produce a config for the target
767 JSCPUCFG_DEFINES
= $(ACDEFINES
)
770 ifeq ($(OS_ARCH
),QNX
)
771 ifneq ($(OS_TARGET
),NTO
)
772 # QNX's compiler apparently can't build a binary directly from a source file.
773 jscpucfg.o
: jscpucfg.
cpp Makefile.in
774 $(HOST_CXX
) $(HOST_CXXFLAGS
) -c
$(JSCPUCFG_DEFINES
) $(DEFINES
) $(NSPR_CFLAGS
) -o
$@
$<
777 $(HOST_CXX
) $(HOST_CXXFLAGS
) $(JSCPUCFG_DEFINES
) $(DEFINES
) -o
$@
$<
780 ifeq ($(OS_ARCH
),WINCE
)
781 jscpucfg
$(HOST_BIN_SUFFIX
):
782 echo no need to build jscpucfg
$<
784 jscpucfg
$(HOST_BIN_SUFFIX
): jscpucfg.
cpp Makefile.in
785 $(HOST_CXX
) $(HOST_CXXFLAGS
) $(JSCPUCFG_DEFINES
) $(DEFINES
) $(NSPR_CFLAGS
) $(HOST_OUTOPTION
)$@
$<
789 # Compute the linker flags that programs linking against SpiderMonkey should
790 # pass to get SpiderMonkey and its dependencies, beyond just the -L and -l
791 # for the SpiderMonkey library itself.
792 # - EXTRA_DSO_LDOPTS includes the NSPR -L and -l flags.
793 # - OS_LIBS includes libraries selected by the configure script.
794 # - EXTRA_LIBS includes libraries selected by this Makefile.
795 JS_CONFIG_LIBS
=$(EXTRA_DSO_LDOPTS
) $(OS_LIBS
) $(EXTRA_LIBS
)
797 # The configure script invokes this rule explicitly at configure time!
798 # It's important that js-config be ready by the time we're done
799 # configuring, because we may be running other configure scripts that
800 # would like to run js-config themselves, before js is built.
802 # This file and rules.mk go through a certain amount of work to decide
803 # which libraries to build, what to name them, and what flags to pass
804 # when linking them (and thus what flags its own clients must pass).
805 # All this information needs to go into the js-config script. To
806 # avoid trying to re-compute all that in the configure script, we just
807 # have the configure script generate this Makefile, and then invoke
810 js-config
: js-config.in Makefile
$(DEPTH
)/config
/autoconf.mk
$(topsrcdir
)/config
/config.mk
$(topsrcdir
)/config
/rules.mk
812 sed
< $< > js-config.tmp \
813 -e
's|$(at)prefix$(at)|$(prefix)|' \
814 -e
's|$(at)exec_prefix$(at)|$(exec_prefix)|' \
815 -e
's|$(at)includedir$(at)|$(includedir)|' \
816 -e
's|$(at)libdir$(at)|$(libdir)|' \
817 -e
's|$(at)MOZILLA_VERSION$(at)|$(MOZILLA_VERSION)|' \
818 -e
's|$(at)LIBRARY_NAME$(at)|$(LIBRARY_NAME)|' \
819 -e
's|$(at)NSPR_CFLAGS$(at)|$(NSPR_CFLAGS)|' \
820 -e
's|$(at)JS_CONFIG_LIBS$(at)|$(JS_CONFIG_LIBS)|' \
821 -e
's|$(at)MOZ_JS_LIBS$(at)|$(MOZ_JS_LIBS)|' \
822 && mv js-config.tmp
$@
&& chmod
+x
$@
825 SDK_BINARY
= js-config
827 install:: $(INSTALLED_HEADERS
)
828 $(SYSINSTALL
) $^
$(DESTDIR
)$(includedir)/$(MODULE
)
831 $(SYSINSTALL
) $^
$(DESTDIR
)$(bindir)
833 install:: $(LIBRARY
) $(SHARED_LIBRARY
) $(IMPORT_LIBRARY
)
835 $(SYSINSTALL
) $(LIBRARY
) $(DESTDIR
)$(libdir)
837 ifneq (,$(SHARED_LIBRARY
))
838 $(SYSINSTALL
) $(SHARED_LIBRARY
) $(DESTDIR
)$(libdir)
840 ifneq (,$(IMPORT_LIBRARY
))
841 $(SYSINSTALL
) $(IMPORT_LIBRARY
) $(DESTDIR
)$(libdir)
844 # Extra dependancies and rules for auto-generated headers
845 host_jskwgen.
$(OBJ_SUFFIX
): jsversion.h jskeyword.tbl
847 # Use CURDIR to avoid finding a jsautokw.h in the source tree (from a
848 # previous build?) via VPATH when we're building in a separate tree.
849 $(CURDIR
)/jsautokw.h
: host_jskwgen
$(HOST_BIN_SUFFIX
)
850 .
/host_jskwgen
$(HOST_BIN_SUFFIX
) $@
852 host_jsoplengen.
$(OBJ_SUFFIX
): jsopcode.tbl
854 # Use CURDIR to avoid finding a jsautooplen.h in the source tree (from
855 # a previous build?) via VPATH when we're building in a separate tree.
856 $(CURDIR
)/jsautooplen.h
: host_jsoplengen
$(HOST_BIN_SUFFIX
)
857 .
/host_jsoplengen
$(HOST_BIN_SUFFIX
) $@
859 # Force auto-header generation before compiling any source that may use them
860 $(patsubst %.
cc,%.
$(OBJ_SUFFIX
),$(CPPSRCS
:%.
cpp=%.
$(OBJ_SUFFIX
))): $(CURDIR
)/jsautokw.h
$(CURDIR
)/jsautooplen.h
863 $(CURDIR
)/javascript-trace.h
: $(srcdir)/javascript-trace.d
864 dtrace
-h
-s
$(srcdir)/javascript-trace.d
-o javascript-trace.h.in
865 sed
-e
's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
866 -e
'/const/!s/char \*/const char */g' \
867 javascript-trace.h.in
> javascript-trace.h
869 # We can't automatically generate dependencies on auto-generated headers;
870 # we have to list them explicitly.
871 $(addsuffix .
$(OBJ_SUFFIX
),jsprobes jsinterp jsobj
): $(CURDIR
)/javascript-trace.h
874 ifdef ENABLE_TRACEJIT
875 # Imacro compilation.
876 $(CURDIR
)/imacros.c.out
: $(srcdir)/imacro_asm.py
$(srcdir)/imacros.jsasm jsopcode.tbl
877 $(PYTHON
) $< $(srcdir)/imacros.jsasm
$(CURDIR
)/imacros.c.out
878 $(addsuffix .
$(OBJ_SUFFIX
),jstracer
): $(CURDIR
)/imacros.c.out
880 # Code for importing the nanojit subtree from its repository.
881 NANOJIT_CENTRAL_REV
=$(shell cat
$(srcdir)/nanojit-import-rev
)
882 NANOJIT_CENTRAL_REPO
=http
://hg.mozilla.org
/projects
/nanojit-central
883 NANOJIT_CENTRAL_LOCAL
=$(CURDIR
)/nanojit-central
884 CUR_REPO
=$(srcdir)/..
/..
887 rm -Rf
$(NANOJIT_CENTRAL_LOCAL
) import-splicemap import-revmap
888 hg clone
$(NANOJIT_CENTRAL_REPO
) $(NANOJIT_CENTRAL_LOCAL
)
889 python
$(srcdir)/find-child.py \
890 --src
=$(NANOJIT_CENTRAL_LOCAL
) \
892 --start
=$(NANOJIT_CENTRAL_REV
) \
893 --filemap
=$(srcdir)/nanojit-import-filemap \
895 hg convert
--config convert.hg.saverev
=True \
896 --config convert.hg.startrev
=`cut -d ' ' -f 1 import-splicemap` \
897 --filemap
=$(srcdir)/nanojit-import-filemap \
898 --splicemap
=import-splicemap \
899 $(NANOJIT_CENTRAL_LOCAL
) \
902 (cd
$(srcdir) && hg up
)
903 (cd
$(NANOJIT_CENTRAL_LOCAL
) && hg log
-r tip
--template
"{node}\n") >$(srcdir)/nanojit-import-rev
904 (cd
$(srcdir) && hg commit
--message
="Update nanojit-import-rev stamp." nanojit-import-rev
)
906 .PHONY
: update-nanojit
909 ###############################################
910 # BEGIN kludges for the Nitro assembler
913 # Needed to "configure" it correctly. Unfortunately these
914 # flags wind up being applied to all code in js/src, not just
915 # the code in js/src/assembler.
916 CXXFLAGS
+= -DUSE_SYSTEM_MALLOC
=1 -DENABLE_ASSEMBLER
=1 -DENABLE_JIT
=1
918 INCLUDES
+= -I
$(srcdir)/assembler
-I
$(srcdir)/yarr
920 ifdef ENABLE_METHODJIT
921 # Build a standalone test program that exercises the assembler
924 Assertions.
$(OBJ_SUFFIX
) \
925 ExecutableAllocatorPosix.
$(OBJ_SUFFIX
) \
926 ExecutableAllocatorWin.
$(OBJ_SUFFIX
) \
927 ExecutableAllocator.
$(OBJ_SUFFIX
) \
928 ARMAssembler.
$(OBJ_SUFFIX
) \
929 MacroAssemblerARM.
$(OBJ_SUFFIX
) \
930 TestMain.
$(OBJ_SUFFIX
) \
931 jsutil.
$(OBJ_SUFFIX
) \
933 TestMain
$(HOST_BIN_SUFFIX
): $(TESTMAIN_OBJS
)
934 $(CXX
) -o TestMain
$(HOST_BIN_SUFFIX
) $(TESTMAIN_OBJS
)
938 # END kludges for the Nitro assembler
939 ###############################################