/[jscoverage]/trunk/js/Makefile.in
ViewVC logotype

Diff of /trunk/js/Makefile.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 460 by siliconforks, Sat Sep 26 23:15:22 2009 UTC revision 507 by siliconforks, Sun Jan 10 07:23:34 2010 UTC
# Line 41  Line 41 
41  topsrcdir       = @top_srcdir@  topsrcdir       = @top_srcdir@
42  srcdir          = @srcdir@  srcdir          = @srcdir@
43    
44    run_for_side_effects := $(shell echo "MAKE: $(MAKE)")
45    include $(DEPTH)/config/autoconf.mk
46    
47  DIRS            = config  DIRS            = config
48    
49  include $(DEPTH)/config/autoconf.mk  ifdef DEHYDRA_PATH
50    DIRS += analysis-tests
51    endif
52    
53  MODULE          = js  ifdef JS_NATIVE_EDITLINE
54  LIBRARY_NAME    = mozjs  DIRS += editline
55  GRE_MODULE      = 1  endif
   
 PROGRAM         = js$(BIN_SUFFIX)  
 # The shell uses some 'HIDDEN' symbols to produce statistics, so we  
 # link directly against the .o files, not against the JS shared  
 # library.  
 PROGOBJS        = js.$(OBJ_SUFFIX) $(OBJS)  
 LIBS            = $(NSPR_LIBS)  
56    
57  ifdef WINCE  # editline needs to get built before the shell
58  EXTRA_LIBS += $(JEMALLOC_LIBS)  ifndef JS_DISABLE_SHELL
59    DIRS += shell
60  endif  endif
61    
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
68    
69    ifdef ENABLE_TESTS
70    DIRS += tests
71    endif
72    
73    MODULE              = js
74    LIBRARY_NAME        = mozjs
75    STATIC_LIBRARY_NAME = js_static
76    GRE_MODULE          = 1
77    
78    LIBS            = $(NSPR_LIBS)
79    
80  ifdef GNU_CXX  ifdef GNU_CXX
81  ifdef INTEL_CXX  ifdef INTEL_CXX
82  # icc gets special optimize flags  # icc gets special optimize flags
# Line 70  Line 87 
87  #XXX: do we want different INTERP_OPTIMIZER flags here?  #XXX: do we want different INTERP_OPTIMIZER flags here?
88  endif  endif
89  else # not INTEL_CXX  else # not INTEL_CXX
90  MODULE_OPTIMIZE_FLAGS = -Os -fstrict-aliasing $(MOZ_OPTIMIZE_SIZE_TWEAK)  MODULE_OPTIMIZE_FLAGS = -O3 -fstrict-aliasing $(MOZ_OPTIMIZE_SIZE_TWEAK)
91  # Special optimization flags for jsinterp.c  # Special optimization flags for jsinterp.c
92  INTERP_OPTIMIZER = -O3 -fstrict-aliasing  INTERP_OPTIMIZER = -O3 -fstrict-aliasing
93  endif  endif
# Line 91  Line 108 
108    
109  ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))  ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
110  LIBRARY_NAME    = js$(MOZ_BITS)$(VERSION_NUMBER)  LIBRARY_NAME    = js$(MOZ_BITS)$(VERSION_NUMBER)
 RESFILE         = js$(MOZ_BITS)40.res  
111  endif  endif
112    
113  # JavaScript must be built shared, even for static builds, as it is used by  # JavaScript must be built shared, even for static builds, as it is used by
114  # other modules which are always built shared. Failure to do so results in  # other modules which are always built shared. Failure to do so results in
115  # the js code getting copied into xpinstall and jsd as well as mozilla-bin,  # the js code getting copied into xpinstall and jsd as well as mozilla-bin,
116  # and then the static data cells used for locking no longer work.  # and then the static data cells used for locking no longer work.
117    #
118    # In fact, we now build both a static and a shared library, as the
119    # JS shell would like to link to the static library.
120    
 ifndef JS_STATIC_BUILD  
121  FORCE_SHARED_LIB = 1  FORCE_SHARED_LIB = 1
122  endif  FORCE_STATIC_LIB = 1
123    
124  VPATH           = $(srcdir)  VPATH           = $(srcdir)
125    
# Line 138  Line 156 
156                  jsscope.cpp \                  jsscope.cpp \
157                  jsscript.cpp \                  jsscript.cpp \
158                  jsstr.cpp \                  jsstr.cpp \
159                    jstask.cpp \
160                  jsutil.cpp \                  jsutil.cpp \
161                  jsxdrapi.cpp \                  jsxdrapi.cpp \
162                  jsxml.cpp \                  jsxml.cpp \
# Line 145  Line 164 
164                  $(NULL)                  $(NULL)
165    
166  ifdef HAVE_DTRACE  ifdef HAVE_DTRACE
167  CSRCS           += \  CPPSRCS         += \
168                  jsdtracef.c                  jsdtracef.cpp
169  endif  endif
170    
171  INSTALLED_HEADERS = \  INSTALLED_HEADERS = \
# Line 172  Line 191 
191                  jsgc.h \                  jsgc.h \
192                  jshash.h \                  jshash.h \
193                  jsinterp.h \                  jsinterp.h \
194                    jsinttypes.h \
195                  jsiter.h \                  jsiter.h \
196                  jslock.h \                  jslock.h \
197                  jslong.h \                  jslong.h \
198                  jsmath.h \                  jsmath.h \
199                  jsnum.h \                  jsnum.h \
200                  jsobj.h \                  jsobj.h \
201                    jsobjinlines.h \
202                  json.h \                  json.h \
203                  jsopcode.tbl \                  jsopcode.tbl \
204                  jsopcode.h \                  jsopcode.h \
# Line 191  Line 212 
212                  jsscan.h \                  jsscan.h \
213                  jsscope.h \                  jsscope.h \
214                  jsscript.h \                  jsscript.h \
215                    jsscriptinlines.h \
216                  jsstaticcheck.h \                  jsstaticcheck.h \
                 jsstddef.h \  
                 jsstdint.h \  
217                  jsstr.h \                  jsstr.h \
218                    jstask.h \
219                  jstracer.h \                  jstracer.h \
220                  jstypes.h \                  jstypes.h \
221                  jsutil.h \                  jsutil.h \
# Line 207  Line 228 
228  VPATH           += $(srcdir)/nanojit  VPATH           += $(srcdir)/nanojit
229    
230  INSTALLED_HEADERS += \  INSTALLED_HEADERS += \
                 builtins.tbl    \  
231                  jsbuiltins.h    \                  jsbuiltins.h    \
232                  Assembler.h     \                  Assembler.h     \
233                    Allocator.h     \
234                    CodeAlloc.h     \
235                    Containers.h    \
236                  LIR.h           \                  LIR.h           \
237                  avmplus.h       \                  avmplus.h       \
238                  Fragmento.h     \                  Fragmento.h     \
# Line 217  Line 240 
240                  Native$(NANOJIT_ARCH).h \                  Native$(NANOJIT_ARCH).h \
241                  RegAlloc.h      \                  RegAlloc.h      \
242                  nanojit.h       \                  nanojit.h       \
                 TraceTreeDrawer.h \  
243                  $(NULL)                  $(NULL)
244    
245  CPPSRCS += \  CPPSRCS += \
246                  jstracer.cpp \                  jstracer.cpp \
247                  Assembler.cpp  \                  Assembler.cpp  \
248                    Allocator.cpp  \
249                    CodeAlloc.cpp  \
250                    Containers.cpp \
251                  Fragmento.cpp  \                  Fragmento.cpp  \
252                  LIR.cpp        \                  LIR.cpp        \
253                  RegAlloc.cpp   \                  RegAlloc.cpp   \
# Line 234  Line 259 
259  ifdef WINCE  ifdef WINCE
260  # don't need -c  # don't need -c
261  AS_DASH_C_FLAG =  AS_DASH_C_FLAG =
262    ASFLAGS += -arch 6
263  ASFILES += jswince.asm  ASFILES += jswince.asm
264  endif  endif
265    
266  ifdef DEBUG  endif # ENABLE_JIT
 CPPSRCS += TraceTreeDrawer.cpp  
 endif  
   
 DEFINES += -DFEATURE_NANOJIT -DJS_TRACER  
 endif  
267    
268  ifdef HAVE_DTRACE  ifdef HAVE_DTRACE
269  INSTALLED_HEADERS += \  INSTALLED_HEADERS += \
# Line 277  Line 298 
298  endif  endif
299  endif  endif
300    
 # When using gcc the assembly is inlined in the C-file (see jslock.cpp)  
 ifeq ($(OS_ARCH),SunOS)  
 ifneq (86,$(findstring 86,$(OS_TEST)))  
 ifndef GNU_CC  
 ASFILES         = lock_$(OS_ARCH).s  
 endif  
 endif  
 endif  
   
301  ifndef BUILD_OPT  ifndef BUILD_OPT
302  MOCHAFILE       = 1  MOCHAFILE       = 1
303  endif  endif
304    
305    ifdef MOZ_OJI
306  ifndef NSBUILDROOT  ifndef NSBUILDROOT
307  JSJAVA_STUBHEADERS = \  JSJAVA_STUBHEADERS = \
308                  -I$(topsrcdir)/sun-java/include/_gen \                  -I$(topsrcdir)/sun-java/include/_gen \
# Line 303  Line 316 
316                  -I$(topsrcdir)/sun-java/md-include \                  -I$(topsrcdir)/sun-java/md-include \
317                  -I$(topsrcdir)/sun-java/include \                  -I$(topsrcdir)/sun-java/include \
318                  $(JSJAVA_STUBHEADERS)                  $(JSJAVA_STUBHEADERS)
319    endif
320    
321  # Define keyword generator before rules.mk, see bug 323979 comment 50  # Define keyword generator before rules.mk, see bug 323979 comment 50
322    
# Line 321  Line 335 
335  MOZILLA_DTRACE_SRC = $(srcdir)/javascript-trace.d  MOZILLA_DTRACE_SRC = $(srcdir)/javascript-trace.d
336  endif  endif
337    
338  include $(topsrcdir)/config/rules.mk  default::
339    
340    ifneq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
341    ifneq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH)))
342  # nsinstall doesn't get built until we enter config/ in the exports phase,  # nsinstall doesn't get built until we enter config/ in the exports phase,
343  # so we'll have to manually ensure it gets built here if we want to use  # so we'll have to manually ensure it gets built here if we want to use
344  # $(EXPORTS)  # $(EXPORTS)
345  ifneq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))  export:: config/nsinstall$(HOST_BIN_SUFFIX)
346  ifneq ($(OS_ARCH), WINCE)  $(PUBLIC) $(SDK_PUBLIC): config/nsinstall$(HOST_BIN_SUFFIX)
 $(EXPORTS) $(PUBLIC): config/nsinstall$(HOST_BIN_SUFFIX)  
347    
348  config/nsinstall$(HOST_BIN_SUFFIX): $(srcdir)/config/nsinstall.c $(srcdir)/config/pathsub.c  config/nsinstall$(HOST_BIN_SUFFIX): $(srcdir)/config/nsinstall.c $(srcdir)/config/pathsub.c
349          $(MAKE) -C config/ nsinstall$(HOST_BIN_SUFFIX)          $(MAKE) -C config/ nsinstall$(HOST_BIN_SUFFIX)
350  endif  endif
351  endif  endif
352    
353    include $(topsrcdir)/config/rules.mk
354    
355  ifdef MOZ_SYNC_BUILD_FILES  ifdef MOZ_SYNC_BUILD_FILES
356  # Because the SpiderMonkey can be distributed and built independently  # Because the SpiderMonkey can be distributed and built independently
357  # of the Mozilla source tree, it contains its own copies of many of  # of the Mozilla source tree, it contains its own copies of many of
# Line 347  Line 364 
364  # belongs in the other as well.  If the change isn't right for both  # belongs in the other as well.  If the change isn't right for both
365  # places, then that's something to bring up with the other developers.  # places, then that's something to bring up with the other developers.
366  #  #
367  # Some files are reasonable to diverge; for example,  # Some files are reasonable to diverge; for  example,
368  # js/config/autoconf.mk.in doesn't need most of the stuff in  # js/config/autoconf.mk.in doesn't need most of the stuff in
369  # config/autoconf.mk.in.  # config/autoconf.mk.in.
370  check-sync-dirs = $(PYTHON) $(srcdir)/config/check-sync-dirs.py  check-sync-dirs = $(PYTHON) $(srcdir)/config/check-sync-dirs.py
371  check::  check::
372          $(check-sync-dirs) $(srcdir)/config $(MOZ_SYNC_BUILD_FILES)/config          $(check-sync-dirs) $(srcdir)/config $(MOZ_SYNC_BUILD_FILES)/config
373          $(check-sync-dirs) $(srcdir)/build $(MOZ_SYNC_BUILD_FILES)/build          $(check-sync-dirs) $(srcdir)/build $(MOZ_SYNC_BUILD_FILES)/build
374    
375    check-valgrind::
376            $(check-sync-dirs) $(srcdir)/config $(MOZ_SYNC_BUILD_FILES)/config
377            $(check-sync-dirs) $(srcdir)/build $(MOZ_SYNC_BUILD_FILES)/build
378    endif
379    
380    ifdef ENABLE_JIT
381    check::
382            $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/trace-test/trace-test.py \
383                    --no-slow --no-progress --tinderbox $(DIST)/bin/js$(BIN_SUFFIX)
384    
385    check-valgrind::
386            $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/trace-test/trace-test.py \
387                    --valgrind --no-slow --no-progress --tinderbox $(DIST)/bin/js$(BIN_SUFFIX)
388  endif  endif
389    
390  # Temporarily disable - backout of bug 473989.  DIST_GARBAGE = config.cache config.log config.status \
391  #ifdef ENABLE_JIT     config/myrules.mk config/myconfig.mk \
392  #check::     unallmakefiles js-config js-config.h js-confdefs.h
393  #       $(wildcard $(RUN_TEST_PROGRAM)) ./js$(BIN_SUFFIX) -j -e \  
394  #               "var gSrcdir='$(srcdir)'; var gSkipSlowTests=true; var gReportSummary=false;" \  distclean::
395  #               $(srcdir)/trace-test.js          cat unallmakefiles | $(XARGS) rm -f
396  #endif          rm -f $(DIST_GARBAGE)
397    
398  # our build system doesn't handle subdir srcs very gracefully today  # our build system doesn't handle subdir srcs very gracefully today
399  export::  export::
# Line 443  Line 474 
474  ifeq ($(OS_ARCH),SunOS)  ifeq ($(OS_ARCH),SunOS)
475  ifeq ($(TARGET_CPU),sparc)  ifeq ($(TARGET_CPU),sparc)
476    
 ifdef JS_ULTRASPARC_OPTS  
 DEFINES += -DULTRA_SPARC  
477  ifdef GNU_CC  ifdef GNU_CC
478  CFLAGS   += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0  CFLAGS   += -mcpu=v9
479  CXXFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0,-K,PIC  CXXFLAGS += -mcpu=v9
480  else  else
481  ASFLAGS  += -xarch=v8plus -DULTRA_SPARC -P -L -D_ASM -D__STDC__=0 -K PIC  ASFLAGS  += -xarch=v8plus -P -L -D_ASM -D__STDC__=0 -K PIC
482  endif # GNU_CC  endif # GNU_CC
 endif # JS_ULTRASPARC_OPTS  
483    
484  endif  endif
485  ifeq ($(OS_RELEASE),4.1)  ifeq ($(OS_RELEASE),4.1)
# Line 507  Line 535 
535          $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<          $(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
536  endif  endif
537    
 jsopcode.h jsopcode.cpp: jsopcode.tbl  
   
538  export:: jsautocfg.h  export:: jsautocfg.h
539    
540  ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))  ifeq (,$(CROSS_COMPILE)$(GNU_CC)$(filter-out WINNT,$(OS_ARCH)))
541  jsautocfg.h:  jsautocfg.h:
542          touch $@          touch $@
543  else  else
# Line 597  Line 623 
623  SDK_BINARY = js-config  SDK_BINARY = js-config
624    
625  install:: $(INSTALLED_HEADERS)  install:: $(INSTALLED_HEADERS)
626          $(SYSINSTALL) $(IFLAGS1) $^ $(includedir)/$(MODULE)          $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE)
627    
628  install:: $(SCRIPTS)  install:: $(SCRIPTS)
629          $(SYSINSTALL) $(IFLAGS2) $^ $(bindir)          $(SYSINSTALL) $^ $(DESTDIR)$(bindir)
630    
631  install:: $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)  install:: $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
632  ifneq (,$(LIBRARY))  ifneq (,$(LIBRARY))
633          $(SYSINSTALL) $(IFLAGS1) $(LIBRARY) $(libdir)          $(SYSINSTALL) $(LIBRARY) $(DESTDIR)$(libdir)
634  endif  endif
635  ifneq (,$(SHARED_LIBRARY))  ifneq (,$(SHARED_LIBRARY))
636          $(SYSINSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(libdir)          $(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir)
637  endif  endif
638  ifneq (,$(IMPORT_LIBRARY))  ifneq (,$(IMPORT_LIBRARY))
639          $(SYSINSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(libdir)          $(SYSINSTALL) $(IMPORT_LIBRARY) $(DESTDIR)$(libdir)
640  endif  endif
641    
642  # Extra dependancies and rules for auto-generated headers  # Extra dependancies and rules for auto-generated headers
# Line 637  Line 663 
663          sed 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \          sed 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
664              javascript-trace.h.in > javascript-trace.h              javascript-trace.h.in > javascript-trace.h
665    
666  $(CPPSRCS:%.cpp=%.$(OBJ_SUFFIX)): $(CURDIR)/javascript-trace.h  # We can't automatically generate dependencies on auto-generated headers;
667    # we have to list them explicitly.
668    $(addsuffix .$(OBJ_SUFFIX),jsdtracef jsinterp jsobj): $(CURDIR)/javascript-trace.h
669  endif  endif
670    
671  ifdef GNU_CC  ifdef GNU_CC
672    ifndef CROSS_COMPILE
673    # If we don't have run-mozilla.sh *and* we're linking against NSPR, we don't
674    # know how to run the JS binary. Oh well
675    
676  imacro_asm.js: imacro_asm.js.in jsopcode.tbl  imacro_asm.js: imacro_asm.js.in jsopcode.tbl
677          $(CC) -c -x c -E -P -I$(srcdir) $< > $@          $(CC) -c -x c -E -P -I$(srcdir) $< > $@
678    
679  GARBAGE += imacros.c.out imacro_asm.js  GARBAGE += imacros.c.tmp imacro_asm.js
680    
681  ifndef CROSS_COMPILE  ifneq (,$(wildcard $(RUN_TEST_PROGRAM))$(if $(NSPR_LIBS),,1))
682  # Obsolete comment: if you replace update-imacros with libs, this would apply  libs:: imacro_asm.js $(srcdir)/imacros.jsasm
683  # but then parallel gmake would sometimes try to run $(DIST)/bin/js before it          $(wildcard $(RUN_TEST_PROGRAM)) $(DIST)/bin/js$(BIN_SUFFIX) $< $(srcdir)/imacros.jsasm > imacros.c.tmp
684  # had been built and installed. Want a fix for this, de-automating for now.          @cmp -s imacros.c.tmp $(srcdir)/imacros.c.out || \
685              (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)
686  # Build imacros.c.out after descending into DIRS and building the js shell.          @echo "imacros.c.out is up to date"
 # This may result in an updated imacros.c.out file that requires a re-build  
 # to stabilize.  
 update-imacros:: imacros.c.out  
         @cmp -s imacros.c.out $(srcdir)/$< || cp imacros.c.out $(srcdir)  
687    
688  %.c.out: %.jsasm imacro_asm.js  update-imacros: imacros.c.tmp
689          $(DIST)/bin/js imacro_asm.js $< > $@          cp $< $(srcdir)/imacros.c.out
690    
691    .PHONY: update-imacros
692    endif
693  endif  endif
694  endif  endif

Legend:
Removed from v.460  
changed lines
  Added in v.507

  ViewVC Help
Powered by ViewVC 1.1.24