2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Original Code is mozilla.org code.
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1998
20 # the Initial Developer. All Rights Reserved.
23 # Benjamin Smedberg <benjamin@smedbergs.us>
25 # Alternatively, the contents of this file may be used under the terms of
26 # either of the GNU General Public License Version 2 or later (the "GPL"),
27 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
42 # Determines the platform and builds the macros needed to load the
43 # appropriate platform-specific .mk file, then defines all (most?)
44 # of the generic macros.
47 # Define an include-at-most-once flag
48 INCLUDED_CONFIG_MK
= 1
50 EXIT_ON_ERROR
= set
-e
; # Shell loops continue past errors without this.
56 ifndef INCLUDED_AUTOCONF_MK
57 include $(DEPTH
)/config
/autoconf.mk
59 ifndef INCLUDED_INSURE_MK
61 include $(topsrcdir
)/config
/insure.mk
67 # Sanity check some variables
75 INSTALL_EXTENSION_ID \
80 # checks for internal spaces or trailing spaces in the variable
82 check-variable
= $(if
$(filter-out 0 1,$(words $($(x
))z
)),$(error Spaces are not allowed in
$(x
)))
84 $(foreach x
,$(CHECK_VARS
),$(check-variable
))
86 core_abspath
= $(if
$(findstring :,$(1)),$(1),$(if
$(filter /%,$(1)),$(1),$(CURDIR
)/$(1)))
88 # FINAL_TARGET specifies the location into which we copy end-user-shipped
89 # build products (typelibs, components, chrome).
91 # It will usually be the well-loved $(DIST)/bin, today, but can also be an
92 # XPI-contents staging directory for ambitious and right-thinking extensions.
93 FINAL_TARGET
= $(if
$(XPI_NAME
),$(DIST
)/xpi-stage
/$(XPI_NAME
),$(DIST
)/bin
)
95 # MAKE_JARS_TARGET is a staging area for make-jars.pl. When packaging in
96 # the jar format, make-jars leaves behind a directory structure that's not
97 # needed in $(FINAL_TARGET). For both, flat, and symlink, the directory
98 # structure contains the chrome, so leave it in $(FINAL_TARGET).
99 ifeq (jar
,$(MOZ_CHROME_FILE_FORMAT
))
100 MAKE_JARS_TARGET
= $(if
$(XPI_NAME
),$(FINAL_TARGET
).stage
,$(DIST
)/chrome-stage
)
102 MAKE_JARS_TARGET
= $(FINAL_TARGET
)
105 # The VERSION_NUMBER is suffixed onto the end of the DLLs we ship.
108 ifeq ($(HOST_OS_ARCH
),WINNT
)
109 win_srcdir
:= $(subst $(topsrcdir
),$(WIN_TOP_SRC
),$(srcdir))
110 BUILD_TOOLS
= $(WIN_TOP_SRC
)/build
/unix
112 win_srcdir
:= $(srcdir)
113 BUILD_TOOLS
= $(topsrcdir
)/build
/unix
116 CONFIG_TOOLS
= $(MOZ_BUILD_ROOT
)/config
117 AUTOCONF_TOOLS
= $(topsrcdir
)/build
/autoconf
119 ifeq ($(OS_ARCH
),QNX
)
120 ifeq ($(OS_TARGET
),NTO
)
121 LD
:= qcc
-Vgcc_ntox86
-nostdlib
126 ifeq ($(OS_ARCH
),BeOS
)
127 BEOS_ADDON_WORKAROUND
= 1
131 # Strip off the excessively long version numbers on these platforms,
132 # but save the version to allow multiple versions of the same base
133 # platform to be built in the same tree.
135 ifneq (,$(filter FreeBSD HP-UX IRIX Linux NetBSD OpenBSD OSF1 SunOS
,$(OS_ARCH
)))
136 OS_RELEASE
:= $(basename $(OS_RELEASE
))
138 # Allow the user to ignore the OS_VERSION, which is usually irrelevant.
139 ifdef WANT_MOZILLA_CONFIG_OS_VERSION
140 OS_VERS
:= $(suffix $(OS_RELEASE
))
141 OS_VERSION
:= $(shell echo
$(OS_VERS
) | sed
's/-.*//')
146 OS_CONFIG
:= $(OS_ARCH
)$(OS_RELEASE
)
148 FINAL_LINK_LIBS
= $(DEPTH
)/config
/final-link-libs
149 FINAL_LINK_COMPS
= $(DEPTH
)/config
/final-link-comps
150 FINAL_LINK_COMP_NAMES
= $(DEPTH
)/config
/final-link-comp-names
152 MOZ_UNICHARUTIL_LIBS
= $(LIBXUL_DIST
)/lib
/$(LIB_PREFIX
)unicharutil_s.
$(LIB_SUFFIX
)
153 MOZ_WIDGET_SUPPORT_LIBS
= $(DIST
)/lib
/$(LIB_PREFIX
)widgetsupport_s.
$(LIB_SUFFIX
)
156 ifneq (,$(filter-out WINNT WINCE
,$(OS_ARCH
)))
157 JEMALLOC_LIBS
= $(MKSHLIB_FORCE_ALL
) $(call EXPAND_MOZLIBNAME
,jemalloc
) $(MKSHLIB_UNFORCE_ALL
)
161 # determine debug-related options
166 _DEBUG_CFLAGS
+= $(MOZ_DEBUG_ENABLE_DEFS
) $(MOZ_DEBUG_FLAGS
)
167 _DEBUG_LDFLAGS
+= $(MOZ_DEBUG_LDFLAGS
)
168 XULPPFLAGS
+= $(MOZ_DEBUG_ENABLE_DEFS
)
170 _DEBUG_CFLAGS
+= $(MOZ_DEBUG_DISABLE_DEFS
)
171 XULPPFLAGS
+= $(MOZ_DEBUG_DISABLE_DEFS
)
172 ifdef MOZ_DEBUG_SYMBOLS
173 _DEBUG_CFLAGS
+= $(MOZ_DEBUG_FLAGS
)
174 _DEBUG_LDFLAGS
+= $(MOZ_DEBUG_LDFLAGS
)
178 MOZALLOC_LIB
= $(call EXPAND_MOZLIBNAME
,mozalloc
)
180 OS_CFLAGS
+= $(_DEBUG_CFLAGS
)
181 OS_CXXFLAGS
+= $(_DEBUG_CFLAGS
)
182 OS_LDFLAGS
+= $(_DEBUG_LDFLAGS
)
184 # XXX: What does this? Bug 482434 filed for better explanation.
185 ifeq ($(OS_ARCH
)_
$(GNU_CC
),WINNT_
)
187 ifneq (,$(MOZ_BROWSE_INFO
)$(MOZ_BSCFILE
))
193 # We don't build a static CRT when building a custom CRT,
194 # it appears to be broken. So don't link to jemalloc if
195 # the Makefile wants static CRT linking.
196 ifeq ($(MOZ_MEMORY
)_
$(USE_STATIC_LIBS
),1_
)
197 # Disable default CRT libs and add the right lib path for the linker
198 OS_LDFLAGS
+= $(MOZ_MEMORY_LDFLAGS
)
201 # MOZ_DEBUG_SYMBOLS generates debug symbols in separate PDB files.
202 # Used for generating an optimized build with debugging symbols.
203 # Used in the Windows nightlies to generate symbols for crash reporting.
204 ifdef MOZ_DEBUG_SYMBOLS
205 OS_CXXFLAGS
+= -Zi
-UDEBUG
-DNDEBUG
206 OS_CFLAGS
+= -Zi
-UDEBUG
-DNDEBUG
207 OS_LDFLAGS
+= -DEBUG
-OPT
:REF
211 # -FIXED:NO is needed for Quantify to work, but it increases the size
212 # of executables, so only use it if building for Quantify.
213 WIN32_EXE_LDFLAGS
+= -FIXED
:NO
215 # We need -OPT:NOICF to prevent identical methods from being merged together.
216 # Otherwise, Quantify doesn't know which method was actually called when it's
217 # showing you the profile.
218 OS_LDFLAGS
+= -OPT
:NOICF
222 # Handle trace-malloc in optimized builds.
223 # No opt to give sane callstacks.
225 ifdef NS_TRACE_MALLOC
226 MOZ_OPTIMIZE_FLAGS
=-Zi
-Od
-UDEBUG
-DNDEBUG
227 OS_LDFLAGS
= -DEBUG
-PDB
:NONE
-OPT
:REF
-OPT
:nowin98
228 endif # NS_TRACE_MALLOC
231 endif # WINNT && !GNU_CC
234 # Build using PIC by default
235 # Do not use PIC if not building a shared lib (see exceptions below)
238 ifndef BUILD_STATIC_LIBS
241 ifneq (,$(FORCE_SHARED_LIB
)$(FORCE_USE_PIC
))
245 # In Firefox, all components are linked into either libxul or the static
246 # meta-component, and should be compiled with PIC.
247 ifdef MOZ_META_COMPONENT
251 # If module is going to be merged into the nsStaticModule,
252 # make sure that the entry points are translated and
253 # the module is built static.
257 ifneq (,$(BUILD_STATIC_LIBS
))
259 DEFINES
+= -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT
=1
266 # Determine if module being compiled is destined
267 # to be merged into libxul
269 ifdef MOZ_ENABLE_LIBXUL
273 DEFINES
+= -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT
=1
275 $(error Component makefile does not specify MODULE_NAME.
)
284 # If we are building this component into an extension/xulapp, it cannot be
285 # statically linked. In the future we may want to add a xulapp meta-component
298 # Disable PIC if necessary
303 ifeq ($(OS_ARCH
)_
$(HAVE_GCC3_ABI
),Darwin_1
)
304 DSO_PIC_CFLAGS
=-mdynamic-no-pic
310 ifndef SHARED_LIBRARY_NAME
312 SHARED_LIBRARY_NAME
=$(LIBRARY_NAME
)
316 ifndef STATIC_LIBRARY_NAME
318 STATIC_LIBRARY_NAME
=$(LIBRARY_NAME
)
322 # This comes from configure
323 ifdef MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE
324 NO_PROFILE_GUIDED_OPTIMIZE
= 1
327 # Enable profile-based feedback
328 ifndef NO_PROFILE_GUIDED_OPTIMIZE
329 ifdef MOZ_PROFILE_GENERATE
330 # No sense in profiling tools
331 ifndef INTERNAL_TOOLS
332 OS_CFLAGS
+= $(PROFILE_GEN_CFLAGS
)
333 OS_CXXFLAGS
+= $(PROFILE_GEN_CFLAGS
)
334 OS_LDFLAGS
+= $(PROFILE_GEN_LDFLAGS
)
335 ifeq (WINNT
,$(OS_ARCH
))
338 endif # INTERNAL_TOOLS
339 endif # MOZ_PROFILE_GENERATE
341 ifdef MOZ_PROFILE_USE
342 ifndef INTERNAL_TOOLS
343 OS_CFLAGS
+= $(PROFILE_USE_CFLAGS
)
344 OS_CXXFLAGS
+= $(PROFILE_USE_CFLAGS
)
345 OS_LDFLAGS
+= $(PROFILE_USE_LDFLAGS
)
346 ifeq (WINNT
,$(OS_ARCH
))
349 endif # INTERNAL_TOOLS
350 endif # MOZ_PROFILE_USE
351 endif # NO_PROFILE_GUIDED_OPTIMIZE
354 # Does the makefile specifies the internal XPCOM API linkage?
355 ifneq (,$(MOZILLA_INTERNAL_API
)$(LIBXUL_LIBRARY
))
356 DEFINES
+= -DMOZILLA_INTERNAL_API
359 # Force XPCOM/widget/gfx methods to be _declspec(dllexport) when we're
360 # building libxul libraries
361 ifdef MOZ_ENABLE_LIBXUL
374 ifndef MOZ_NATIVE_ZLIB
375 DEFINES
+= -DZLIB_INTERNAL
380 # Force _all_ exported methods to be |_declspec(dllexport)| when we're
381 # building them into the executable.
383 ifeq (,$(filter-out WINNT WINCE OS2
, $(OS_ARCH
)))
384 ifdef BUILD_STATIC_LIBS
387 -D_IMPL_NS_MSG_BASE \
393 # Flags passed to make-jars.pl
397 -f
$(MOZ_CHROME_FILE_FORMAT
) \
400 ifdef USE_EXTENSION_MANIFEST
401 MAKE_JARS_FLAGS
+= -e
405 MAKE_JARS_FLAGS
+= --both-manifests
408 TAR_CREATE_FLAGS
= -cvhf
410 ifeq ($(OS_ARCH
),BSD_OS
)
411 TAR_CREATE_FLAGS
= -cvLf
414 ifeq ($(OS_ARCH
),OS2
)
415 TAR_CREATE_FLAGS
= -cvf
419 # Personal makefile customizations go in these optional make include files.
421 MY_CONFIG
:= $(DEPTH
)/config
/myconfig.mk
422 MY_RULES
:= $(DEPTH
)/config
/myrules.mk
425 # Default command macros; can be overridden in <arch>.mk.
428 NFSPWD
= $(CONFIG_TOOLS
)/nfspwd
429 PURIFY
= purify
$(PURIFYOPTIONS
)
430 QUANTIFY
= quantify
$(QUANTIFYOPTIONS
)
432 XPIDL_COMPILE
= $(CYGWIN_WRAPPER
) $(LIBXUL_DIST
)/host
/bin
/host_xpidl
$(HOST_BIN_SUFFIX
)
433 XPIDL_LINK
= $(CYGWIN_WRAPPER
) $(LIBXUL_DIST
)/host
/bin
/host_xpt_link
$(HOST_BIN_SUFFIX
)
435 XPIDL_COMPILE
= $(CYGWIN_WRAPPER
) $(LIBXUL_DIST
)/bin
/xpidl
$(BIN_SUFFIX
)
436 XPIDL_LINK
= $(CYGWIN_WRAPPER
) $(LIBXUL_DIST
)/bin
/xpt_link
$(BIN_SUFFIX
)
440 JAVA_GEN_DIR
= _javagen
441 JAVA_DIST_DIR
= $(DEPTH
)/$(JAVA_GEN_DIR
)
442 JAVA_IFACES_PKG_NAME
= org
/mozilla
/interfaces
448 -I
$(DIST
)/include -I
$(DIST
)/include/nsprpub \
449 $(if
$(LIBXUL_SDK
),-I
$(LIBXUL_SDK
)/include -I
$(LIBXUL_SDK
)/include/nsprpub
) \
453 include $(topsrcdir
)/config
/static-checking-config.mk
456 OS_CFLAGS
+= -F
/System
/Library
/PrivateFrameworks
457 OS_CXXFLAGS
+= -F
/System
/Library
/PrivateFrameworks
458 OS_LDFLAGS
+= -F
/System
/Library
/PrivateFrameworks
-framework CHUD
459 endif # ifdef MOZ_SHARK
461 CFLAGS
= $(OS_CFLAGS
)
462 CXXFLAGS
= $(OS_CXXFLAGS
)
463 LDFLAGS
= $(OS_LDFLAGS
) $(MOZ_FIX_LINK_PATHS
)
465 # Allow each module to override the *default* optimization settings
466 # by setting MODULE_OPTIMIZE_FLAGS if the developer has not given
467 # arguments to --enable-optimize
469 ifeq (1,$(MOZ_OPTIMIZE
))
470 ifdef MODULE_OPTIMIZE_FLAGS
471 CFLAGS
+= $(MODULE_OPTIMIZE_FLAGS
)
472 CXXFLAGS
+= $(MODULE_OPTIMIZE_FLAGS
)
474 CFLAGS
+= $(MOZ_OPTIMIZE_FLAGS
)
475 CXXFLAGS
+= $(MOZ_OPTIMIZE_FLAGS
)
476 endif # MODULE_OPTIMIZE_FLAGS
478 CFLAGS
+= $(MOZ_OPTIMIZE_FLAGS
)
479 CXXFLAGS
+= $(MOZ_OPTIMIZE_FLAGS
)
480 endif # MOZ_OPTIMIZE == 1
481 LDFLAGS
+= $(MOZ_OPTIMIZE_LDFLAGS
)
485 HOST_CFLAGS
+= $(HOST_OPTIMIZE_FLAGS
)
488 ifeq (1,$(MOZ_OPTIMIZE
))
489 ifdef MODULE_OPTIMIZE_FLAGS
490 HOST_CFLAGS
+= $(MODULE_OPTIMIZE_FLAGS
)
492 HOST_CFLAGS
+= $(MOZ_OPTIMIZE_FLAGS
)
493 endif # MODULE_OPTIMIZE_FLAGS
495 HOST_CFLAGS
+= $(MOZ_OPTIMIZE_FLAGS
)
496 endif # MOZ_OPTIMIZE == 1
498 endif # CROSS_COMPILE
501 ifeq ($(OS_ARCH
)_
$(GNU_CC
),WINNT_
)
502 #// Currently, unless USE_STATIC_LIBS is defined, the multithreaded
503 #// DLL version of the RTL is used...
505 #//------------------------------------------------------------------------
506 ifdef USE_STATIC_LIBS
507 RTL_FLAGS
=-MT
# Statically linked multithreaded RTL
508 ifneq (,$(MOZ_DEBUG
)$(NS_TRACE_MALLOC
))
509 ifndef MOZ_NO_DEBUG_RTL
510 RTL_FLAGS
=-MTd
# Statically linked multithreaded MSVC4.0 debug RTL
512 endif # MOZ_DEBUG || NS_TRACE_MALLOC
514 else # !USE_STATIC_LIBS
516 RTL_FLAGS
=-MD
# Dynamically linked, multithreaded RTL
517 ifneq (,$(MOZ_DEBUG
)$(NS_TRACE_MALLOC
))
518 ifndef MOZ_NO_DEBUG_RTL
519 RTL_FLAGS
=-MDd
# Dynamically linked, multithreaded MSVC4.0 debug RTL
521 endif # MOZ_DEBUG || NS_TRACE_MALLOC
522 endif # USE_STATIC_LIBS
523 endif # WINNT && !GNU_CC
525 ifeq ($(OS_ARCH
),Darwin
)
526 # Darwin doesn't cross-compile, so just set both types of flags here.
527 HOST_CMFLAGS
+= -fobjc-exceptions
528 HOST_CMMFLAGS
+= -fobjc-exceptions
529 OS_COMPILE_CMFLAGS
+= -fobjc-exceptions
530 OS_COMPILE_CMMFLAGS
+= -fobjc-exceptions
533 COMPILE_CFLAGS
= $(VISIBILITY_FLAGS
) $(DEFINES
) $(INCLUDES
) $(DSO_CFLAGS
) $(DSO_PIC_CFLAGS
) $(CFLAGS
) $(RTL_FLAGS
) $(OS_COMPILE_CFLAGS
)
534 COMPILE_CXXFLAGS
= $(VISIBILITY_FLAGS
) $(DEFINES
) $(INCLUDES
) $(DSO_CFLAGS
) $(DSO_PIC_CFLAGS
) $(CXXFLAGS
) $(RTL_FLAGS
) $(OS_COMPILE_CXXFLAGS
)
535 COMPILE_CMFLAGS
= $(OS_COMPILE_CMFLAGS
)
536 COMPILE_CMMFLAGS
= $(OS_COMPILE_CMMFLAGS
)
539 HOST_CFLAGS
+= $(RTL_FLAGS
)
543 # Name of the binary code directories
547 # We need to know where to find the libraries we
548 # put on the link line for binaries, and should
549 # we link statically or dynamic? Assuming dynamic for now.
551 ifneq (WINNT_
,$(OS_ARCH
)_
$(GNU_CC
))
552 ifneq (,$(filter-out WINCE
,$(OS_ARCH
)))
553 LIBS_DIR
= -L
$(DIST
)/bin
-L
$(DIST
)/lib
555 LIBS_DIR
+= -L
$(LIBXUL_SDK
)/bin
-L
$(LIBXUL_SDK
)/lib
560 # Default location of include files
561 IDL_DIR
= $(DIST
)/idl
563 XPIDL_FLAGS
= -I
$(srcdir) -I
$(IDL_DIR
)
565 XPIDL_FLAGS
+= -I
$(LIBXUL_SDK
)/idl
568 SDK_LIB_DIR
= $(DIST
)/sdk
/lib
569 SDK_BIN_DIR
= $(DIST
)/sdk
/bin
573 MOZ_COMPONENT_LIBS
=$(XPCOM_LIBS
) $(MOZ_COMPONENT_NSPR_LIBS
)
575 ifeq (xpconnect
, $(findstring xpconnect
, $(BUILD_MODULES
)))
576 DEFINES
+= -DXPCONNECT_STANDALONE
579 ifeq ($(OS_ARCH
),OS2
)
585 ifeq ($(MOZ_WIDGET_TOOLKIT
),qt
)
586 OS_LIBS
+= $(MOZ_QT_LIBS
)
590 ifdef USE_ELF_DYNSTR_GC
591 ifdef MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS
592 ELF_DYNSTR_GC
= $(DEPTH
)/config
/elf-dynstr-gc
597 ifeq ($(OS_ARCH
),Darwin
)
600 PBBUILD
= NEXT_ROOT
= $(PBBUILD_BIN
)
602 PBBUILD
= $(PBBUILD_BIN
)
604 PBBUILD_SETTINGS
= GCC_VERSION
="$(GCC_VERSION)" SYMROOT
=build ARCHS
="$(OS_TEST)"
606 PBBUILD_SETTINGS
+= SDKROOT
="$(MACOS_SDK_DIR)"
607 endif # MACOS_SDK_DIR
608 ifdef MACOSX_DEPLOYMENT_TARGET
609 export MACOSX_DEPLOYMENT_TARGET
610 PBBUILD_SETTINGS
+= MACOSX_DEPLOYMENT_TARGET
="$(MACOSX_DEPLOYMENT_TARGET)"
611 endif # MACOSX_DEPLOYMENT_TARGET
613 ifeq (2,$(MOZ_OPTIMIZE
))
614 # Only override project defaults if the config specified explicit settings
615 PBBUILD_SETTINGS
+= GCC_MODEL_TUNING
= OPTIMIZATION_CFLAGS
="$(MOZ_OPTIMIZE_FLAGS)"
616 endif # MOZ_OPTIMIZE=2
618 ifeq (1,$(HAS_XCODE_2_1
))
619 # Xcode 2.1 puts its build products in a directory corresponding to the
620 # selected build style/configuration.
621 XCODE_PRODUCT_DIR
= build
/$(BUILDSTYLE
)
623 XCODE_PRODUCT_DIR
= build
624 endif # HAS_XCODE_2_1=1
625 endif # OS_ARCH=Darwin
628 ifdef MOZ_NATIVE_MAKEDEPEND
630 MKDEPEND
= $(CYGWIN_WRAPPER
) $(MOZ_NATIVE_MAKEDEPEND
)
632 MKDEPEND_DIR
= $(CONFIG_TOOLS
)/mkdepend
633 MKDEPEND
= $(CYGWIN_WRAPPER
) $(MKDEPEND_DIR
)/mkdepend
$(BIN_SUFFIX
)
636 # Set link flags according to whether we want a console.
638 ifeq ($(MOZ_WINCONSOLE
),1)
639 ifeq ($(OS_ARCH
),OS2
)
640 BIN_FLAGS
+= -Zlinker
-PM
:VIO
642 ifeq ($(OS_ARCH
),WINNT
)
644 WIN32_EXE_LDFLAGS
+= -mconsole
646 WIN32_EXE_LDFLAGS
+= -SUBSYSTEM
:CONSOLE
649 else # MOZ_WINCONSOLE
650 ifeq ($(OS_ARCH
),OS2
)
651 BIN_FLAGS
+= -Zlinker
-PM
:PM
653 ifeq ($(OS_ARCH
),WINNT
)
655 WIN32_EXE_LDFLAGS
+= -mwindows
657 WIN32_EXE_LDFLAGS
+= -SUBSYSTEM
:WINDOWS
663 # If we're building a component on MSVC, we don't want to generate an
664 # import lib, because that import lib will collide with the name of a
665 # static version of the same library.
666 ifeq ($(GNU_LD
)$(OS_ARCH
),WINNT
)
668 LDFLAGS
+= -IMPLIB
:fake.lib
669 DELETE_AFTER_LINK
= fake.lib fake.exp
674 # Include any personal overrides the user might think are needed.
676 -include $(topsrcdir
)/$(MOZ_BUILD_APP
)/app-config.mk
677 -include $(MY_CONFIG
)
679 ######################################################################
680 # Now test variables that might have been set or overridden by $(MY_CONFIG).
682 DEFINES
+= -DOSTYPE
=\"$(OS_CONFIG
)\"
683 DEFINES
+= -DOSARCH
=$(OS_ARCH
)
685 ######################################################################
687 GARBAGE
+= $(DEPENDENCIES
) $(MKDEPENDENCIES
) $(MKDEPENDENCIES
).bak core
$(wildcard core.
[0-9]*) $(wildcard *.err
) $(wildcard *.pure
) $(wildcard *_pure_
*.o
) Templates.DB
689 ifeq ($(OS_ARCH
),Darwin
)
691 NSDISTMODE
=absolute_symlink
697 NSINSTALL
= $(CYGWIN_WRAPPER
) $(NSINSTALL_BIN
)
699 ifeq (OS2
,$(CROSS_COMPILE
)$(OS_ARCH
))
700 NSINSTALL
= $(MOZ_TOOLS_DIR
)/nsinstall
702 NSINSTALL
= $(CONFIG_TOOLS
)/nsinstall
$(HOST_BIN_SUFFIX
)
704 endif # NSINSTALL_BIN
707 ifeq (,$(CROSS_COMPILE
)$(filter-out WINNT OS2
, $(OS_ARCH
)))
708 INSTALL
= $(NSINSTALL
)
710 ifeq ($(NSDISTMODE
),copy
)
711 # copy files, but preserve source mtime
712 INSTALL
= $(NSINSTALL
) -t
714 ifeq ($(NSDISTMODE
),absolute_symlink
)
715 # install using absolute symbolic links
716 ifeq ($(OS_ARCH
),Darwin
)
717 INSTALL
= $(NSINSTALL
) -L
$(PWD
)
719 INSTALL
= $(NSINSTALL
) -L
`$(NFSPWD)`
722 # install using relative symbolic links
723 INSTALL
= $(NSINSTALL
) -R
724 endif # absolute_symlink
728 # Use nsinstall in copy mode to install files on the system
729 SYSINSTALL
= $(NSINSTALL
) -t
731 ifeq ($(OS_ARCH
),WINNT
)
732 ifneq (,$(CYGDRIVE_MOUNT
))
733 export CYGDRIVE_MOUNT
738 # Localization build automation
741 # Because you might wish to "make locales AB_CD=ab-CD", we don't hardcode
742 # MOZ_UI_LOCALE directly, but use an intermediate variable that can be
743 # overridden by the command line. (Besides, AB_CD is prettier).
744 AB_CD
= $(MOZ_UI_LOCALE
)
747 L10NBASEDIR
= $(error L10NBASEDIR not defined by configure
)
750 EXPAND_LOCALE_SRCDIR
= $(if
$(filter en-US
,$(AB_CD
)),$(topsrcdir
)/$(1)/en-US
,$(L10NBASEDIR
)/$(AB_CD
)/$(subst /locales
,,$(1)))
753 LOCALE_SRCDIR
= $(call EXPAND_LOCALE_SRCDIR
,$(relativesrcdir
))
757 # if LOCALE_MERGEDIR is set, use mergedir first, then the localization,
759 ifdef LOCALE_MERGEDIR
760 MAKE_JARS_FLAGS
+= -c
$(LOCALE_MERGEDIR
)/$(subst /locales
,,$(relativesrcdir
))
762 MAKE_JARS_FLAGS
+= -c
$(LOCALE_SRCDIR
)
763 ifdef LOCALE_MERGEDIR
764 MAKE_JARS_FLAGS
+= -c
$(topsrcdir
)/$(relativesrcdir
)/en-US
769 RUN_TEST_PROGRAM
= $(PYTHON
) $(topsrcdir
)/build
/mobile
/devicemanager-run-test.py
771 ifeq (OS2
,$(OS_ARCH
))
772 RUN_TEST_PROGRAM
= $(topsrcdir
)/build
/os2
/test_os2.cmd
"$(DIST)"
774 ifneq (WINNT
,$(OS_ARCH
))
775 RUN_TEST_PROGRAM
= $(DIST
)/bin
/run-mozilla.sh
784 # Make sure any compiled classes work with at least JVM 1.4
785 JAVAC_FLAGS
+= -source
1.4
792 DIRS
+= $(foreach tier
,$(TIERS
),$(tier_
$(tier
)_dirs
))
793 STATIC_DIRS
+= $(foreach tier
,$(TIERS
),$(tier_
$(tier
)_staticdirs
))