PageRenderTime 65ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/mozilla-nspr/4.9/config/config.mk

https://bitbucket.org/mosaic/mosaic-distribution-dependencies
Makefile | 201 lines | 96 code | 31 blank | 74 comment | 1 complexity | d9943f423aa5d4e91c58fa7eb7e50b2d MD5 | raw file
Possible License(s): 0BSD, MIT, WTFPL, Apache-2.0, BSD-2-Clause, LGPL-2.1, BSD-3-Clause, MPL-2.0-no-copyleft-exception
  1. #! gmake
  2. #
  3. # ***** BEGIN LICENSE BLOCK *****
  4. # Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. #
  6. # The contents of this file are subject to the Mozilla Public License Version
  7. # 1.1 (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. # http://www.mozilla.org/MPL/
  10. #
  11. # Software distributed under the License is distributed on an "AS IS" basis,
  12. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. # for the specific language governing rights and limitations under the
  14. # License.
  15. #
  16. # The Original Code is the Netscape Portable Runtime (NSPR).
  17. #
  18. # The Initial Developer of the Original Code is
  19. # Netscape Communications Corporation.
  20. # Portions created by the Initial Developer are Copyright (C) 1998-2000
  21. # the Initial Developer. All Rights Reserved.
  22. #
  23. # Contributor(s):
  24. #
  25. # Alternatively, the contents of this file may be used under the terms of
  26. # either the GNU General Public License Version 2 or later (the "GPL"), or
  27. # 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.
  36. #
  37. # ***** END LICENSE BLOCK *****
  38. # Configuration information for building in the NSPR source module
  39. # Define an include-at-most-once-flag
  40. NSPR_CONFIG_MK = 1
  41. #
  42. # The variable definitions in this file are inputs to NSPR's
  43. # build system. This file, if present, is included at the
  44. # beginning of config.mk.
  45. #
  46. # For example:
  47. #
  48. # MOZ_OPTIMIZE=1
  49. # USE_PTHREADS=1
  50. # NS_USE_GCC=
  51. #
  52. ifndef topsrcdir
  53. topsrcdir=$(MOD_DEPTH)
  54. endif
  55. ifndef srcdir
  56. srcdir=.
  57. endif
  58. NFSPWD = $(MOD_DEPTH)/config/nfspwd
  59. CFLAGS = $(VISIBILITY_FLAGS) $(CC_ONLY_FLAGS) $(OPTIMIZER)\
  60. $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
  61. CCCFLAGS = $(VISIBILITY_FLAGS) $(CCC_ONLY_FLAGS) $(OPTIMIZER)\
  62. $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
  63. # For purify
  64. NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
  65. $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
  66. NOMD_CCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
  67. $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
  68. LDFLAGS = $(OS_LDFLAGS)
  69. # Enable profile-guided optimization
  70. ifndef NO_PROFILE_GUIDED_OPTIMIZE
  71. ifdef MOZ_PROFILE_GENERATE
  72. CFLAGS += $(PROFILE_GEN_CFLAGS)
  73. LDFLAGS += $(PROFILE_GEN_LDFLAGS)
  74. DLLFLAGS += $(PROFILE_GEN_LDFLAGS)
  75. ifeq (WINNT,$(OS_ARCH))
  76. AR_FLAGS += -LTCG
  77. endif
  78. endif # MOZ_PROFILE_GENERATE
  79. ifdef MOZ_PROFILE_USE
  80. CFLAGS += $(PROFILE_USE_CFLAGS)
  81. LDFLAGS += $(PROFILE_USE_LDFLAGS)
  82. DLLFLAGS += $(PROFILE_USE_LDFLAGS)
  83. ifeq (WINNT,$(OS_ARCH))
  84. AR_FLAGS += -LTCG
  85. endif
  86. endif # MOZ_PROFILE_USE
  87. endif # NO_PROFILE_GUIDED_OPTIMIZE
  88. define MAKE_OBJDIR
  89. if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
  90. endef
  91. LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS)
  92. ifeq ($(OS_ARCH),Darwin)
  93. PWD := $(shell pwd)
  94. endif
  95. ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
  96. INSTALL = $(NSINSTALL)
  97. else
  98. ifeq ($(NSDISTMODE),copy)
  99. # copy files, but preserve source mtime
  100. INSTALL = $(NSINSTALL) -t
  101. else
  102. ifeq ($(NSDISTMODE),absolute_symlink)
  103. # install using absolute symbolic links
  104. ifeq ($(OS_ARCH),Darwin)
  105. INSTALL = $(NSINSTALL) -L $(PWD)
  106. else
  107. INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
  108. endif
  109. else
  110. # install using relative symbolic links
  111. INSTALL = $(NSINSTALL) -R
  112. endif
  113. endif
  114. endif # (WINNT || OS2) && !CROSS_COMPILE
  115. DEPENDENCIES = $(OBJDIR)/.md
  116. ifdef BUILD_DEBUG_GC
  117. DEFINES += -DDEBUG_GC
  118. endif
  119. GARBAGE += $(DEPENDENCIES) core $(wildcard core.[0-9]*)
  120. DIST_GARBAGE += Makefile
  121. ####################################################################
  122. #
  123. # The NSPR-specific configuration
  124. #
  125. ####################################################################
  126. DEFINES += -DFORCE_PR_LOG
  127. ifeq ($(_PR_NO_CLOCK_TIMER),1)
  128. DEFINES += -D_PR_NO_CLOCK_TIMER
  129. endif
  130. ifeq ($(USE_PTHREADS), 1)
  131. DEFINES += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
  132. endif
  133. ifeq ($(PTHREADS_USER), 1)
  134. DEFINES += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
  135. endif
  136. ifeq ($(USE_IPV6),1)
  137. DEFINES += -D_PR_INET6
  138. endif
  139. ifeq ($(MOZ_UNICODE),1)
  140. DEFINES += -DMOZ_UNICODE
  141. endif
  142. ####################################################################
  143. #
  144. # Configuration for the release process
  145. #
  146. ####################################################################
  147. MDIST = /m/dist
  148. ifeq ($(OS_ARCH),WINNT)
  149. MDIST = //helium/dist
  150. MDIST_DOS = $(subst /,\\,$(MDIST))
  151. endif
  152. # RELEASE_DIR is ns/dist/<module name>
  153. RELEASE_DIR = $(MOD_DEPTH)/dist/release/$(MOD_NAME)
  154. RELEASE_INCLUDE_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/include
  155. RELEASE_BIN_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/bin
  156. RELEASE_LIB_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/lib
  157. # autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
  158. # this file
  159. OBJ_SUFFIX := $(_OBJ_SUFFIX)
  160. # PGO builds with GCC build objects with instrumentation in a first pass,
  161. # then objects optimized, without instrumentation, in a second pass. If
  162. # we overwrite the ojects from the first pass with those from the second,
  163. # we end up not getting instrumentation data for better optimization on
  164. # incremental builds. As a consequence, we use a different object suffix
  165. # for the first pass.
  166. ifdef MOZ_PROFILE_GENERATE
  167. ifdef NS_USE_GCC
  168. OBJ_SUFFIX := i_o
  169. endif
  170. endif