/[jscoverage]/trunk/js/config/rules.mk
ViewVC logotype

Diff of /trunk/js/config/rules.mk

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

revision 403 by siliconforks, Tue Dec 9 23:37:53 2008 UTC revision 507 by siliconforks, Sun Jan 10 07:23:34 2010 UTC
# Line 38  Line 38 
38  # the terms of any one of the MPL, the GPL or the LGPL.  # the terms of any one of the MPL, the GPL or the LGPL.
39  #  #
40  # ***** END LICENSE BLOCK *****  # ***** END LICENSE BLOCK *****
 NO_DIST_INSTALL = 1  
41    
42  ifndef topsrcdir  ifndef topsrcdir
43  topsrcdir               = $(DEPTH)  $(error topsrcdir was not set))
44  endif  endif
45    
46  ifndef MOZILLA_DIR  ifndef MOZILLA_DIR
# Line 56  Line 55 
55  include $(topsrcdir)/config/version.mk  include $(topsrcdir)/config/version.mk
56  endif  endif
57    
58    ifdef SDK_XPIDLSRCS
59    XPIDLSRCS += $(SDK_XPIDLSRCS)
60    endif
61    ifdef SDK_HEADERS
62    EXPORTS += $(SDK_HEADERS)
63    endif
64    
65  REPORT_BUILD = @echo $(notdir $<)  REPORT_BUILD = @echo $(notdir $<)
66    
67  ifeq ($(OS_ARCH),OS2)  ifeq ($(OS_ARCH),OS2)
# Line 64  Line 70 
70  EXEC                    = exec  EXEC                    = exec
71  endif  endif
72    
73    # Don't copy xulrunner files at install time, when using system xulrunner
74    ifdef SYSTEM_LIBXUL
75      SKIP_COPY_XULRUNNER=1
76    endif
77    
78  # ELOG prints out failed command when building silently (gmake -s).  # ELOG prints out failed command when building silently (gmake -s).
79  ifneq (,$(findstring -s,$(MAKEFLAGS)))  ifneq (,$(findstring -s,$(MAKEFLAGS)))
80    ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh    ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh
# Line 78  Line 89 
89  endif  endif
90    
91  ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))  ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
92  PWD := $(shell pwd)  _VPATH_SRCS = $(if $(filter /%,$<),$<,$(CURDIR)/$<)
 _VPATH_SRCS = $(if $(filter /%,$<),$<,$(PWD)/$<)  
93  else  else
94  _VPATH_SRCS = $<  _VPATH_SRCS = $<
95  endif  endif
# Line 115  Line 125 
125  EXTRA_DSO_LIBS  := $(call EXPAND_MOZLIBNAME,$(EXTRA_DSO_LIBS))  EXTRA_DSO_LIBS  := $(call EXPAND_MOZLIBNAME,$(EXTRA_DSO_LIBS))
126  endif  endif
127    
128    ################################################################################
129    # Testing frameworks support
130    ################################################################################
131    
132    ifdef ENABLE_TESTS
133    
134    ifdef XPCSHELL_TESTS
135    ifndef MODULE
136    $(error Must define MODULE when defining XPCSHELL_TESTS.)
137    endif
138    
139    testxpcobjdir = $(DEPTH)/_tests/xpcshell
140    
141    # Test file installation
142    ifneq (,$(filter WINNT os2-emx,$(HOST_OS_ARCH)))
143    # Windows and OS/2 nsinstall can't recursively copy directories, so use nsinstall.py
144    TEST_INSTALLER = $(PYTHON) $(topsrcdir)/config/nsinstall.py
145    else
146    TEST_INSTALLER = $(INSTALL)
147    endif
148    
149    define _INSTALL_TESTS
150    $(TEST_INSTALLER) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(MODULE)/$(dir)
151    
152    endef # do not remove the blank line!
153    
154    SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
155    
156    libs::
157            $(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
158            $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl \
159              $(testxpcobjdir)/all-test-dirs.list \
160              $(addprefix $(MODULE)/,$(XPCSHELL_TESTS))
161    
162    testxpcsrcdir = $(topsrcdir)/testing/xpcshell
163    
164    # Execute all tests in the $(XPCSHELL_TESTS) directories.
165    # See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
166    xpcshell-tests:
167            $(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
168              -I$(topsrcdir)/build \
169              $(testxpcsrcdir)/runxpcshelltests.py \
170              --symbols-path=$(DIST)/crashreporter-symbols \
171              $(DIST)/bin/xpcshell \
172              $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
173    
174    # Execute a single test, specified in $(SOLO_FILE), but don't automatically
175    # start the test. Instead, present the xpcshell prompt so the user can
176    # attach a debugger and then start the test.
177    check-interactive:
178            $(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
179              -I$(topsrcdir)/build \
180              $(testxpcsrcdir)/runxpcshelltests.py \
181              --symbols-path=$(DIST)/crashreporter-symbols \
182              --test-path=$(SOLO_FILE) \
183              --interactive \
184              $(DIST)/bin/xpcshell \
185              $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
186    
187    # Execute a single test, specified in $(SOLO_FILE)
188    check-one:
189            $(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
190              -I$(topsrcdir)/build \
191              $(testxpcsrcdir)/runxpcshelltests.py \
192              --symbols-path=$(DIST)/crashreporter-symbols \
193              --test-path=$(SOLO_FILE) \
194              $(DIST)/bin/xpcshell \
195              $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
196    
197    endif # XPCSHELL_TESTS
198    
199    ifdef CPP_UNIT_TESTS
200    
201    # Compile the tests to $(DIST)/bin.  Make lots of niceties available by default
202    # through TestHarness.h, by modifying the list of includes and the libs against
203    # which stuff links.
204    CPPSRCS += $(CPP_UNIT_TESTS)
205    SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX))
206    INCLUDES += -I$(DIST)/include/testing
207    LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS)
208    
209    # ...and run them the usual way
210    check::
211            @$(EXIT_ON_ERROR) \
212              for f in $(subst .cpp,,$(CPP_UNIT_TESTS)); do \
213                XPCOM_DEBUG_BREAK=stack-and-abort $(RUN_TEST_PROGRAM) $(DIST)/bin/$$f; \
214              done
215    
216    endif # CPP_UNIT_TESTS
217    
218    .PHONY: check xpcshell-tests check-interactive check-one
219    
220    endif # ENABLE_TESTS
221    
222    
223  #  #
224  # Library rules  # Library rules
225  #  #
# Line 123  Line 228 
228  #  #
229    
230  ifndef LIBRARY  ifndef LIBRARY
231  ifdef LIBRARY_NAME  ifdef STATIC_LIBRARY_NAME
232  ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))  ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
233  ifdef SHORT_LIBNAME  ifdef SHORT_LIBNAME
234  LIBRARY_NAME            := $(SHORT_LIBNAME)  STATIC_LIBRARY_NAME     := $(SHORT_LIBNAME)
235  endif  SHARED_LIBRARY_NAME     := $(SHORT_LIBNAME)
 endif  
 LIBRARY                 := $(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX)  
236  endif  endif
237  endif  endif
238    LIBRARY                 := $(LIB_PREFIX)$(STATIC_LIBRARY_NAME).$(LIB_SUFFIX)
239    endif # STATIC_LIBRARY_NAME
240    endif # LIBRARY
241    
242  ifndef HOST_LIBRARY  ifndef HOST_LIBRARY
243  ifdef HOST_LIBRARY_NAME  ifdef HOST_LIBRARY_NAME
# Line 148  Line 254 
254  endif  endif
255    
256  ifdef MAKE_FRAMEWORK  ifdef MAKE_FRAMEWORK
257  SHARED_LIBRARY          := $(LIBRARY_NAME)  SHARED_LIBRARY          := $(SHARED_LIBRARY_NAME)
258  else  else
259  SHARED_LIBRARY          := $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)  SHARED_LIBRARY          := $(DLL_PREFIX)$(SHARED_LIBRARY_NAME)$(DLL_SUFFIX)
260  endif  endif
261    
262  ifeq ($(OS_ARCH),OS2)  ifeq ($(OS_ARCH),OS2)
# Line 158  Line 264 
264  endif  endif
265    
266  ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))  ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
267  IMPORT_LIBRARY          := $(LIB_PREFIX)$(LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)  IMPORT_LIBRARY          := $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
268  endif  endif
269    
270  ifdef MOZ_ENABLE_LIBXUL  ifdef MOZ_ENABLE_LIBXUL
# Line 201  Line 307 
307  ifndef GNU_CC  ifndef GNU_CC
308    
309  #  #
310  # All C++ files share a PDB file per directory. For parallel builds, this PDB  # Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
311  # file is shared and locked by MSPDBSRV.EXE, starting with MSVC8 SP1. If  # directory. For parallel builds, this PDB file is shared and locked by
312  # you're using MSVC 7.1 or MSVC8 without SP1, don't do parallel builds.  # MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
313    # without SP1, don't do parallel builds.
314  #  #
315  # The final PDB for libraries and programs is created by the linker and uses  # The final PDB for libraries and programs is created by the linker and uses
316  # a different name from the single PDB file created by the compiler. See  # a different name from the single PDB file created by the compiler. See
317  # bug 462740.  # bug 462740.
318  #  #
319    
320    ifdef SIMPLE_PROGRAMS
321    COMPILE_PDBFILE = $(basename $(@F)).pdb
322    else
323  COMPILE_PDBFILE = generated.pdb  COMPILE_PDBFILE = generated.pdb
324    endif
325    
326  LINK_PDBFILE = $(basename $(@F)).pdb  LINK_PDBFILE = $(basename $(@F)).pdb
327  ifdef MOZ_DEBUG  ifdef MOZ_DEBUG
328  CODFILE=$(basename $(@F)).cod  CODFILE=$(basename $(@F)).cod
329  endif  endif
330    
331  ifdef MOZ_MAPINFO  ifdef MOZ_MAPINFO
332  ifdef LIBRARY_NAME  ifdef SHARED_LIBRARY_NAME
333  MAPFILE=$(LIBRARY_NAME).map  MAPFILE=$(SHARED_LIBRARY_NAME).map
334  else  else
335  MAPFILE=$(basename $(@F)).map  MAPFILE=$(basename $(@F)).map
336  endif # LIBRARY_NAME  endif # SHARED_LIBRARY_NAME
337  endif # MOZ_MAPINFO  endif # MOZ_MAPINFO
338    
339  ifdef DEFFILE  ifdef DEFFILE
340  OS_LDFLAGS += -DEF:$(DEFFILE)  OS_LDFLAGS += -DEF:$(call normalizepath,$(DEFFILE))
341  EXTRA_DEPS += $(DEFFILE)  EXTRA_DEPS += $(DEFFILE)
342  endif  endif
343    
344  ifdef MAPFILE  ifdef MAPFILE
345  OS_LDFLAGS += -MAP:$(MAPFILE)  OS_LDFLAGS += -MAP:$(MAPFILE)
 #CFLAGS += -Fm$(MAPFILE)  
 #CXXFLAGS += -Fm$(MAPFILE)  
346  endif  endif
347    
 #ifdef CODFILE  
 #CFLAGS += -Fa$(CODFILE) -FAsc  
 #CFLAGS += -Fa$(CODFILE) -FAsc  
 #endif  
   
348  endif # !GNU_CC  endif # !GNU_CC
349    
350  ifdef ENABLE_CXX_EXCEPTIONS  ifdef ENABLE_CXX_EXCEPTIONS
# Line 287  Line 393 
393  LIBOBJS                 := $(addsuffix \", $(LIBOBJS))  LIBOBJS                 := $(addsuffix \", $(LIBOBJS))
394    
395  ifndef MOZ_AUTO_DEPS  ifndef MOZ_AUTO_DEPS
396  ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS))  ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS))
397  MDDEPFILES              = $(addprefix $(MDDEPDIR)/,$(OBJS:.$(OBJ_SUFFIX)=.pp))  MDDEPFILES              = $(addprefix $(MDDEPDIR)/,$(OBJS:.$(OBJ_SUFFIX)=.pp))
398  ifndef NO_GEN_XPT  ifndef NO_GEN_XPT
399  MDDEPFILES              += $(addprefix $(MDDEPDIR)/,$(XPIDLSRCS:.idl=.xpt)) \  MDDEPFILES              += $(addprefix $(MDDEPDIR)/,$(XPIDLSRCS:.idl=.xpt))
                            $(addprefix $(MDDEPDIR)/,$(SDK_XPIDLSRCS:.idl=.xpt))  
400  endif  endif
401  endif  endif
402  endif  endif
# Line 327  Line 432 
432  # the Solaris WorkShop template repository cache.  it occasionally can get  # the Solaris WorkShop template repository cache.  it occasionally can get
433  # out of sync, so targets like clobber should kill it.  # out of sync, so targets like clobber should kill it.
434  #  #
435  ifeq ($(OS_ARCH),SunOS)  ifeq ($(SOLARIS_SUNPRO_CXX),1)
 ifeq ($(GNU_CXX),)  
436  GARBAGE_DIRS += SunWS_cache  GARBAGE_DIRS += SunWS_cache
437  endif  endif
 endif  
438    
439  ifeq ($(OS_ARCH),OpenVMS)  ifeq ($(OS_ARCH),OpenVMS)
440  GARBAGE                 += $(wildcard *.*_defines)  GARBAGE                 += $(wildcard *.*_defines)
# Line 356  Line 459 
459  # Its good not to have a newline at the end of the titlebar string because it  # Its good not to have a newline at the end of the titlebar string because it
460  # makes the make -s output easier to read.  Echo -n does not work on all  # makes the make -s output easier to read.  Echo -n does not work on all
461  # platforms, but we can trick sed into doing it.  # platforms, but we can trick sed into doing it.
462  UPDATE_TITLE = sed -e "s!Y!$@ in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(dir)!" $(MOZILLA_DIR)/config/xterm.str;  UPDATE_TITLE = sed -e "s!Y!$(1) in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2)!" $(MOZILLA_DIR)/config/xterm.str;
 UPDATE_TITLE_export = sed -e "s!Y!export in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;  
 UPDATE_TITLE_libs = sed -e "s!Y!libs in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;  
 UPDATE_TITLE_tools = sed -e "s!Y!tools in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;  
463  endif  endif
464    
465    define SUBMAKE # $(call SUBMAKE,target,directory)
466    @$(UPDATE_TITLE)
467    +@$(MAKE) $(if $(2),-C $(2)) $(1)
468    
469    endef # The extra line is important here! don't delete it
470    
471    ifneq (,$(strip $(DIRS)))
472  LOOP_OVER_DIRS = \  LOOP_OVER_DIRS = \
473      @$(EXIT_ON_ERROR) \    $(foreach dir,$(DIRS),$(call SUBMAKE,$@,$(dir)))
474      $(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true  endif
475    
476  # we only use this for the makefiles target and other stuff that doesn't matter  # we only use this for the makefiles target and other stuff that doesn't matter
477    ifneq (,$(strip $(PARALLEL_DIRS)))
478  LOOP_OVER_PARALLEL_DIRS = \  LOOP_OVER_PARALLEL_DIRS = \
479      @$(EXIT_ON_ERROR) \    $(foreach dir,$(PARALLEL_DIRS),$(call SUBMAKE,$@,$(dir)))
480      $(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true  endif
481    
482    ifneq (,$(strip $(STATIC_DIRS)))
483  LOOP_OVER_STATIC_DIRS = \  LOOP_OVER_STATIC_DIRS = \
484      @$(EXIT_ON_ERROR) \    $(foreach dir,$(STATIC_DIRS),$(call SUBMAKE,$@,$(dir)))
485      $(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true  endif
486    
487    ifneq (,$(strip $(TOOL_DIRS)))
488  LOOP_OVER_TOOL_DIRS = \  LOOP_OVER_TOOL_DIRS = \
489      @$(EXIT_ON_ERROR) \    $(foreach dir,$(TOOL_DIRS),$(call SUBMAKE,$@,$(dir)))
490      $(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true  endif
491    
492  ifdef PARALLEL_DIRS  ifdef PARALLEL_DIRS
493  # create a bunch of fake targets for order-only processing  # create a bunch of fake targets for order-only processing
# Line 403  Line 513 
513  # MAKE_DIRS: List of directories to build while looping over directories.  # MAKE_DIRS: List of directories to build while looping over directories.
514  # A Makefile that needs $(MDDEPDIR) created but doesn't set any of these  # A Makefile that needs $(MDDEPDIR) created but doesn't set any of these
515  # variables we know to check can just set NEED_MDDEPDIR explicitly.  # variables we know to check can just set NEED_MDDEPDIR explicitly.
516  ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS)$(NEED_MDDEPDIR))  ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS)$(NEED_MDDEPDIR))
517  MAKE_DIRS               += $(CURDIR)/$(MDDEPDIR)  MAKE_DIRS               += $(CURDIR)/$(MDDEPDIR)
518  GARBAGE_DIRS            += $(MDDEPDIR)  GARBAGE_DIRS            += $(MDDEPDIR)
519  endif  endif
# Line 606  Line 716 
716  # default rule before including rules.mk  # default rule before including rules.mk
717  ifndef SUPPRESS_DEFAULT_RULES  ifndef SUPPRESS_DEFAULT_RULES
718  ifdef TIERS  ifdef TIERS
   
 DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_dirs))  
 STATIC_DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_staticdirs))  
   
719  default all alldep::  default all alldep::
720          $(EXIT_ON_ERROR) \          $(foreach tier,$(TIERS),$(call SUBMAKE,tier_$(tier)))
         $(foreach tier,$(TIERS),$(MAKE) tier_$(tier); ) true  
   
721  else  else
722    
723  default all::  default all::
724          @$(EXIT_ON_ERROR) \  ifneq (,$(strip $(STATIC_DIRS)))
725          $(foreach dir,$(STATIC_DIRS),$(MAKE) -C $(dir); ) true          $(foreach dir,$(STATIC_DIRS),$(call SUBMAKE,,$(dir)))
726    endif
727          $(MAKE) export          $(MAKE) export
728          $(MAKE) libs          $(MAKE) libs
729          $(MAKE) tools          $(MAKE) tools
# Line 643  Line 748 
748    
749  MAKE_TIER_SUBMAKEFILES = +$(if $(tier_$*_dirs),$(MAKE) $(addsuffix /Makefile,$(tier_$*_dirs)))  MAKE_TIER_SUBMAKEFILES = +$(if $(tier_$*_dirs),$(MAKE) $(addsuffix /Makefile,$(tier_$*_dirs)))
750    
751  export_tier_%:  export_tier_%:
752          @$(ECHO) "$@"          @$(ECHO) "$@"
753          @$(MAKE_TIER_SUBMAKEFILES)          @$(MAKE_TIER_SUBMAKEFILES)
754          @$(EXIT_ON_ERROR) \          $(foreach dir,$(tier_$*_dirs),$(call SUBMAKE,export,$(dir)))
         $(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) export; ) true  
755    
756  libs_tier_%:  libs_tier_%:
757          @$(ECHO) "$@"          @$(ECHO) "$@"
758          @$(MAKE_TIER_SUBMAKEFILES)          @$(MAKE_TIER_SUBMAKEFILES)
759          @$(EXIT_ON_ERROR) \          $(foreach dir,$(tier_$*_dirs),$(call SUBMAKE,libs,$(dir)))
         $(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) libs; ) true  
760    
761  tools_tier_%:  tools_tier_%:
762          @$(ECHO) "$@"          @$(ECHO) "$@"
763          @$(MAKE_TIER_SUBMAKEFILES)          @$(MAKE_TIER_SUBMAKEFILES)
764          @$(EXIT_ON_ERROR) \          $(foreach dir,$(tier_$*_dirs),$(call SUBMAKE,tools,$(dir)))
         $(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) tools; ) true  
765    
766  $(foreach tier,$(TIERS),tier_$(tier))::  $(foreach tier,$(TIERS),tier_$(tier))::
767          @$(ECHO) "$@: $($@_staticdirs) $($@_dirs)"          @$(ECHO) "$@: $($@_staticdirs) $($@_dirs)"
768          @$(EXIT_ON_ERROR) \          $(foreach dir,$($@_staticdirs),$(call SUBMAKE,,$(dir)))
         $(foreach dir,$($@_staticdirs),$(MAKE) -C $(dir); ) true  
769          $(MAKE) export_$@          $(MAKE) export_$@
770          $(MAKE) libs_$@          $(MAKE) libs_$@
771    
# Line 676  Line 777 
777  # Add dummy depend target for tinderboxes  # Add dummy depend target for tinderboxes
778  depend::  depend::
779    
 ifdef ALL_PLATFORMS  
 all_platforms:: $(NFSPWD)  
         @d=`$(NFSPWD)`;                                                 \  
         if test ! -d LOGS; then rm -rf LOGS; mkdir LOGS; else true; fi; \  
         for h in $(PLATFORM_HOSTS); do                                  \  
                 echo "On $$h: $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log";\  
                 rsh $$h -n "(chdir $$d;                                 \  
                              $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log;  \  
                              echo DONE) &" 2>&1 > LOGS/$$h.pid &        \  
                 sleep 1;                                                \  
         done  
   
 $(NFSPWD):  
         cd $(@D); $(MAKE) $(@F)  
 endif  
   
780  # Target to only regenerate makefiles  # Target to only regenerate makefiles
781  makefiles: $(SUBMAKEFILES)  makefiles: $(SUBMAKEFILES)
782  ifneq (,$(DIRS)$(TOOL_DIRS)$(PARALLEL_DIRS))  ifneq (,$(DIRS)$(TOOL_DIRS)$(PARALLEL_DIRS))
783          +$(LOOP_OVER_PARALLEL_DIRS)          $(LOOP_OVER_PARALLEL_DIRS)
784          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
785          +$(LOOP_OVER_TOOL_DIRS)          $(LOOP_OVER_TOOL_DIRS)
786  endif  endif
787    
788  ifdef PARALLEL_DIRS  ifdef PARALLEL_DIRS
789  export:: $(PARALLEL_DIRS_export)  export:: $(PARALLEL_DIRS_export)
790    
791  $(PARALLEL_DIRS_export): %_export: %/Makefile  $(PARALLEL_DIRS_export): %_export: %/Makefile
792          +@$(UPDATE_TITLE_export) $(MAKE) -C $* export          +@$(call SUBMAKE,export,$*)
793  endif  endif
794    
795  export:: $(SUBMAKEFILES) $(MAKE_DIRS) $(if $(EXPORTS)$(XPIDLSRCS)$(SDK_HEADERS)$(SDK_XPIDLSRCS),$(PUBLIC)) $(if $(SDK_HEADERS)$(SDK_XPIDLSRCS),$(SDK_PUBLIC)) $(if $(XPIDLSRCS),$(IDL_DIR)) $(if $(SDK_XPIDLSRCS),$(SDK_IDL_DIR))  export:: $(SUBMAKEFILES) $(MAKE_DIRS) $(if $(XPIDLSRCS),$(IDL_DIR))
796          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
797          +$(LOOP_OVER_TOOL_DIRS)          $(LOOP_OVER_TOOL_DIRS)
798    
799  ifdef PARALLEL_DIRS  ifdef PARALLEL_DIRS
800  tools:: $(PARALLEL_DIRS_tools)  tools:: $(PARALLEL_DIRS_tools)
801    
802  $(PARALLEL_DIRS_tools): %_tools: %/Makefile  $(PARALLEL_DIRS_tools): %_tools: %/Makefile
803          +@$(UPDATE_TITLE_tools) $(MAKE) -C $* tools          +@$(call SUBMAKE,tools,$*)
804  endif  endif
805    
806  tools:: $(SUBMAKEFILES) $(MAKE_DIRS)  tools:: $(SUBMAKEFILES) $(MAKE_DIRS)
807          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
808  ifdef TOOL_DIRS  ifneq (,$(strip $(TOOL_DIRS)))
809          @$(EXIT_ON_ERROR) \          $(foreach dir,$(TOOL_DIRS),$(call SUBMAKE,libs,$(dir)))
         $(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) libs; ) true  
810  endif  endif
811    
812  #  #
# Line 733  Line 817 
817  ifdef EXPORT_LIBRARY  ifdef EXPORT_LIBRARY
818  ifdef IS_COMPONENT  ifdef IS_COMPONENT
819  ifdef BUILD_STATIC_LIBS  ifdef BUILD_STATIC_LIBS
820          @$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(LIBRARY_NAME)          @$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(STATIC_LIBRARY_NAME)
821  ifdef MODULE_NAME  ifdef MODULE_NAME
822          @$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)          @$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)
823  endif  endif
824  endif  endif # BUILD_STATIC_LIBS
825  else  else  # !IS_COMPONENT
826          $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(LIBRARY_NAME)          $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
827  endif # IS_COMPONENT  endif # IS_COMPONENT
828  endif # EXPORT_LIBRARY  endif # EXPORT_LIBRARY
829  endif # LIBRARY_NAME  endif # LIBRARY_NAME
# Line 749  Line 833 
833  HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX), $(HOST_LIBS))  HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX), $(HOST_LIBS))
834  DSO_LDOPTS_DEPS = $(EXTRA_DSO_LIBS) $(filter %.$(LIB_SUFFIX), $(EXTRA_DSO_LDOPTS))  DSO_LDOPTS_DEPS = $(EXTRA_DSO_LIBS) $(filter %.$(LIB_SUFFIX), $(EXTRA_DSO_LDOPTS))
835    
836    # Dependancies which, if modified, should cause everything to rebuild
837    GLOBAL_DEPS += Makefile Makefile.in $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk
838    
839  ##############################################  ##############################################
840  ifdef PARALLEL_DIRS  ifdef PARALLEL_DIRS
841  libs:: $(PARALLEL_DIRS_libs)  libs:: $(PARALLEL_DIRS_libs)
842    
843  $(PARALLEL_DIRS_libs): %_libs: %/Makefile  $(PARALLEL_DIRS_libs): %_libs: %/Makefile
844          +@$(UPDATE_TITLE_libs) $(MAKE) -C $* libs          +@$(call SUBMAKE,libs,$*)
845  endif  endif
846    
847  libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(JAVA_LIBRARY)  libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(JAVA_LIBRARY)
# Line 779  Line 866 
866  ifdef IS_COMPONENT  ifdef IS_COMPONENT
867          $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components          $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components
868          $(ELF_DYNSTR_GC) $(FINAL_TARGET)/components/$(SHARED_LIBRARY)          $(ELF_DYNSTR_GC) $(FINAL_TARGET)/components/$(SHARED_LIBRARY)
869            @$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_TARGET)/components/components.list $(SHARED_LIBRARY)
870  ifdef BEOS_ADDON_WORKAROUND  ifdef BEOS_ADDON_WORKAROUND
871          ( cd $(FINAL_TARGET)/components && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) )          ( cd $(FINAL_TARGET)/components && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) )
872  endif  endif
# Line 817  Line 905 
905  endif  endif
906  endif # JAVA_LIBRARY  endif # JAVA_LIBRARY
907  endif # !NO_DIST_INSTALL  endif # !NO_DIST_INSTALL
908          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
909    
910  ##############################################  ##############################################
911    
# Line 829  Line 917 
917  # in both stages so you can do depend builds with PGO.  # in both stages so you can do depend builds with PGO.
918  ifdef SHARED_LIBRARY  ifdef SHARED_LIBRARY
919  $(SHARED_LIBRARY): FORCE  $(SHARED_LIBRARY): FORCE
 BINARY_BASENAME = $(SHARED_LIBRARY:$(DLL_SUFFIX)=)  
920  endif  endif
921  ifdef PROGRAM  ifdef PROGRAM
922  $(PROGRAM): FORCE  $(PROGRAM): FORCE
 BINARY_BASENAME = $(PROGRAM:$(BIN_SUFFIX)=)  
923  endif  endif
924    
925  ifdef MOZ_PROFILE_USE  ifdef MOZ_PROFILE_USE
926  # In the second pass, we need to merge the pgc files into the pgd file.  # In the second pass, we need to merge the pgc files into the pgd file.
927  # The compiler would do this for us automatically if they were in the right  # The compiler would do this for us automatically if they were in the right
928  # place, but they're in dist/bin.  # place, but they're in dist/bin.
929  ifdef BINARY_BASENAME  ifneq (,$(SHARED_LIBRARY)$(PROGRAM))
930  export::  export::
931    ifdef PROGRAM
932          $(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \          $(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
933            $(BINARY_BASENAME) $(DIST)/bin            $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin
934    endif
935    ifdef SHARED_LIBRARY
936            $(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
937              $(SHARED_LIBRARY_NAME) $(DIST)/bin
938    endif
939  endif  endif
940  endif # MOZ_PROFILE_USE  endif # MOZ_PROFILE_USE
941  endif # WINNT_  endif # WINNT_
# Line 855  Line 947 
947  checkout:  checkout:
948          $(MAKE) -C $(topsrcdir) -f client.mk checkout          $(MAKE) -C $(topsrcdir) -f client.mk checkout
949    
 run_viewer: $(FINAL_TARGET)/viewer  
         cd $(FINAL_TARGET); \  
         MOZILLA_FIVE_HOME=`pwd` \  
         LD_LIBRARY_PATH=".:$(LIBS_PATH):$$LD_LIBRARY_PATH" \  
         viewer  
   
950  clean clobber realclean clobber_all:: $(SUBMAKEFILES)  clean clobber realclean clobber_all:: $(SUBMAKEFILES)
951          -rm -f $(ALL_TRASH)          -rm -f $(ALL_TRASH)
952          -rm -rf $(ALL_TRASH_DIRS)          -rm -rf $(ALL_TRASH_DIRS)
953          +-$(LOOP_OVER_PARALLEL_DIRS)          $(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir)))
         +-$(LOOP_OVER_DIRS)  
         +-$(LOOP_OVER_STATIC_DIRS)  
         +-$(LOOP_OVER_TOOL_DIRS)  
954    
955  distclean:: $(SUBMAKEFILES)  distclean:: $(SUBMAKEFILES)
956          +-$(LOOP_OVER_PARALLEL_DIRS)          $(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir)))
         +-$(LOOP_OVER_DIRS)  
         +-$(LOOP_OVER_STATIC_DIRS)  
         +-$(LOOP_OVER_TOOL_DIRS)  
957          -rm -rf $(ALL_TRASH_DIRS)          -rm -rf $(ALL_TRASH_DIRS)
958          -rm -f $(ALL_TRASH)  \          -rm -f $(ALL_TRASH)  \
959          Makefile .HSancillary \          Makefile .HSancillary \
# Line 892  Line 972 
972  # PROGRAM = Foo  # PROGRAM = Foo
973  # creates OBJS, links with LIBS to create Foo  # creates OBJS, links with LIBS to create Foo
974  #  #
975  $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) Makefile Makefile.in  $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
976  ifeq (WINCE,$(OS_ARCH))  ifeq (WINCE,$(OS_ARCH))
977          $(LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)          $(LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
978  else  else
# Line 930  Line 1010 
1010  endif  endif
1011  endif # BeOS  endif # BeOS
1012    
1013  $(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) Makefile Makefile.in  $(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
1014  ifeq (WINCE,$(OS_ARCH))  ifeq (WINCE,$(OS_ARCH))
1015          $(HOST_LD) -NOLOGO -OUT:$@ $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)          $(HOST_LD) -NOLOGO -OUT:$@ $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
1016  else  else
# Line 938  Line 1018 
1018          $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)          $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
1019  ifdef MSMANIFEST_TOOL  ifdef MSMANIFEST_TOOL
1020          @if test -f $@.manifest; then \          @if test -f $@.manifest; then \
1021                  mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \                  if test -f "$(srcdir)/$@.manifest"; then \
1022                            mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
1023                    else \
1024                            mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
1025                    fi; \
1026                  rm -f $@.manifest; \                  rm -f $@.manifest; \
1027          fi          fi
1028  endif   # MSVC with manifest tool  endif   # MSVC with manifest tool
# Line 959  Line 1043 
1043  # SIMPLE_PROGRAMS = Foo Bar  # SIMPLE_PROGRAMS = Foo Bar
1044  # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.  # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
1045  #  #
1046  $(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(LIBS_DEPS) $(EXTRA_DEPS) Makefile Makefile.in  $(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
1047  ifeq (WINCE,$(OS_ARCH))  ifeq (WINCE,$(OS_ARCH))
1048          $(LD) -nologo  -entry:main -out:$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)          $(LD) -nologo  -entry:main -out:$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
1049  else  else
# Line 987  Line 1071 
1071          $(MOZ_POST_PROGRAM_COMMAND) $@          $(MOZ_POST_PROGRAM_COMMAND) $@
1072  endif  endif
1073    
1074  $(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) Makefile Makefile.in  $(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
1075  ifeq (WINCE,$(OS_ARCH))  ifeq (WINCE,$(OS_ARCH))
1076          $(HOST_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)          $(HOST_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
1077  else  else
# Line 1053  Line 1137 
1137  EXTRA_DEPS += $(DTRACE_PROBE_OBJ)  EXTRA_DEPS += $(DTRACE_PROBE_OBJ)
1138  endif  endif
1139    
1140  $(LIBRARY): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DEPS) Makefile Makefile.in  $(LIBRARY): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
1141          rm -f $@          rm -f $@
1142  ifneq (,$(GNU_LD)$(filter-out OS2 WINNT WINCE, $(OS_ARCH)))  ifneq (,$(GNU_LD)$(filter-out OS2 WINNT WINCE, $(OS_ARCH)))
1143  ifdef SHARED_LIBRARY_LIBS  ifdef SHARED_LIBRARY_LIBS
# Line 1072  Line 1156 
1156  ifeq ($(OS_ARCH),OS2)  ifeq ($(OS_ARCH),OS2)
1157  $(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)  $(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)
1158          rm -f $@          rm -f $@
1159          echo LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@          echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
1160          echo PROTMODE >> $@          echo PROTMODE >> $@
1161          echo CODE    LOADONCALL MOVEABLE DISCARDABLE >> $@          echo CODE    LOADONCALL MOVEABLE DISCARDABLE >> $@
1162          echo DATA    PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@          echo DATA    PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
# Line 1127  Line 1211 
1211  # symlinks back to the originals. The symlinks are a no-op for stabs debugging,  # symlinks back to the originals. The symlinks are a no-op for stabs debugging,
1212  # so no need to conditionalize on OS version or debugging format.  # so no need to conditionalize on OS version or debugging format.
1213    
1214  $(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(DEF_FILE) $(RESFILE) $(SHARED_LIBRARY_LIBS) $(EXTRA_DEPS) $(DSO_LDOPTS_DEPS) Makefile Makefile.in  $(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(DEF_FILE) $(RESFILE) $(SHARED_LIBRARY_LIBS) $(EXTRA_DEPS) $(DSO_LDOPTS_DEPS) $(GLOBAL_DEPS)
1215  ifndef INCREMENTAL_LINKER  ifndef INCREMENTAL_LINKER
1216          rm -f $@          rm -f $@
1217  endif  endif
# Line 1211  Line 1295 
1295    
1296  ifdef MOZ_AUTO_DEPS  ifdef MOZ_AUTO_DEPS
1297  ifdef COMPILER_DEPEND  ifdef COMPILER_DEPEND
1298  ifeq (__SunOS,$(GNU_CC)_$(GNU_CXX)_$(OS_ARCH))  ifeq ($(SOLARIS_SUNPRO_CC),1)
1299  _MDDEPFILE = $(MDDEPDIR)/$(@F).pp  _MDDEPFILE = $(MDDEPDIR)/$(@F).pp
1300    
1301  define MAKE_DEPS_AUTO_CC  define MAKE_DEPS_AUTO_CC
# Line 1254  Line 1338 
1338  endif  endif
1339    
1340  # Rules for building native targets must come first because of the host_ prefix  # Rules for building native targets must come first because of the host_ prefix
1341  host_%.$(OBJ_SUFFIX): %.c Makefile Makefile.in  host_%.$(OBJ_SUFFIX): %.c $(GLOBAL_DEPS)
1342          $(REPORT_BUILD)          $(REPORT_BUILD)
1343          $(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)          $(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
1344    
1345  host_%.$(OBJ_SUFFIX): %.cpp Makefile Makefile.in  host_%.$(OBJ_SUFFIX): %.cpp $(GLOBAL_DEPS)
1346          $(REPORT_BUILD)          $(REPORT_BUILD)
1347          $(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)          $(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
1348    
1349  host_%.$(OBJ_SUFFIX): %.cc Makefile Makefile.in  host_%.$(OBJ_SUFFIX): %.cc $(GLOBAL_DEPS)
1350          $(REPORT_BUILD)          $(REPORT_BUILD)
1351          $(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)          $(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
1352    
1353  host_%.$(OBJ_SUFFIX): %.m Makefile Makefile.in  host_%.$(OBJ_SUFFIX): %.m $(GLOBAL_DEPS)
1354          $(REPORT_BUILD)          $(REPORT_BUILD)
1355          $(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(HOST_CMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)          $(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(HOST_CMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
1356    
1357  host_%.$(OBJ_SUFFIX): %.mm Makefile Makefile.in  host_%.$(OBJ_SUFFIX): %.mm $(GLOBAL_DEPS)
1358          $(REPORT_BUILD)          $(REPORT_BUILD)
1359          $(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)          $(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
1360    
1361  %: %.c Makefile Makefile.in  %:: %.c $(GLOBAL_DEPS)
1362          $(REPORT_BUILD)          $(REPORT_BUILD)
1363          @$(MAKE_DEPS_AUTO_CC)          @$(MAKE_DEPS_AUTO_CC)
1364          $(ELOG) $(CC) $(CFLAGS) $(LDFLAGS) $(OUTOPTION)$@ $(_VPATH_SRCS)          $(ELOG) $(CC) $(CFLAGS) $(LDFLAGS) $(OUTOPTION)$@ $(_VPATH_SRCS)
1365    
1366  %.$(OBJ_SUFFIX): %.c Makefile Makefile.in  %.$(OBJ_SUFFIX): %.c $(GLOBAL_DEPS)
1367          $(REPORT_BUILD)          $(REPORT_BUILD)
1368          @$(MAKE_DEPS_AUTO_CC)          @$(MAKE_DEPS_AUTO_CC)
1369          $(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(_VPATH_SRCS)          $(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(_VPATH_SRCS)
1370    
1371  moc_%.cpp: %.h Makefile Makefile.in  moc_%.cpp: %.h $(GLOBAL_DEPS)
1372          $(MOC) $< $(OUTOPTION)$@          $(MOC) $< $(OUTOPTION)$@
1373    
1374  ifdef ASFILES  ifdef ASFILES
1375  # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept  # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
1376  # a '-c' flag.  # a '-c' flag.
1377  %.$(OBJ_SUFFIX): %.$(ASM_SUFFIX) Makefile Makefile.in  %.$(OBJ_SUFFIX): %.$(ASM_SUFFIX) $(GLOBAL_DEPS)
1378          $(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) $(_VPATH_SRCS)          $(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) $(_VPATH_SRCS)
1379  endif  endif
1380    
1381  %.$(OBJ_SUFFIX): %.S Makefile Makefile.in  %.$(OBJ_SUFFIX): %.S $(GLOBAL_DEPS)
1382          $(AS) -o $@ $(ASFLAGS) -c $<          $(AS) -o $@ $(ASFLAGS) -c $<
1383    
1384  %: %.cpp Makefile Makefile.in  %:: %.cpp $(GLOBAL_DEPS)
1385          @$(MAKE_DEPS_AUTO_CXX)          @$(MAKE_DEPS_AUTO_CXX)
1386          $(CCC) $(OUTOPTION)$@ $(CXXFLAGS) $(_VPATH_SRCS) $(LDFLAGS)          $(CCC) $(OUTOPTION)$@ $(CXXFLAGS) $(_VPATH_SRCS) $(LDFLAGS)
1387    
1388  #  #
1389  # Please keep the next two rules in sync.  # Please keep the next two rules in sync.
1390  #  #
1391  %.$(OBJ_SUFFIX): %.cc Makefile Makefile.in  %.$(OBJ_SUFFIX): %.cc $(GLOBAL_DEPS)
1392          $(REPORT_BUILD)          $(REPORT_BUILD)
1393          @$(MAKE_DEPS_AUTO_CXX)          @$(MAKE_DEPS_AUTO_CXX)
1394          $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)          $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
1395    
1396  %.$(OBJ_SUFFIX): %.cpp Makefile Makefile.in  %.$(OBJ_SUFFIX): %.cpp $(GLOBAL_DEPS)
1397          $(REPORT_BUILD)          $(REPORT_BUILD)
1398          @$(MAKE_DEPS_AUTO_CXX)          @$(MAKE_DEPS_AUTO_CXX)
1399  ifdef STRICT_CPLUSPLUS_SUFFIX  ifdef STRICT_CPLUSPLUS_SUFFIX
# Line 1320  Line 1404 
1404          $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)          $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
1405  endif #STRICT_CPLUSPLUS_SUFFIX  endif #STRICT_CPLUSPLUS_SUFFIX
1406    
1407  $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.mm Makefile Makefile.in  $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.mm $(GLOBAL_DEPS)
1408          $(REPORT_BUILD)          $(REPORT_BUILD)
1409          @$(MAKE_DEPS_AUTO_CXX)          @$(MAKE_DEPS_AUTO_CXX)
1410          $(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(_VPATH_SRCS)          $(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(_VPATH_SRCS)
1411    
1412  $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.m Makefile Makefile.in  $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.m $(GLOBAL_DEPS)
1413          $(REPORT_BUILD)          $(REPORT_BUILD)
1414          @$(MAKE_DEPS_AUTO_CC)          @$(MAKE_DEPS_AUTO_CC)
1415          $(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $(_VPATH_SRCS)          $(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $(_VPATH_SRCS)
# Line 1364  Line 1448 
1448  endif  endif
1449    
1450  # need 3 separate lines for OS/2  # need 3 separate lines for OS/2
1451  %: %.pl  %:: %.pl
1452          rm -f $@          rm -f $@
1453          cp $< $@          cp $< $@
1454          chmod +x $@          chmod +x $@
1455    
1456  %: %.sh  %:: %.sh
1457          rm -f $@; cp $< $@; chmod +x $@          rm -f $@; cp $< $@; chmod +x $@
1458    
1459  # Cancel these implicit rules  # Cancel these implicit rules
# Line 1408  Line 1492 
1492  #  on it, then merge with the rest of the path.  #  on it, then merge with the rest of the path.
1493  root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\1|")  root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\1|")
1494  non-root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\2|")  non-root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\2|")
1495  normalizepath = $(foreach p,$(1),$(if $(filter /%,$(1)),$(shell cd $(call root-path,$(1)) && pwd -W)$(call non-root-path,$(1)),$(1)))  normalizepath = $(foreach p,$(1),$(if $(filter /%,$(1)),$(patsubst %/,%,$(shell cd $(call root-path,$(1)) && pwd -W))/$(call non-root-path,$(1)),$(1)))
1496  endif  endif
1497  else  else
1498  normalizepath = $(1)  normalizepath = $(1)
# Line 1433  Line 1517 
1517  $(_JAVA_DIR)::  $(_JAVA_DIR)::
1518          $(NSINSTALL) -D $@          $(NSINSTALL) -D $@
1519    
1520  $(_JAVA_DIR)/%.class: %.java Makefile Makefile.in $(_JAVA_DIR)  $(_JAVA_DIR)/%.class: %.java $(GLOBAL_DEPS) $(_JAVA_DIR)
1521          $(CYGWIN_WRAPPER) $(JAVAC) $(JAVAC_FLAGS) -classpath $(_JAVA_CLASSPATH) \          $(CYGWIN_WRAPPER) $(JAVAC) $(JAVAC_FLAGS) -classpath $(_JAVA_CLASSPATH) \
1522                          -sourcepath $(_JAVA_SOURCEPATH) -d $(_JAVA_DIR) $(_VPATH_SRCS)                          -sourcepath $(_JAVA_SOURCEPATH) -d $(_JAVA_DIR) $(_VPATH_SRCS)
1523    
1524  $(JAVA_LIBRARY): $(addprefix $(_JAVA_DIR)/,$(JAVA_SRCS:.java=.class)) Makefile Makefile.in  $(JAVA_LIBRARY): $(addprefix $(_JAVA_DIR)/,$(JAVA_SRCS:.java=.class)) $(GLOBAL_DEPS)
1525          $(JAR) cf $@ -C $(_JAVA_DIR) .          $(JAR) cf $@ -C $(_JAVA_DIR) .
1526    
1527  GARBAGE_DIRS += $(_JAVA_DIR)  GARBAGE_DIRS += $(_JAVA_DIR)
# Line 1473  Line 1557 
1557  ###############################################################################  ###############################################################################
1558    
1559  ################################################################################  ################################################################################
1560  # Copy each element of EXPORTS to $(PUBLIC)  # Copy each element of EXPORTS to $(DIST)/include
   
 ifneq ($(EXPORTS)$(XPIDLSRCS)$(SDK_HEADERS)$(SDK_XPIDLSRCS),)  
 $(SDK_PUBLIC) $(PUBLIC)::  
         $(NSINSTALL) -D $@  
 endif  
1561    
1562  ifdef MOZ_JAVAXPCOM  ifdef MOZ_JAVAXPCOM
1563  ifneq ($(XPIDLSRCS)$(SDK_XPIDLSRCS),)  ifneq ($(XPIDLSRCS),)
1564  $(JAVA_DIST_DIR)::  $(JAVA_DIST_DIR)::
1565          $(NSINSTALL) -D $@          $(NSINSTALL) -D $@
1566  endif  endif
# Line 1495  Line 1574 
1574  endif  endif
1575    
1576  ifndef NO_DIST_INSTALL  ifndef NO_DIST_INSTALL
1577  ifneq ($(EXPORTS),)  ifneq (,$(EXPORTS))
1578  export:: $(EXPORTS) $(PUBLIC)  export:: $(EXPORTS)
1579          $(INSTALL) $(IFLAGS1) $^          $(INSTALL) $(IFLAGS1) $^ $(DIST)/include
1580  endif  endif
1581    endif # NO_DIST_INSTALL
 ifneq ($(SDK_HEADERS),)  
 export:: $(SDK_HEADERS) $(SDK_PUBLIC)  
         $(INSTALL) $(IFLAGS1) $^  
1582    
1583  export:: $(SDK_HEADERS) $(PUBLIC)  define EXPORT_NAMESPACE_RULE
1584          $(INSTALL) $(IFLAGS1) $^  ifndef NO_DIST_INSTALL
1585  endif  export:: $(EXPORTS_$(namespace))
1586            $(INSTALL) $(IFLAGS1) $$^ $(DIST)/include/$(namespace)
1587  endif # NO_DIST_INSTALL  endif # NO_DIST_INSTALL
1588    endef
1589    
1590    $(foreach namespace,$(EXPORTS_NAMESPACES),$(eval $(EXPORT_NAMESPACE_RULE)))
1591    
1592  ################################################################################  ################################################################################
1593  # Copy each element of PREF_JS_EXPORTS  # Copy each element of PREF_JS_EXPORTS
# Line 1556  Line 1636 
1636    
1637  endif  endif
1638  ################################################################################  ################################################################################
1639  # Export the elements of $(XPIDLSRCS) & $(SDK_XPIDLSRCS),  # Export the elements of $(XPIDLSRCS)
1640  # generating .h and .xpt files and moving them to the appropriate places.  # generating .h and .xpt files and moving them to the appropriate places.
1641    
1642  ifneq ($(XPIDLSRCS)$(SDK_XPIDLSRCS),)  ifneq ($(XPIDLSRCS),)
1643    
1644  export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS))  export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS))
1645    
# Line 1576  Line 1656 
1656          @echo; sleep 2; false          @echo; sleep 2; false
1657  endif  endif
1658    
1659  $(SDK_IDL_DIR) $(IDL_DIR)::  $(IDL_DIR)::
1660          $(NSINSTALL) -D $@          $(NSINSTALL) -D $@
1661    
1662  # generate .h files from into $(XPIDL_GEN_DIR), then export to $(PUBLIC);  # generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include;
1663  # warn against overriding existing .h file.  # warn against overriding existing .h file.
1664  $(XPIDL_GEN_DIR)/.done:  $(XPIDL_GEN_DIR)/.done:
1665          @if test ! -d $(XPIDL_GEN_DIR); then echo Creating $(XPIDL_GEN_DIR)/.done; rm -rf $(XPIDL_GEN_DIR); mkdir $(XPIDL_GEN_DIR); fi          @if test ! -d $(XPIDL_GEN_DIR); then echo Creating $(XPIDL_GEN_DIR)/.done; rm -rf $(XPIDL_GEN_DIR); mkdir $(XPIDL_GEN_DIR); fi
# Line 1591  Line 1671 
1671  $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_COMPILE) $(XPIDL_GEN_DIR)/.done  $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_COMPILE) $(XPIDL_GEN_DIR)/.done
1672          $(REPORT_BUILD)          $(REPORT_BUILD)
1673          $(ELOG) $(XPIDL_COMPILE) -m header -w $(XPIDL_FLAGS) -o $(XPIDL_GEN_DIR)/$* $(_VPATH_SRCS)          $(ELOG) $(XPIDL_COMPILE) -m header -w $(XPIDL_FLAGS) -o $(XPIDL_GEN_DIR)/$* $(_VPATH_SRCS)
1674          @if test -n "$(findstring $*.h, $(EXPORTS) $(SDK_HEADERS))"; \          @if test -n "$(findstring $*.h, $(EXPORTS))"; \
1675            then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi            then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi
1676    
1677  ifndef NO_GEN_XPT  ifndef NO_GEN_XPT
# Line 1603  Line 1683 
1683    
1684  # no need to link together if XPIDLSRCS contains only XPIDL_MODULE  # no need to link together if XPIDLSRCS contains only XPIDL_MODULE
1685  ifneq ($(XPIDL_MODULE).idl,$(strip $(XPIDLSRCS)))  ifneq ($(XPIDL_MODULE).idl,$(strip $(XPIDLSRCS)))
1686  $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS) $(SDK_XPIDLSRCS)) Makefile.in Makefile $(XPIDL_LINK)  $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS)) $(GLOBAL_DEPS) $(XPIDL_LINK)
1687          $(XPIDL_LINK) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS) $(SDK_XPIDLSRCS))          $(XPIDL_LINK) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS))
1688  endif # XPIDL_MODULE.xpt != XPIDLSRCS  endif # XPIDL_MODULE.xpt != XPIDLSRCS
1689    
1690  libs:: $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt  libs:: $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt
# Line 1616  Line 1696 
1696    
1697  GARBAGE_DIRS            += $(XPIDL_GEN_DIR)  GARBAGE_DIRS            += $(XPIDL_GEN_DIR)
1698    
1699  endif # XPIDLSRCS || SDK_XPIDLSRCS  endif # XPIDLSRCS
1700    
1701  ifneq ($(XPIDLSRCS),)  ifneq ($(XPIDLSRCS),)
1702  # export .idl files to $(IDL_DIR)  # export .idl files to $(IDL_DIR)
# Line 1624  Line 1704 
1704  export:: $(XPIDLSRCS) $(IDL_DIR)  export:: $(XPIDLSRCS) $(IDL_DIR)
1705          $(INSTALL) $(IFLAGS1) $^          $(INSTALL) $(IFLAGS1) $^
1706    
1707  export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(PUBLIC)  export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(DIST)/include
1708          $(INSTALL) $(IFLAGS1) $^          $(INSTALL) $(IFLAGS1) $^
1709  endif # NO_DIST_INSTALL  endif # NO_DIST_INSTALL
1710    
# Line 1644  Line 1724 
1724    
1725  export-idl:: $(SUBMAKEFILES) $(MAKE_DIRS)  export-idl:: $(SUBMAKEFILES) $(MAKE_DIRS)
1726    
1727  ifneq ($(XPIDLSRCS)$(SDK_XPIDLSRCS),)  ifneq ($(XPIDLSRCS),)
1728  ifndef NO_DIST_INSTALL  ifndef NO_DIST_INSTALL
1729  export-idl:: $(XPIDLSRCS) $(SDK_XPIDLSRCS) $(IDL_DIR)  export-idl:: $(XPIDLSRCS) $(IDL_DIR)
1730          $(INSTALL) $(IFLAGS1) $^          $(INSTALL) $(IFLAGS1) $^
1731  endif  endif
1732  endif  endif
1733          +$(LOOP_OVER_PARALLEL_DIRS)          $(LOOP_OVER_PARALLEL_DIRS)
1734          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
1735          +$(LOOP_OVER_TOOL_DIRS)          $(LOOP_OVER_TOOL_DIRS)
   
   
   
   
 ifneq ($(SDK_XPIDLSRCS),)  
 # export .idl files to $(IDL_DIR) & $(SDK_IDL_DIR)  
 ifndef NO_DIST_INSTALL  
 export:: $(SDK_XPIDLSRCS) $(IDL_DIR)  
         $(INSTALL) $(IFLAGS1) $^  
   
 export:: $(SDK_XPIDLSRCS) $(SDK_IDL_DIR)  
         $(INSTALL) $(IFLAGS1) $^  
   
 export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(SDK_XPIDLSRCS)) $(PUBLIC)  
         $(INSTALL) $(IFLAGS1) $^  
   
 export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(SDK_XPIDLSRCS)) $(SDK_PUBLIC)  
         $(INSTALL) $(IFLAGS1) $^  
 endif  
   
 endif # SDK_XPIDLSRCS  
   
   
1736    
1737  ifdef MOZ_JAVAXPCOM  ifdef MOZ_JAVAXPCOM
1738  ifneq ($(XPIDLSRCS)$(SDK_XPIDLSRCS),)  ifneq ($(XPIDLSRCS),)
1739    
1740  JAVA_XPIDLSRCS = $(XPIDLSRCS) $(SDK_XPIDLSRCS)  JAVA_XPIDLSRCS = $(XPIDLSRCS)
1741    
1742  # A single IDL file can contain multiple interfaces, which result in multiple  # A single IDL file can contain multiple interfaces, which result in multiple
1743  # Java interface files.  So use hidden dependency files.  # Java interface files.  So use hidden dependency files.
# Line 1714  Line 1771 
1771  export:: $(JAVA_DIST_DIR) $(JAVADEPFILES) $(JAVA_INSTALL_DIR)  export:: $(JAVA_DIST_DIR) $(JAVADEPFILES) $(JAVA_INSTALL_DIR)
1772          (cd $(JAVA_GEN_DIR) && tar $(TAR_CREATE_FLAGS) - .) | (cd $(JAVA_INSTALL_DIR) && tar -xf -)          (cd $(JAVA_GEN_DIR) && tar $(TAR_CREATE_FLAGS) - .) | (cd $(JAVA_INSTALL_DIR) && tar -xf -)
1773    
1774  endif # XPIDLSRCS || SDK_XPIDLSRCS  endif # XPIDLSRCS
1775  endif # MOZ_JAVAXPCOM  endif # MOZ_JAVAXPCOM
1776    
1777  ################################################################################  ################################################################################
# Line 1723  Line 1780 
1780  libs:: $(EXTRA_COMPONENTS)  libs:: $(EXTRA_COMPONENTS)
1781  ifndef NO_DIST_INSTALL  ifndef NO_DIST_INSTALL
1782          $(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/components          $(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/components
1783            @$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_TARGET)/components/components.list $(notdir $^)
1784  endif  endif
1785    
1786  endif  endif
# Line 1733  Line 1791 
1791          $(EXIT_ON_ERROR) \          $(EXIT_ON_ERROR) \
1792          $(NSINSTALL) -D $(FINAL_TARGET)/components; \          $(NSINSTALL) -D $(FINAL_TARGET)/components; \
1793          for i in $^; do \          for i in $^; do \
1794            dest=$(FINAL_TARGET)/components/`basename $$i`; \            fname=`basename $$i`; \
1795              dest=$(FINAL_TARGET)/components/$${fname}; \
1796            $(RM) -f $$dest; \            $(RM) -f $$dest; \
1797            $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \            $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
1798              $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_TARGET)/components/components.list $$fname; \
1799          done          done
1800  endif  endif
1801    
# Line 1797  Line 1857 
1857    
1858  chrome::  chrome::
1859          $(MAKE) realchrome          $(MAKE) realchrome
1860          +$(LOOP_OVER_PARALLEL_DIRS)          $(LOOP_OVER_PARALLEL_DIRS)
1861          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
1862          +$(LOOP_OVER_TOOL_DIRS)          $(LOOP_OVER_TOOL_DIRS)
1863    
1864  $(FINAL_TARGET)/chrome:  $(FINAL_TARGET)/chrome:
1865          $(NSINSTALL) -D $@          $(NSINSTALL) -D $@
1866    
1867  # libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome  ifneq (,$(wildcard $(JAR_MANIFEST)))
1868  # ifndef NO_DIST_INSTALL  ifndef NO_DIST_INSTALL
1869  #       @$(EXIT_ON_ERROR) \  libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
1870  #       if test -f $(JAR_MANIFEST); then \          $(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
1871  #         $(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \            $(QUIET) -j $(FINAL_TARGET)/chrome \
1872  #           $(QUIET) -j $(FINAL_TARGET)/chrome \            $(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
1873  #           $(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \            $(JAR_MANIFEST)
1874  #           $(JAR_MANIFEST); \  endif
1875  #       fi  endif
 # endif  
1876    
1877  ifneq ($(DIST_FILES),)  ifneq ($(DIST_FILES),)
1878  libs:: $(DIST_FILES)  $(DIST)/bin:
1879            $(NSINSTALL) -D $@
1880    
1881    libs:: $(DIST_FILES) $(DIST)/bin
1882          @$(EXIT_ON_ERROR) \          @$(EXIT_ON_ERROR) \
1883          for f in $(DIST_FILES); do \          for f in $(DIST_FILES); do \
1884            dest=$(FINAL_TARGET)/`basename $$f`; \            dest=$(FINAL_TARGET)/`basename $$f`; \
# Line 1903  Line 1965 
1965          $(_JAR_REGCHROME_DISABLE_JAR)          $(_JAR_REGCHROME_DISABLE_JAR)
1966    
1967    
 ################################################################################  
 # Testing frameworks support  
 ################################################################################  
   
 ifdef ENABLE_TESTS  
   
 ifdef XPCSHELL_TESTS  
 ifndef MODULE  
 $(error Must define MODULE when defining XPCSHELL_TESTS.)  
 endif  
   
 # Test file installation  
 libs::  
         @$(EXIT_ON_ERROR) \  
         for testdir in $(XPCSHELL_TESTS); do \  
           $(INSTALL) \  
             $(srcdir)/$$testdir/*.js \  
             $(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir; \  
         done  
   
 # Path formats on Windows are hard.  We require a topsrcdir formatted so that  
 # it may be passed to nsILocalFile.initWithPath (in other words, an absolute  
 # path of the form X:\path\to\topsrcdir), which we store in NATIVE_TOPSRCDIR.  
 # We require a forward-slashed path to topsrcdir so that it may be combined  
 # with a relative forward-slashed path for loading scripts, both dynamically  
 # and statically for head/test/tail JS files.  Of course, on non-Windows none  
 # of this matters, and things will work correctly because everything's  
 # forward-slashed, everywhere, always.  
 ifdef CYGWIN_WRAPPER  
 NATIVE_TOPSRCDIR   := `cygpath -wa $(topsrcdir)`  
 FWDSLASH_TOPSRCDIR := `cygpath -ma $(topsrcdir)`  
 else  
 FWDSLASH_TOPSRCDIR := $(topsrcdir)  
 ifeq ($(HOST_OS_ARCH),WINNT)  
 NATIVE_TOPSRCDIR   := $(subst /,\\,$(WIN_TOP_SRC))  
 else  
 NATIVE_TOPSRCDIR   := $(topsrcdir)  
 endif  
 endif # CYGWIN_WRAPPER  
   
 # Test execution  
 check::  
         @$(EXIT_ON_ERROR) \  
         for testdir in $(XPCSHELL_TESTS); do \  
           $(RUN_TEST_PROGRAM) \  
             $(topsrcdir)/tools/test-harness/xpcshell-simple/test_all.sh \  
               $(DIST)/bin/xpcshell \  
               $(FWDSLASH_TOPSRCDIR) \  
               $(NATIVE_TOPSRCDIR) \  
               $(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir; \  
         done  
   
 # Test execution  
 check-interactive::  
         @$(EXIT_ON_ERROR) \  
         $(RUN_TEST_PROGRAM) \  
           $(topsrcdir)/tools/test-harness/xpcshell-simple/test_one.sh \  
             $(DIST)/bin/xpcshell \  
             $(FWDSLASH_TOPSRCDIR) \  
             $(NATIVE_TOPSRCDIR) \  
             $(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \  
             $(SOLO_FILE) 1;  
   
 # Test execution  
 check-one::  
         @$(EXIT_ON_ERROR) \  
         $(RUN_TEST_PROGRAM) \  
           $(topsrcdir)/tools/test-harness/xpcshell-simple/test_one.sh \  
             $(DIST)/bin/xpcshell \  
             $(FWDSLASH_TOPSRCDIR) \  
             $(NATIVE_TOPSRCDIR) \  
             $(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \  
             $(SOLO_FILE) 0;  
   
 endif # XPCSHELL_TESTS  
   
 endif # ENABLE_TESTS  
   
   
1968  #############################################################################  #############################################################################
1969  # Dependency system  # Dependency system
1970  #############################################################################  #############################################################################
# Line 2021  Line 2004 
2004          $(REPORT_BUILD)          $(REPORT_BUILD)
2005          @$(MAKE_DEPS_NOAUTO)          @$(MAKE_DEPS_NOAUTO)
2006    
2007  ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS))  ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS))
2008  depend:: $(SUBMAKEFILES) $(MAKE_DIRS) $(MDDEPFILES)  depend:: $(SUBMAKEFILES) $(MAKE_DIRS) $(MDDEPFILES)
2009  else  else
2010  depend:: $(SUBMAKEFILES)  depend:: $(SUBMAKEFILES)
2011  endif  endif
2012          +$(LOOP_OVER_PARALLEL_DIRS)          $(LOOP_OVER_PARALLEL_DIRS)
2013          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
2014          +$(LOOP_OVER_TOOL_DIRS)          $(LOOP_OVER_TOOL_DIRS)
2015    
2016  dependclean:: $(SUBMAKEFILES)  dependclean:: $(SUBMAKEFILES)
2017          rm -f $(MDDEPFILES)          rm -f $(MDDEPFILES)
2018          +$(LOOP_OVER_PARALLEL_DIRS)          $(LOOP_OVER_PARALLEL_DIRS)
2019          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
2020          +$(LOOP_OVER_TOOL_DIRS)          $(LOOP_OVER_TOOL_DIRS)
2021    
2022  endif # MOZ_AUTO_DEPS  endif # MOZ_AUTO_DEPS
2023    
# Line 2057  Line 2040 
2040          @if test ! -d $@; then echo Creating $@; rm -rf $@; mkdir $@; else true; fi          @if test ! -d $@; then echo Creating $@; rm -rf $@; mkdir $@; else true; fi
2041    
2042  ifneq (,$(filter-out all chrome default export realchrome tools clean clobber clobber_all distclean realclean,$(MAKECMDGOALS)))  ifneq (,$(filter-out all chrome default export realchrome tools clean clobber clobber_all distclean realclean,$(MAKECMDGOALS)))
2043  ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS))  ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS))
2044  MDDEPEND_FILES          := $(strip $(wildcard $(MDDEPDIR)/*.pp))  MDDEPEND_FILES          := $(strip $(wildcard $(MDDEPDIR)/*.pp))
2045    
2046  ifneq (,$(MDDEPEND_FILES))  ifneq (,$(MDDEPEND_FILES))
# Line 2125  Line 2108 
2108  # Fake targets.  Always run these rules, even if a file/directory with that  # Fake targets.  Always run these rules, even if a file/directory with that
2109  # name already exists.  # name already exists.
2110  #  #
2111  .PHONY: all all_platforms alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_viewer run_apprunner tools $(DIRS) $(TOOL_DIRS) FORCE check check-interactive check-one  .PHONY: all alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_apprunner tools $(DIRS) $(TOOL_DIRS) FORCE
2112    
2113  # Used as a dependency to force targets to rebuild  # Used as a dependency to force targets to rebuild
2114  FORCE:  FORCE:
# Line 2140  Line 2123 
2123    
2124  TAGS: $(SUBMAKEFILES) $(CSRCS) $(CPPSRCS) $(wildcard *.h)  TAGS: $(SUBMAKEFILES) $(CSRCS) $(CPPSRCS) $(wildcard *.h)
2125          -etags $(CSRCS) $(CPPSRCS) $(wildcard *.h)          -etags $(CSRCS) $(CPPSRCS) $(wildcard *.h)
2126          +$(LOOP_OVER_PARALLEL_DIRS)          $(LOOP_OVER_PARALLEL_DIRS)
2127          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
2128    
2129  echo-variable-%:  echo-variable-%:
2130          @echo $($*)          @echo "$($*)"
2131    
2132  echo-tiers:  echo-tiers:
2133          @echo $(TIERS)          @echo $(TIERS)
2134    
2135    echo-tier-dirs:
2136            @$(foreach tier,$(TIERS),echo '$(tier):'; echo '  dirs: $(tier_$(tier)_dirs)'; echo '  staticdirs: $(tier_$(tier)_staticdirs)'; )
2137    
2138  echo-dirs:  echo-dirs:
2139          @echo $(DIRS)          @echo $(DIRS)
2140    
# Line 2164  Line 2150 
2150  else  else
2151          @$(if $(REQUIRES),echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES))          @$(if $(REQUIRES),echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES))
2152  endif  endif
2153          +$(LOOP_OVER_PARALLEL_DIRS)          $(LOOP_OVER_PARALLEL_DIRS)
2154          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
2155    
2156  echo-depth-path:  echo-depth-path:
2157          @$(topsrcdir)/build/unix/print-depth-path.sh          @$(topsrcdir)/build/unix/print-depth-path.sh
# Line 2194  Line 2180 
2180          @echo "DEPENDENT_LIBS      = $(DEPENDENT_LIBS)"          @echo "DEPENDENT_LIBS      = $(DEPENDENT_LIBS)"
2181          @echo --------------------------------------------------------------------------------          @echo --------------------------------------------------------------------------------
2182  endif  endif
2183          +$(LOOP_OVER_PARALLEL_DIRS)          $(LOOP_OVER_PARALLEL_DIRS)
2184          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
2185    
2186  showbuild:  showbuild:
2187          @echo "MOZ_BUILD_ROOT     = $(MOZ_BUILD_ROOT)"          @echo "MOZ_BUILD_ROOT     = $(MOZ_BUILD_ROOT)"
# Line 2252  Line 2238 
2238          @echo "Build Modules    = $(BUILD_MODULES)"          @echo "Build Modules    = $(BUILD_MODULES)"
2239          @echo "Module dirs      = $(BUILD_MODULE_DIRS)"          @echo "Module dirs      = $(BUILD_MODULE_DIRS)"
2240    
 zipmakes:  
 ifneq (,$(filter $(PROGRAM) $(SIMPLE_PROGRAMS) $(LIBRARY) $(SHARED_LIBRARY),$(TARGETS)))  
         zip $(DEPTH)/makefiles $(subst $(topsrcdir),$(MOZ_SRC)/mozilla,$(srcdir)/Makefile.in)  
 endif  
         +$(LOOP_OVER_PARALLEL_DIRS)  
         +$(LOOP_OVER_DIRS)  
   
2241  documentation:  documentation:
2242          @cd $(DEPTH)          @cd $(DEPTH)
2243          $(DOXYGEN) $(DEPTH)/config/doxygen.cfg          $(DOXYGEN) $(DEPTH)/config/doxygen.cfg
2244    
2245    ifdef ENABLE_TESTS
2246  check:: $(SUBMAKEFILES) $(MAKE_DIRS)  check:: $(SUBMAKEFILES) $(MAKE_DIRS)
2247          +$(LOOP_OVER_PARALLEL_DIRS)          $(LOOP_OVER_PARALLEL_DIRS)
2248          +$(LOOP_OVER_DIRS)          $(LOOP_OVER_DIRS)
2249          +$(LOOP_OVER_TOOL_DIRS)          $(LOOP_OVER_TOOL_DIRS)
2250    endif
2251    
2252    
2253    FREEZE_VARIABLES = \
2254      CSRCS \
2255      CPPSRCS \
2256      EXPORTS \
2257      XPIDLSRCS \
2258      DIRS \
2259      LIBRARY \
2260      MODULE \
2261      REQUIRES \
2262      SHORT_LIBNAME \
2263      TIERS \
2264      $(NULL)
2265    
2266    $(foreach var,$(FREEZE_VARIABLES),$(eval $(var)_FROZEN := '$($(var))'))
2267    
2268    CHECK_FROZEN_VARIABLES = $(foreach var,$(FREEZE_VARIABLES), \
2269      $(if $(subst $($(var)_FROZEN),,'$($(var))'),$(error Makefile variable '$(var)' changed value after including rules.mk. Was $($(var)_FROZEN), now $($(var)).)))
2270    
2271    libs export libs::
2272            $(CHECK_FROZEN_VARIABLES)

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

  ViewVC Help
Powered by ViewVC 1.1.24