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 # Brian Ryner <bryner@brianryner.com>
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.
37 # ***** END LICENSE BLOCK *****
40 topsrcdir
= @top_srcdir@
44 include $(DEPTH
)/config
/autoconf.mk
48 PACKAGE_FILE
= psm.pkg
59 LOADABLE_ROOT_MODULE \
62 HAVE_FREEBL_LIBS_32INT64 \
66 LOADABLE_ROOT_MODULE
= $(DLL_PREFIX
)nssckbi
$(DLL_SUFFIX
)
69 NSS3_LIB
= $(DLL_PREFIX
)nss3
$(DLL_SUFFIX
)
70 NSSUTIL3_LIB
= $(DLL_PREFIX
)nssutil3
$(DLL_SUFFIX
)
71 SMIME3_LIB
= $(DLL_PREFIX
)smime3
$(DLL_SUFFIX
)
72 SSL3_LIB
= $(DLL_PREFIX
)ssl3
$(DLL_SUFFIX
)
73 SOFTOKEN3_LIB
= $(DLL_PREFIX
)softokn3
$(DLL_SUFFIX
)
74 SOFTOKEN3_CHK
= $(DLL_PREFIX
)softokn3.chk
75 NSSDBM3_LIB
= $(DLL_PREFIX
)nssdbm3
$(DLL_SUFFIX
)
78 ifneq (,$(filter OS2 WINCE WINNT
,$(OS_ARCH
)))
80 $(DIST
)/lib
/$(LIB_PREFIX
)crmf.
$(LIB_SUFFIX
) \
81 $(DIST
)/lib
/$(LIB_PREFIX
)smime3.
$(IMPORT_LIB_SUFFIX
) \
82 $(DIST
)/lib
/$(LIB_PREFIX
)ssl3.
$(IMPORT_LIB_SUFFIX
) \
83 $(DIST
)/lib
/$(LIB_PREFIX
)nss3.
$(IMPORT_LIB_SUFFIX
) \
84 $(DIST
)/lib
/$(LIB_PREFIX
)nssutil3.
$(IMPORT_LIB_SUFFIX
) \
85 $(DIST
)/lib
/$(LIB_PREFIX
)softokn3.
$(IMPORT_LIB_SUFFIX
) \
89 $(DIST
)/lib
/$(LIB_PREFIX
)crmf.
$(LIB_SUFFIX
) \
90 $(DIST
)/lib
/$(LIB_PREFIX
)smime.
$(LIB_SUFFIX
) \
91 $(DIST
)/lib
/$(LIB_PREFIX
)ssl.
$(LIB_SUFFIX
) \
92 $(DIST
)/lib
/$(LIB_PREFIX
)nss.
$(LIB_SUFFIX
) \
93 $(DIST
)/lib
/$(LIB_PREFIX
)nssutil.
$(LIB_SUFFIX
) \
94 $(DIST
)/lib
/$(LIB_PREFIX
)softokn.
$(LIB_SUFFIX
) \
102 # 32-bit HP-UX PA-RISC
103 ifeq ($(OS_ARCH
), HP-UX
)
104 ifneq ($(OS_TEST
), ia64
)
107 HAVE_FREEBL_LIBS_32
= 1
113 ifeq ($(OS_ARCH
), SunOS
)
114 ifneq (86,$(findstring 86,$(OS_TEST
)))
117 HAVE_FREEBL_LIBS_64
= 1
120 HAVE_FREEBL_LIBS_32
= 1
121 HAVE_FREEBL_LIBS_32INT64
= 1
126 ifdef HAVE_FREEBL_LIBS
127 FREEBL_LIB
= $(DLL_PREFIX
)freebl3
$(DLL_SUFFIX
)
128 FREEBL_CHK
= $(DLL_PREFIX
)freebl3.chk
130 ifdef HAVE_FREEBL_LIBS_32
131 FREEBL_32INT_LIB
= libfreebl_32int_3
$(DLL_SUFFIX
)
132 FREEBL_32INT_CHK
= libfreebl_32int_3.chk
133 FREEBL_32FPU_LIB
= libfreebl_32fpu_3
$(DLL_SUFFIX
)
134 FREEBL_32FPU_CHK
= libfreebl_32fpu_3.chk
136 ifdef HAVE_FREEBL_LIBS_32INT64
137 FREEBL_32INT64_LIB
= libfreebl_32int64_3
$(DLL_SUFFIX
)
138 FREEBL_32INT64_CHK
= libfreebl_32int64_3.chk
140 ifdef HAVE_FREEBL_LIBS_64
141 FREEBL_64INT_LIB
= libfreebl_64int_3
$(DLL_SUFFIX
)
142 FREEBL_64INT_CHK
= libfreebl_64int_3.chk
143 FREEBL_64FPU_LIB
= libfreebl_64fpu_3
$(DLL_SUFFIX
)
144 FREEBL_64FPU_CHK
= libfreebl_64fpu_3.chk
147 ABS_DIST
:= $(shell cd
$(DIST
) && pwd
)
148 ifeq ($(HOST_OS_ARCH
),WINNT
)
150 ABS_DIST
:= $(shell cygpath
-w
$(ABS_DIST
) | sed
-e
's|\\|/|g')
152 ifneq (,$(filter mingw
%,$(host_os
)))
153 ABS_DIST
:= $(shell cd
$(DIST
) && pwd
-W
)
156 NSPR_INCLUDE_DIR
= $(firstword $(filter -I
%,$(NSPR_CFLAGS
)))
157 ifneq (,$(strip $(NSPR_INCLUDE_DIR
)))
158 NSPR_INCLUDE_DIR
:= $(subst -I
,,$(subst -I
$(DIST
),-I
$(ABS_DIST
),$(NSPR_INCLUDE_DIR
)))
160 NSPR_INCLUDE_DIR
= $(ABS_DIST
)/include/nspr
162 NSPR_LIB_DIR
= $(firstword $(filter -L
%,$(NSPR_LIBS
)))
163 ifneq (,$(strip $(NSPR_LIB_DIR
)))
164 NSPR_LIB_DIR
:= $(subst -L
,,$(subst -L
$(DIST
),-L
$(ABS_DIST
),$(NSPR_LIB_DIR
)))
166 NSPR_LIB_DIR
= $(ABS_DIST
)/lib
168 # Can't pass this in DEFAULT_GMAKE_FLAGS because that overrides
169 # definitions in NSS, so just export it into the sub-make's environment.
170 ifeq (WINNT_1
,$(OS_TARGET
)_
$(MOZ_MEMORY
))
173 # NSS makefiles are not safe for parallel execution.
174 DEFAULT_GMAKE_FLAGS
= MAKE
="$(MAKE) -j1" -j1
175 DEFAULT_GMAKE_FLAGS
+= CC
="$(CC)"
176 DEFAULT_GMAKE_FLAGS
+= SOURCE_MD_DIR
=$(ABS_DIST
)
177 DEFAULT_GMAKE_FLAGS
+= DIST
=$(ABS_DIST
)
178 DEFAULT_GMAKE_FLAGS
+= NSPR_INCLUDE_DIR
=$(NSPR_INCLUDE_DIR
)
179 DEFAULT_GMAKE_FLAGS
+= NSPR_LIB_DIR
=$(NSPR_LIB_DIR
)
180 DEFAULT_GMAKE_FLAGS
+= MOZILLA_CLIENT
=1
181 DEFAULT_GMAKE_FLAGS
+= NO_MDUPDATE
=1
182 DEFAULT_GMAKE_FLAGS
+= NSS_ENABLE_ECC
=1
183 ABS_topsrcdir
:= $(shell cd
$(topsrcdir
); pwd
)
184 ifneq ($(ABS_topsrcdir
),$(MOZ_BUILD_ROOT
))
185 DEFAULT_GMAKE_FLAGS
+= BUILD_TREE
=$(MOZ_BUILD_ROOT
)
188 DEFAULT_GMAKE_FLAGS
+= BUILD_OPT
=1 OPT_CODE_SIZE
=1
191 DEFAULT_GMAKE_FLAGS
+= NS_USE_GCC
=1 NS_USE_NATIVE
=
193 DEFAULT_GMAKE_FLAGS
+= NS_USE_GCC
= NS_USE_NATIVE
=1
196 # It is not really necessary to specify USE_PTHREADS=1. USE_PTHREADS
197 # merely adds _PTH to coreconf's OBJDIR name.
198 DEFAULT_GMAKE_FLAGS
+= USE_N32
=1 USE_PTHREADS
=1
201 DEFAULT_GMAKE_FLAGS
+= USE_64
=1
203 ifeq ($(OS_ARCH
),WINNT
)
204 DEFAULT_GMAKE_FLAGS
+= OS_TARGET
=WIN95
206 ifndef MOZ_NO_DEBUG_RTL
207 DEFAULT_GMAKE_FLAGS
+= USE_DEBUG_RTL
=1
211 ifeq ($(OS_ARCH
),OS2
)
212 ifdef MOZ_OS2_HIGH_MEMORY
213 DEFAULT_GMAKE_FLAGS
+= MOZ_OS2_HIGH_MEMORY
=1
216 # OS_CFLAGS needs to be passed on down.
217 ifeq ($(OS_ARCH
),OpenVMS
)
218 DEFAULT_GMAKE_FLAGS
+= XCFLAGS
="$(OS_CFLAGS)"
220 ifeq ($(OS_ARCH
),Darwin
)
221 # Make nsinstall use absolute symlinks by default when building NSS
222 # for Mozilla on Mac OS X. (Bugzilla bug 193164)
224 DEFAULT_GMAKE_FLAGS
+= NSDISTMODE
=absolute_symlink
227 DEFAULT_GMAKE_FLAGS
+= MACOS_SDK_DIR
=$(MACOS_SDK_DIR
)
231 DEFAULT_GMAKE_FLAGS
+= \
232 NSINSTALL
="$(NSINSTALL)" \
233 NATIVE_CC
="$(HOST_CC)" \
238 AR
='$(AR) $(AR_FLAGS:$@=$$@)' \
240 RC
="$(RC) $(RCFLAGS)" \
241 OS_ARCH
="$(OS_ARCH)" \
242 OS_TEST
="$(OS_TEST)" \
243 CPU_ARCH
="$(TARGET_CPU)" \
247 SUBMAKEFILES
= boot
/Makefile ssl
/Makefile pki
/Makefile locales
/Makefile
249 include $(topsrcdir
)/config
/rules.mk
251 # Attempt to properly handle NSS' refusal to implement a dependency system
252 export:: .nss.cleaned
254 .nss.cleaned
: .nss.checkout
255 ifndef MOZ_NATIVE_NSS
256 $(MAKE
) -C
$(topsrcdir
)/security
/coreconf
$(DEFAULT_GMAKE_FLAGS
) clean
257 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/lib
$(DEFAULT_GMAKE_FLAGS
) clean
259 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/lib
$(DEFAULT_GMAKE_FLAGS
) clean
260 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/shlibsign
$(DEFAULT_GMAKE_FLAGS
) clean
265 GARBAGE
+= .nss.cleaned
268 ifndef MOZ_NATIVE_NSS
272 dependclean
export packages chrome
::
275 $(MAKE
) -C locales
$@
281 ifndef MOZ_NATIVE_NSS
282 $(MAKE
) -C
$(topsrcdir
)/security
/coreconf
$(DEFAULT_GMAKE_FLAGS
)
283 $(MAKE
) -C
$(topsrcdir
)/security
/dbm
$(DEFAULT_GMAKE_FLAGS
)
284 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/lib
$(DEFAULT_GMAKE_FLAGS
)
286 # Need certutil binary for mochitest certificates generation
287 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/lib
$(DEFAULT_GMAKE_FLAGS
)
288 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/certutil
$(DEFAULT_GMAKE_FLAGS
)
289 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/pk12util
$(DEFAULT_GMAKE_FLAGS
)
292 ifndef ENABLE_TESTS
# Just avoid secondary compile
293 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/lib
$(DEFAULT_GMAKE_FLAGS
)
295 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/shlibsign
$(DEFAULT_GMAKE_FLAGS
)
297 $(INSTALL
) -m
755 $(DIST
)/lib
/$(LOADABLE_ROOT_MODULE
) $(DIST
)/bin
299 $(INSTALL
) -m
644 $(DIST
)/lib
/$(SOFTOKEN3_CHK
) $(DIST
)/bin
301 $(INSTALL
) -m
755 $(DIST
)/lib
/$(SOFTOKEN3_LIB
) $(DIST
)/bin
302 $(INSTALL
) -m
755 $(DIST
)/lib
/$(NSSDBM3_LIB
) $(DIST
)/bin
303 $(INSTALL
) -m
755 $(DIST
)/lib
/$(NSS3_LIB
) $(DIST
)/bin
304 $(INSTALL
) -m
755 $(DIST
)/lib
/$(NSSUTIL3_LIB
) $(DIST
)/bin
305 $(INSTALL
) -m
755 $(DIST
)/lib
/$(SSL3_LIB
) $(DIST
)/bin
306 $(INSTALL
) -m
755 $(DIST
)/lib
/$(SMIME3_LIB
) $(DIST
)/bin
307 $(INSTALL
) -m
755 $(SDK_LIBS
) $(DIST
)/sdk
/lib
308 ifdef HAVE_FREEBL_LIBS
310 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_CHK
) $(DIST
)/bin
312 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_LIB
) $(DIST
)/bin
314 ifdef HAVE_FREEBL_LIBS_32
316 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32INT_CHK
) $(DIST
)/bin
317 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32FPU_CHK
) $(DIST
)/bin
319 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32INT_LIB
) $(DIST
)/bin
320 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32FPU_LIB
) $(DIST
)/bin
322 ifdef HAVE_FREEBL_LIBS_32INT64
324 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32INT64_CHK
) $(DIST
)/bin
326 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32INT64_LIB
) $(DIST
)/bin
328 ifdef HAVE_FREEBL_LIBS_64
330 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_64INT_CHK
) $(DIST
)/bin
331 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_64FPU_CHK
) $(DIST
)/bin
333 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_64INT_LIB
) $(DIST
)/bin
334 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_64FPU_LIB
) $(DIST
)/bin
337 ifndef MOZ_NATIVE_NSS
338 # NSS installs headers to dist/public and we want them in dist/include
339 $(NSINSTALL
) -D
$(DIST
)/include/nss
340 (cd
$(DIST
)/public
/nss
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
341 (cd
$(DIST
)/include/nss
&& tar -xf
-)
342 (cd
$(DIST
)/public
/nss
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
343 (cd
$(DIST
)/sdk
/include && tar -xf
-)
347 $(MAKE
) -C locales
$@
356 ifndef MOZ_NATIVE_NSS
357 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(LOADABLE_ROOT_MODULE
) $(DESTDIR
)$(mozappdir
)
359 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(SOFTOKEN3_CHK
) $(DESTDIR
)$(mozappdir
)
361 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(SOFTOKEN3_LIB
) $(DESTDIR
)$(mozappdir
)
362 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(NSSDBM3_LIB
) $(DESTDIR
)$(mozappdir
)
363 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(NSS3_LIB
) $(DESTDIR
)$(mozappdir
)
364 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(NSSUTIL3_LIB
) $(DESTDIR
)$(mozappdir
)
365 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(SSL3_LIB
) $(DESTDIR
)$(mozappdir
)
366 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(SMIME3_LIB
) $(DESTDIR
)$(mozappdir
)
367 ifdef HAVE_FREEBL_LIBS
369 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_CHK
) $(DESTDIR
)$(mozappdir
)
371 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_LIB
) $(DESTDIR
)$(mozappdir
)
373 ifdef HAVE_FREEBL_LIBS_32
375 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32INT_CHK
) $(DESTDIR
)$(mozappdir
)
376 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32FPU_CHK
) $(DESTDIR
)$(mozappdir
)
378 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32INT_LIB
) $(DESTDIR
)$(mozappdir
)
379 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32FPU_LIB
) $(DESTDIR
)$(mozappdir
)
381 ifdef HAVE_FREEBL_LIBS_32INT64
383 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32INT64_CHK
) $(DESTDIR
)$(mozappdir
)
385 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32INT64_LIB
) $(DESTDIR
)$(mozappdir
)
387 ifdef HAVE_FREEBL_LIBS_64
389 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_64INT_CHK
) $(DESTDIR
)$(mozappdir
)
390 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_64FPU_CHK
) $(DESTDIR
)$(mozappdir
)
392 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_64INT_LIB
) $(DESTDIR
)$(mozappdir
)
393 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_64FPU_LIB
) $(DESTDIR
)$(mozappdir
)
398 $(MAKE
) -C locales
$@
403 clean clobber clobber_all
realclean distclean depend
::
406 $(MAKE
) -C locales
$@
410 ifndef MOZ_NATIVE_NSS
411 $(MAKE
) -C
$(topsrcdir
)/security
/coreconf
$(DEFAULT_GMAKE_FLAGS
) clean
412 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/lib
$(DEFAULT_GMAKE_FLAGS
) clean
414 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/lib
$(DEFAULT_GMAKE_FLAGS
) clean
415 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/shlibsign
$(DEFAULT_GMAKE_FLAGS
) clean
419 echo-requires-recursive
::
423 $(MAKE
) -C locales
$@