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)))
74 SRCREL_VERSION = 1.0.0
75 SRCREL_ABI_VERSION := $(word 1,$(subst ., ,$(SRCREL_VERSION))).$(word 2,$(subst ., ,$(SRCREL_VERSION)))
78 ifeq (,$(HOST_BIN_SUFFIX))
79 LIBRARY_NAME = mozjs185
81 LIBRARY_NAME = mozjs185-$(SRCREL_ABI_VERSION)
83 STATIC_LIBRARY_NAME = js_static
90 # icc gets special optimize flags
91 ifdef MOZ_PROFILE_GENERATE
92 MODULE_OPTIMIZE_FLAGS = -O0
94 MODULE_OPTIMIZE_FLAGS = -O2 -ip
98 MODULE_OPTIMIZE_FLAGS = -O3 -fstrict-aliasing
100 # We normally want -fomit-frame-pointer, but we want an explicit
101 # -fno-omit-frame-pointer if we're using a sampling profiler.
103 MODULE_OPTIMIZE_FLAGS += -fomit-frame-pointer
105 MODULE_OPTIMIZE_FLAGS += -fno-omit-frame-pointer
110 ifeq ($(OS_ARCH),SunOS)
111 MODULE_OPTIMIZE_FLAGS = -xO4
113 ifeq ($(OS_ARCH),WINNT)
114 MODULE_OPTIMIZE_FLAGS = -O2
119 # JavaScript must be built shared, even for static builds, as it is used by
120 # other modules which are always built shared. Failure to do so results in
121 # the js code getting copied into xpinstall and jsd as well as mozilla-bin,
122 # and then the static data cells used for locking no longer work.
124 # In fact, we now build both a static and a shared library, as the
125 # JS shell would like to link to the static library.
127 ifdef JS_SHARED_LIBRARY
172 jspropertycache.cpp \
189 INSTALLED_HEADERS = \
192 $(CURDIR)/jsautokw.h \
236 jspropertycacheinlines.h \
267 ifdef ENABLE_TRACEJIT
272 INSTALLED_HEADERS += \
284 Native$(NANOJIT_ARCH).h \
304 Native$(NANOJIT_ARCH).cpp \
314 ASFILES += jswince.asm
317 endif # ENABLE_TRACEJIT
318 ifdef ENABLE_METHODJIT
320 ###############################################
321 # BEGIN include sources for the method JIT
323 VPATH += $(srcdir)/methodjit
325 CPPSRCS += MethodJIT.cpp \
337 TrampolineCompiler.cpp \
339 # PICStubCompiler.cpp \
341 ifeq (86, $(findstring 86,$(TARGET_CPU)))
342 ifeq (x86_64, $(TARGET_CPU))
344 ASFILES += TrampolineMasmX64.asm
346 ifdef SOLARIS_SUNPRO_CXX
347 ASFILES += TrampolineSUNWX64.s
349 #CPPSRCS += only_on_x86_64.cpp
351 #CPPSRCS += only_on_x86.cpp
352 ifdef SOLARIS_SUNPRO_CXX
353 ASFILES += TrampolineSUNWX86.s
357 ifeq (arm, $(TARGET_CPU))
358 #CPPSRCS += only_on_arm.cpp
361 # END enclude sources for the method JIT
362 #############################################
366 ###############################################
367 # BEGIN include sources for V8 dtoa
369 VPATH += $(srcdir)/v8-dtoa \
372 CPPSRCS += checks.cc \
382 # END enclude sources for V8 dtoa
383 #############################################
385 ifeq (,$(filter-out powerpc sparc,$(TARGET_CPU)))
387 VPATH += $(srcdir)/assembler \
388 $(srcdir)/assembler/wtf \
389 $(srcdir)/yarr/pcre \
392 CPPSRCS += pcre_compile.cpp \
396 pcre_ucp_searchfuncs.cpp \
400 ###############################################
401 # BEGIN include sources for the Nitro assembler
403 VPATH += $(srcdir)/assembler \
404 $(srcdir)/assembler/wtf \
405 $(srcdir)/assembler/jit \
406 $(srcdir)/assembler/assembler \
407 $(srcdir)/methodjit \
409 $(srcdir)/yarr/yarr \
410 $(srcdir)/yarr/pcre \
414 CPPSRCS += Assertions.cpp \
415 ExecutableAllocatorPosix.cpp \
416 ExecutableAllocatorWin.cpp \
417 ExecutableAllocatorOS2.cpp \
418 ExecutableAllocator.cpp \
421 MacroAssemblerARM.cpp \
422 MacroAssemblerX86Common.cpp \
429 pcre_ucp_searchfuncs.cpp \
432 ifeq (86, $(findstring 86,$(TARGET_CPU)))
433 ifeq (x86_64, $(TARGET_CPU))
434 #CPPSRCS += only_on_x86_64.cpp
436 #CPPSRCS += only_on_x86.cpp
439 ifeq (arm, $(TARGET_CPU))
440 #CPPSRCS += only_on_arm.cpp
443 # END enclude sources for the Nitro assembler
444 #############################################
449 VPATH += $(srcdir)/ctypes
457 -Ictypes/libffi/include \
461 ifeq ($(OS_ARCH),OS2)
462 SHARED_LIBRARY_LIBS += \
463 ctypes/libffi/.libs/ffi.a \
466 SHARED_LIBRARY_LIBS += \
467 ctypes/libffi/.libs/libffi.$(LIB_SUFFIX) \
471 endif # JS_HAS_CTYPES
474 INSTALLED_HEADERS += \
475 $(CURDIR)/javascript-trace.h \
479 # PerfMeasurement is available regardless of low-level support for it;
480 # it just doesn't necessarily do anything useful. There is one
481 # implementation source file per supported operating system, plus a stub
482 # for unsupported OSes, plus the Javascript wrapper.
483 VPATH += $(srcdir)/perf
484 INSTALLED_HEADERS += jsperf.h
485 CPPSRCS += jsperf.cpp
486 ifdef HAVE_LINUX_PERF_EVENT_H
487 CPPSRCS += pm_linux.cpp
489 CPPSRCS += pm_stub.cpp
492 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
493 INSTALLED_HEADERS += jscpucfg.h
496 EXPORTS = $(INSTALLED_HEADERS)
500 ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
501 SDK_LIBRARY = $(IMPORT_LIBRARY)
503 SDK_LIBRARY = $(SHARED_LIBRARY)
506 include $(topsrcdir)/config/config.mk
508 EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
514 # Define keyword generator before rules.mk, see bug 323979 comment 50
516 HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX)
517 GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX)
519 HOST_SIMPLE_PROGRAMS += host_jsoplengen$(HOST_BIN_SUFFIX)
520 GARBAGE += jsautooplen.h host_jsoplengen$(HOST_BIN_SUFFIX)
525 ifneq ($(OS_ARCH),Darwin)
526 DTRACE_PROBE_OBJ = $(LIBRARY_NAME)-dtrace.$(OBJ_SUFFIX)
528 MOZILLA_DTRACE_SRC = $(srcdir)/javascript-trace.d
533 ifneq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
534 ifneq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH)))
535 # nsinstall doesn't get built until we enter config/ in the exports phase,
536 # so we'll have to manually ensure it gets built here if we want to use
538 export:: config/nsinstall$(HOST_BIN_SUFFIX)
539 $(PUBLIC) $(SDK_PUBLIC): config/nsinstall$(HOST_BIN_SUFFIX)
541 config/nsinstall$(HOST_BIN_SUFFIX): $(srcdir)/config/nsinstall.c $(srcdir)/config/pathsub.c
542 $(MAKE) -C config/ nsinstall$(HOST_BIN_SUFFIX)
546 include $(topsrcdir)/config/rules.mk
549 # Build libffi proper as part of the 'exports' target, so things get built
550 # in the right order.
552 $(call SUBMAKE,,ctypes/libffi)
555 $(call SUBMAKE,$@,ctypes/libffi)
558 ifdef MOZ_SYNC_BUILD_FILES
559 # Because the SpiderMonkey can be distributed and built independently
560 # of the Mozilla source tree, it contains its own copies of many of
561 # the files used by the top-level Mozilla build process, from the
562 # 'config' and 'build' subtrees.
564 # To make it simpler to keep the copies in sync, we follow the policy
565 # that the SpiderMonkey copies must always be exact copies of those in
566 # the containing Mozilla tree. If you've made a change in one, it
567 # belongs in the other as well. If the change isn't right for both
568 # places, then that's something to bring up with the other developers.
570 # Some files are reasonable to diverge; for example,
571 # js/config/autoconf.mk.in doesn't need most of the stuff in
572 # config/autoconf.mk.in.
573 check-sync-dirs = $(PYTHON) $(srcdir)/config/check-sync-dirs.py
575 $(check-sync-dirs) $(srcdir)/config $(MOZ_SYNC_BUILD_FILES)/config
576 $(check-sync-dirs) $(srcdir)/build $(MOZ_SYNC_BUILD_FILES)/build
579 $(check-sync-dirs) $(srcdir)/config $(MOZ_SYNC_BUILD_FILES)/config
580 $(check-sync-dirs) $(srcdir)/build $(MOZ_SYNC_BUILD_FILES)/build
583 # The "find any vanilla new/new[] calls" script is tailored to Linux, so
584 # only run it there. That should be enough to catch any such calls that
586 ifeq ($(OS_ARCH),Linux)
588 $(srcdir)/config/find_vanilla_new_calls $(LIBRARY)
591 ifdef ENABLE_TRACEJIT
593 JITFLAGS = ,m,j,mj,mjp,am,amj,amjp,amd
595 $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
596 --no-slow --no-progress --tinderbox --jitflags=$(JITFLAGS) $(DIST)/bin/js$(BIN_SUFFIX)
599 $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
600 --valgrind --no-slow --no-progress --tinderbox --jitflags=$(JITFLAGS) $(DIST)/bin/js$(BIN_SUFFIX)
604 DIST_GARBAGE = config.cache config.log config.status \
606 unallmakefiles js-config js-config.h js-confdefs.h
609 cat unallmakefiles | $(XARGS) rm -f
610 rm -f $(DIST_GARBAGE)
612 # our build system doesn't handle subdir srcs very gracefully today
616 DEFINES += -DEXPORT_JS_API
618 # Some platforms that have stdint.h include it in system headers. So
619 # to reliably get limit macros defined, we'd always have to define the
620 # one below before including any header, but that's obscure and
621 # fragile, so we do it here.
622 DEFINES += -D__STDC_LIMIT_MACROS
624 INCLUDES += -I$(srcdir)
626 GARBAGE += jscpucfg.o jsautocfg.h jsautocfg.tmp jscpucfg
628 ifneq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
629 TARGETS += jscpucfg$(HOST_BIN_SUFFIX)
633 DEFINES += -DJS_THREADSAFE
637 DEFINES += -DJS_HAS_CTYPES
638 DEFINES += -DDLL_PREFIX=\"$(DLL_PREFIX)\" -DDLL_SUFFIX=\"$(DLL_SUFFIX)\"
641 ifdef JS_NO_THIN_LOCKS
642 DEFINES += -DJS_USE_ONLY_NSPR_LOCKS
646 DEFINES += -DJS_VERSION=$(JS_VERSION)
649 ifneq ($(findstring -L,$(NSPR_LIBS)),)
650 NSPR_STATIC_PATH = $(subst -L,,$(findstring -L,$(NSPR_LIBS)))
652 NSPR_STATIC_PATH = $(DIST)/lib
656 CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include
657 EXTRA_DSO_LDOPTS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
658 LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
661 # BeOS and HP-UX do not require the extra linking of "-lm"
662 ifeq (,$(filter BeOS HP-UX WINNT WINCE OpenVMS OS2,$(OS_ARCH)))
666 # Prevent floating point errors caused by VC++ optimizations
667 ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
668 ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
671 CFLAGS += -fp:precise
675 ifeq ($(OS_ARCH),FreeBSD)
676 EXTRA_LIBS += -pthread
678 ifeq ($(OS_ARCH),IRIX)
683 ifeq ($(OS_ARCH),Linux)
686 ifeq ($(OS_ARCH),OSF1)
689 ifeq ($(OS_ARCH),SunOS)
690 ifeq ($(TARGET_CPU),sparc)
698 ifeq ($(OS_RELEASE),4.1)
699 EXTRA_LIBS += -ldl -lnsl
701 EXTRA_LIBS += -lposix4 -ldl -lnsl -lsocket
706 ifeq ($(OS_ARCH),Darwin)
707 LDFLAGS += -ljemalloc
711 ifdef SOLARIS_SUNPRO_CXX
712 ifeq ($(TARGET_CPU),sparc)
713 # Sun Studio SPARC doesn't work well with gcc inline asm, use lock_SunOS_sparc*.il
714 jslock.o: jslock.cpp Makefile.in lock_sparcv8plus.il lock_sparcv9.il
716 @$(MAKE_DEPS_AUTO_CXX)
717 ifeq (sparcv9,$(findstring sparcv9,$(OS_TEST)))
718 $(CXX) -o $@ -c $(COMPILE_CFLAGS) $(srcdir)/lock_sparcv9.il $<
720 $(CXX) -o $@ -c $(COMPILE_CFLAGS) $(srcdir)/lock_sparcv8plus.il $<
723 endif # SOLARIS_SUNPRO_CXX
725 ifeq ($(OS_ARCH),IRIX)
727 _COMPILE_CFLAGS = $(patsubst -O%,-O1,$(COMPILE_CFLAGS))
728 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
730 @$(MAKE_DEPS_AUTO_CXX)
731 $(CXX) -o $@ -c $(_COMPILE_CFLAGS) $<
735 # An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result.
736 # This suppresses optimization for this single compilation unit.
737 ifeq ($(OS_ARCH),AIX)
738 jsatom.o: jsatom.cpp Makefile.in
740 @$(MAKE_DEPS_AUTO_CXX)
741 $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
742 jsdtoa.o: jsdtoa.cpp Makefile.in
744 @$(MAKE_DEPS_AUTO_CXX)
745 $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
750 ifeq (,$(CROSS_COMPILE)$(GNU_CC)$(filter-out WINNT,$(OS_ARCH)))
754 ifeq ($(OS_ARCH),WINCE)
758 jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX)
759 @rm -f $@ jsautocfg.tmp
760 ./jscpucfg > jsautocfg.tmp
765 # jscpucfg is a strange target
766 # Needs to be built with the host compiler but needs to include
767 # the mdcpucfg for the target so it needs the appropriate target defines
768 ifdef HOST_NSPR_MDCPUCFG
769 HOST_CXX := $(HOST_CXX) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG)
770 HOST_CXXFLAGS := $(patsubst -DXP_%,,$(HOST_CXXFLAGS))
774 # jscpucfg needs to know when it's supposed to produce a config for the target
775 JSCPUCFG_DEFINES = $(ACDEFINES)
778 ifeq ($(OS_ARCH),QNX)
779 ifneq ($(OS_TARGET),NTO)
780 # QNX's compiler apparently can't build a binary directly from a source file.
781 jscpucfg.o: jscpucfg.cpp Makefile.in
782 $(HOST_CXX) $(HOST_CXXFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $<
785 $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $<
788 ifeq ($(OS_ARCH),WINCE)
789 jscpucfg$(HOST_BIN_SUFFIX):
790 echo no need to build jscpucfg $<
792 jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in
793 $(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $<
797 # Compute the linker flags that programs linking against SpiderMonkey should
798 # pass to get SpiderMonkey and its dependencies, beyond just the -L and -l
799 # for the SpiderMonkey library itself.
800 # - EXTRA_DSO_LDOPTS includes the NSPR -L and -l flags.
801 # - OS_LIBS includes libraries selected by the configure script.
802 # - EXTRA_LIBS includes libraries selected by this Makefile.
803 JS_CONFIG_LIBS=$(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS)
804 JS_CONFIG_MOZ_JS_LIBS=-L$(libdir) -l$(LIBRARY_NAME)
806 # The configure script invokes this rule explicitly at configure time!
807 # It's important that js-config be ready by the time we're done
808 # configuring, because we may be running other configure scripts that
809 # would like to run js-config themselves, before js is built.
811 # This file and rules.mk go through a certain amount of work to decide
812 # which libraries to build, what to name them, and what flags to pass
813 # when linking them (and thus what flags its own clients must pass).
814 # All this information needs to go into the js-config script. To
815 # avoid trying to re-compute all that in the configure script, we just
816 # have the configure script generate this Makefile, and then invoke
819 js-config: js-config.in Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk $(topsrcdir)/config/rules.mk
821 sed < $< > js-config.tmp \
822 -e 's|$(at)prefix$(at)|$(prefix)|' \
823 -e 's|$(at)exec_prefix$(at)|$(exec_prefix)|' \
824 -e 's|$(at)includedir$(at)|$(includedir)|' \
825 -e 's|$(at)libdir$(at)|$(libdir)|' \
826 -e 's|$(at)MOZILLA_VERSION$(at)|$(MOZILLA_VERSION)|' \
827 -e 's|$(at)LIBRARY_NAME$(at)|$(LIBRARY_NAME)|' \
828 -e 's|$(at)NSPR_CFLAGS$(at)|$(NSPR_CFLAGS)|' \
829 -e 's|$(at)JS_CONFIG_LIBS$(at)|$(JS_CONFIG_LIBS)|' \
830 -e 's|$(at)MOZ_JS_LIBS$(at)|$(JS_CONFIG_MOZ_JS_LIBS)|' \
831 && mv js-config.tmp $@ && chmod +x $@
834 SDK_BINARY = js-config
840 GARBAGE += $(pkg_config_files)
842 %.pc: $(srcdir)/%.pc.in Makefile
844 -e "s|%prefix%|$(prefix)|" \
845 -e "s|%includedir%|$(includedir)|" \
846 -e "s|%libdir%|$(libdir)|" \
847 -e 's|%MOZILLA_VERSION%|$(MOZILLA_VERSION)|' \
850 install:: $(pkg_config_files)
851 @echo pkg_config_file: $(pkg_config_files)
852 $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(libdir)/pkgconfig
854 install:: $(INSTALLED_HEADERS)
855 $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE)
858 $(SYSINSTALL) $^ $(DESTDIR)$(bindir)
860 ifeq (,$(HOST_BIN_SUFFIX))
861 ifeq (.dylib,$(DLL_SUFFIX))
863 SHLIB_ANY_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
864 SHLIB_ABI_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY:$(DLL_SUFFIX)=.$(SRCREL_ABI_VERSION)$(DLL_SUFFIX))
865 SHLIB_EXACT_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY:$(DLL_SUFFIX)=.$(SRCREL_VERSION)$(DLL_SUFFIX))
866 $(SHARED_LIBRARY): EXTRA_DSO_LDOPTS += -install_name $(SHLIB_ABI_VER)
867 $(SHARED_LIBRARY): EXTRA_DSO_LDOPTS += -current_version $(SRCREL_VERSION)
868 $(SHARED_LIBRARY): EXTRA_DSO_LDOPTS += -compatibility_version $(SRCREL_ABI_VERSION)
870 # Generic Unix / Linux
871 SHLIB_ANY_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
872 SHLIB_ABI_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).$(SRCREL_ABI_VERSION)
873 SHLIB_EXACT_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).$(SRCREL_VERSION)
874 $(SHARED_LIBRARY): EXTRA_DSO_LDOPTS += -Wl,-soname,$(notdir $(SHLIB_ABI_VER))
878 install:: $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
880 $(SYSINSTALL) $(LIBRARY) $(DESTDIR)$(libdir)
881 mv -f $(DESTDIR)$(libdir)/$(LIBRARY) $(subst $(STATIC_LIBRARY_NAME),mozjs185-$(SRCREL_ABI_VERSION),$(DESTDIR)$(libdir)/$(LIBRARY))
883 ifneq (,$(SHARED_LIBRARY))
884 ifeq (,$(HOST_BIN_SUFFIX))
885 @[ ! -h $(SHLIB_ANY_VER) ] || rm -f $(SHLIB_ANY_VER)
887 $(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir)
888 ifeq (,$(HOST_BIN_SUFFIX))
889 mv -f $(SHLIB_ANY_VER) $(SHLIB_EXACT_VER)
890 @[ ! -h $(SHLIB_ABI_VER) ] || rm -f $(SHLIB_ABI_VER)
891 ln -s $(SHLIB_EXACT_VER) $(SHLIB_ABI_VER)
892 ln -s $(SHLIB_ABI_VER) $(SHLIB_ANY_VER)
895 ifneq (,$(IMPORT_LIBRARY))
896 $(SYSINSTALL) $(IMPORT_LIBRARY) $(DESTDIR)$(libdir)
899 # Extra dependancies and rules for auto-generated headers
900 host_jskwgen.$(OBJ_SUFFIX): jsversion.h jskeyword.tbl
902 # Use CURDIR to avoid finding a jsautokw.h in the source tree (from a
903 # previous build?) via VPATH when we're building in a separate tree.
904 $(CURDIR)/jsautokw.h: host_jskwgen$(HOST_BIN_SUFFIX)
905 ./host_jskwgen$(HOST_BIN_SUFFIX) $@
907 host_jsoplengen.$(OBJ_SUFFIX): jsopcode.tbl
909 # Use CURDIR to avoid finding a jsautooplen.h in the source tree (from
910 # a previous build?) via VPATH when we're building in a separate tree.
911 $(CURDIR)/jsautooplen.h: host_jsoplengen$(HOST_BIN_SUFFIX)
912 ./host_jsoplengen$(HOST_BIN_SUFFIX) $@
914 # Force auto-header generation before compiling any source that may use them
915 $(patsubst %.cc,%.$(OBJ_SUFFIX),$(CPPSRCS:%.cpp=%.$(OBJ_SUFFIX))): $(CURDIR)/jsautokw.h $(CURDIR)/jsautooplen.h
918 $(CURDIR)/javascript-trace.h: $(srcdir)/javascript-trace.d
919 dtrace -h -s $(srcdir)/javascript-trace.d -o javascript-trace.h.in
920 sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
921 -e '/const/!s/char \*/const char */g' \
922 javascript-trace.h.in > javascript-trace.h
924 # We can't automatically generate dependencies on auto-generated headers;
925 # we have to list them explicitly.
926 $(addsuffix .$(OBJ_SUFFIX),jsprobes jsinterp jsobj): $(CURDIR)/javascript-trace.h
929 ifdef ENABLE_TRACEJIT
930 # Imacro compilation.
931 $(CURDIR)/imacros.c.out: $(srcdir)/imacro_asm.py $(srcdir)/imacros.jsasm jsopcode.tbl
932 $(PYTHON) $< $(srcdir)/imacros.jsasm $(CURDIR)/imacros.c.out
933 $(addsuffix .$(OBJ_SUFFIX),jstracer): $(CURDIR)/imacros.c.out
935 # Code for importing the nanojit subtree from its repository.
936 NANOJIT_CENTRAL_REV=$(shell cat $(srcdir)/nanojit-import-rev)
937 NANOJIT_CENTRAL_REPO=http://hg.mozilla.org/projects/nanojit-central
938 NANOJIT_CENTRAL_LOCAL=$(CURDIR)/nanojit-central
939 CUR_REPO=$(srcdir)/../..
942 rm -Rf $(NANOJIT_CENTRAL_LOCAL) import-splicemap import-revmap
943 hg clone $(NANOJIT_CENTRAL_REPO) $(NANOJIT_CENTRAL_LOCAL)
944 python $(srcdir)/find-child.py \
945 --src=$(NANOJIT_CENTRAL_LOCAL) \
947 --start=$(NANOJIT_CENTRAL_REV) \
948 --filemap=$(srcdir)/nanojit-import-filemap \
950 hg convert --config convert.hg.saverev=True \
951 --config convert.hg.startrev=`cut -d ' ' -f 1 import-splicemap` \
952 --filemap=$(srcdir)/nanojit-import-filemap \
953 --splicemap=import-splicemap \
954 $(NANOJIT_CENTRAL_LOCAL) \
957 (cd $(srcdir) && hg up)
958 (cd $(NANOJIT_CENTRAL_LOCAL) && hg log -r tip --template "{node}\n") >$(srcdir)/nanojit-import-rev
959 (cd $(srcdir) && hg commit --message="Update nanojit-import-rev stamp." nanojit-import-rev)
961 .PHONY: update-nanojit
964 ###############################################
965 # BEGIN kludges for the Nitro assembler
968 # Needed to "configure" it correctly. Unfortunately these
969 # flags wind up being applied to all code in js/src, not just
970 # the code in js/src/assembler.
971 CXXFLAGS += -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1
973 INCLUDES += -I$(srcdir)/assembler -I$(srcdir)/yarr
975 ifdef ENABLE_METHODJIT
976 # Build a standalone test program that exercises the assembler
979 Assertions.$(OBJ_SUFFIX) \
980 ExecutableAllocatorPosix.$(OBJ_SUFFIX) \
981 ExecutableAllocatorWin.$(OBJ_SUFFIX) \
982 ExecutableAllocator.$(OBJ_SUFFIX) \
983 ARMAssembler.$(OBJ_SUFFIX) \
984 MacroAssemblerARM.$(OBJ_SUFFIX) \
985 TestMain.$(OBJ_SUFFIX) \
986 jsutil.$(OBJ_SUFFIX) \
988 TestMain$(HOST_BIN_SUFFIX): $(TESTMAIN_OBJS)
989 $(CXX) -o TestMain$(HOST_BIN_SUFFIX) $(TESTMAIN_OBJS)
993 # END kludges for the Nitro assembler
994 ###############################################