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
49 LOADABLE_ROOT_MODULE
= $(DLL_PREFIX
)nssckbi
$(DLL_SUFFIX
)
52 NSS3_LIB
= $(DLL_PREFIX
)nss3
$(DLL_SUFFIX
)
53 NSSUTIL3_LIB
= $(DLL_PREFIX
)nssutil3
$(DLL_SUFFIX
)
54 SMIME3_LIB
= $(DLL_PREFIX
)smime3
$(DLL_SUFFIX
)
55 SSL3_LIB
= $(DLL_PREFIX
)ssl3
$(DLL_SUFFIX
)
56 SOFTOKEN3_LIB
= $(DLL_PREFIX
)softokn3
$(DLL_SUFFIX
)
57 SOFTOKEN3_CHK
= $(DLL_PREFIX
)softokn3.chk
58 NSSDBM3_LIB
= $(DLL_PREFIX
)nssdbm3
$(DLL_SUFFIX
)
61 ifneq (,$(filter OS2 WINCE WINNT
,$(OS_ARCH
)))
63 $(DIST
)/lib
/$(LIB_PREFIX
)crmf.
$(LIB_SUFFIX
) \
64 $(DIST
)/lib
/$(LIB_PREFIX
)smime3.
$(IMPORT_LIB_SUFFIX
) \
65 $(DIST
)/lib
/$(LIB_PREFIX
)ssl3.
$(IMPORT_LIB_SUFFIX
) \
66 $(DIST
)/lib
/$(LIB_PREFIX
)nss3.
$(IMPORT_LIB_SUFFIX
) \
67 $(DIST
)/lib
/$(LIB_PREFIX
)nssutil3.
$(IMPORT_LIB_SUFFIX
) \
68 $(DIST
)/lib
/$(LIB_PREFIX
)softokn3.
$(IMPORT_LIB_SUFFIX
) \
72 $(DIST
)/lib
/$(LIB_PREFIX
)crmf.
$(LIB_SUFFIX
) \
73 $(DIST
)/lib
/$(LIB_PREFIX
)smime.
$(LIB_SUFFIX
) \
74 $(DIST
)/lib
/$(LIB_PREFIX
)ssl.
$(LIB_SUFFIX
) \
75 $(DIST
)/lib
/$(LIB_PREFIX
)nss.
$(LIB_SUFFIX
) \
76 $(DIST
)/lib
/$(LIB_PREFIX
)nssutil.
$(LIB_SUFFIX
) \
77 $(DIST
)/lib
/$(LIB_PREFIX
)softokn.
$(LIB_SUFFIX
) \
85 # 32-bit HP-UX PA-RISC
86 ifeq ($(OS_ARCH
), HP-UX
)
87 ifneq ($(OS_TEST
), ia64
)
90 HAVE_FREEBL_LIBS_32
= 1
96 ifeq ($(OS_ARCH
), SunOS
)
97 ifneq (86,$(findstring 86,$(OS_TEST
)))
100 HAVE_FREEBL_LIBS_64
= 1
103 HAVE_FREEBL_LIBS_32
= 1
104 HAVE_FREEBL_LIBS_32INT64
= 1
109 ifdef HAVE_FREEBL_LIBS
110 FREEBL_LIB
= $(DLL_PREFIX
)freebl3
$(DLL_SUFFIX
)
111 FREEBL_CHK
= $(DLL_PREFIX
)freebl3.chk
113 ifdef HAVE_FREEBL_LIBS_32
114 FREEBL_32INT_LIB
= libfreebl_32int_3
$(DLL_SUFFIX
)
115 FREEBL_32INT_CHK
= libfreebl_32int_3.chk
116 FREEBL_32FPU_LIB
= libfreebl_32fpu_3
$(DLL_SUFFIX
)
117 FREEBL_32FPU_CHK
= libfreebl_32fpu_3.chk
119 ifdef HAVE_FREEBL_LIBS_32INT64
120 FREEBL_32INT64_LIB
= libfreebl_32int64_3
$(DLL_SUFFIX
)
121 FREEBL_32INT64_CHK
= libfreebl_32int64_3.chk
123 ifdef HAVE_FREEBL_LIBS_64
124 FREEBL_64INT_LIB
= libfreebl_64int_3
$(DLL_SUFFIX
)
125 FREEBL_64INT_CHK
= libfreebl_64int_3.chk
126 FREEBL_64FPU_LIB
= libfreebl_64fpu_3
$(DLL_SUFFIX
)
127 FREEBL_64FPU_CHK
= libfreebl_64fpu_3.chk
130 ABS_DIST
:= $(shell cd
$(DIST
) && pwd
)
131 ifeq ($(HOST_OS_ARCH
),WINNT
)
133 ABS_DIST
:= $(shell cygpath
-w
$(ABS_DIST
) | sed
-e
's|\\|/|g')
135 ifneq (,$(filter mingw
%,$(host_os
)))
136 ABS_DIST
:= $(shell cd
$(DIST
) && pwd
-W
)
139 NSPR_INCLUDE_DIR
= $(firstword $(filter -I
%,$(NSPR_CFLAGS
)))
140 ifneq (,$(strip $(NSPR_INCLUDE_DIR
)))
141 NSPR_INCLUDE_DIR
:= $(subst -I
,,$(subst -I
$(DIST
),-I
$(ABS_DIST
),$(NSPR_INCLUDE_DIR
)))
143 NSPR_INCLUDE_DIR
= $(ABS_DIST
)/include/nspr
145 NSPR_LIB_DIR
= $(firstword $(filter -L
%,$(NSPR_LIBS
)))
146 ifneq (,$(strip $(NSPR_LIB_DIR
)))
147 NSPR_LIB_DIR
:= $(subst -L
,,$(subst -L
$(DIST
),-L
$(ABS_DIST
),$(NSPR_LIB_DIR
)))
149 NSPR_LIB_DIR
= $(ABS_DIST
)/lib
151 # Can't pass this in DEFAULT_GMAKE_FLAGS because that overrides
152 # definitions in NSS, so just export it into the sub-make's environment.
153 ifeq (WINNT_1
,$(OS_TARGET
)_
$(MOZ_MEMORY
))
156 # NSS makefiles are not safe for parallel execution.
157 DEFAULT_GMAKE_FLAGS
= MAKE
="$(MAKE) -j1" -j1
158 DEFAULT_GMAKE_FLAGS
+= CC
="$(CC)"
159 DEFAULT_GMAKE_FLAGS
+= SOURCE_MD_DIR
=$(ABS_DIST
)
160 DEFAULT_GMAKE_FLAGS
+= DIST
=$(ABS_DIST
)
161 DEFAULT_GMAKE_FLAGS
+= NSPR_INCLUDE_DIR
=$(NSPR_INCLUDE_DIR
)
162 DEFAULT_GMAKE_FLAGS
+= NSPR_LIB_DIR
=$(NSPR_LIB_DIR
)
163 DEFAULT_GMAKE_FLAGS
+= MOZILLA_CLIENT
=1
164 DEFAULT_GMAKE_FLAGS
+= NO_MDUPDATE
=1
165 DEFAULT_GMAKE_FLAGS
+= NSS_ENABLE_ECC
=1
166 ABS_topsrcdir
:= $(shell cd
$(topsrcdir
); pwd
)
167 ifneq ($(ABS_topsrcdir
),$(MOZ_BUILD_ROOT
))
168 DEFAULT_GMAKE_FLAGS
+= BUILD_TREE
=$(MOZ_BUILD_ROOT
)
171 DEFAULT_GMAKE_FLAGS
+= BUILD_OPT
=1 OPT_CODE_SIZE
=1
174 DEFAULT_GMAKE_FLAGS
+= NS_USE_GCC
=1 NS_USE_NATIVE
=
176 DEFAULT_GMAKE_FLAGS
+= NS_USE_GCC
= NS_USE_NATIVE
=1
179 # It is not really necessary to specify USE_PTHREADS=1. USE_PTHREADS
180 # merely adds _PTH to coreconf's OBJDIR name.
181 DEFAULT_GMAKE_FLAGS
+= USE_N32
=1 USE_PTHREADS
=1
184 DEFAULT_GMAKE_FLAGS
+= USE_64
=1
186 ifeq ($(OS_ARCH
),WINNT
)
187 DEFAULT_GMAKE_FLAGS
+= OS_TARGET
=WIN95
189 ifndef MOZ_NO_DEBUG_RTL
190 DEFAULT_GMAKE_FLAGS
+= USE_DEBUG_RTL
=1
194 ifeq ($(OS_ARCH
),OS2
)
195 ifdef MOZ_OS2_HIGH_MEMORY
196 DEFAULT_GMAKE_FLAGS
+= MOZ_OS2_HIGH_MEMORY
=1
199 # OS_CFLAGS needs to be passed on down.
200 ifeq ($(OS_ARCH
),OpenVMS
)
201 DEFAULT_GMAKE_FLAGS
+= XCFLAGS
="$(OS_CFLAGS)"
203 ifeq ($(OS_ARCH
),Darwin
)
204 # Make nsinstall use absolute symlinks by default when building NSS
205 # for Mozilla on Mac OS X. (Bugzilla bug 193164)
207 DEFAULT_GMAKE_FLAGS
+= NSDISTMODE
=absolute_symlink
210 DEFAULT_GMAKE_FLAGS
+= MACOS_SDK_DIR
=$(MACOS_SDK_DIR
)
214 DEFAULT_GMAKE_FLAGS
+= \
215 NSINSTALL
="$(NSINSTALL)" \
216 NATIVE_CC
="$(HOST_CC)" \
221 AR
='$(AR) $(AR_FLAGS:$@=$$@)' \
223 RC
="$(RC) $(RCFLAGS)" \
224 OS_ARCH
="$(OS_ARCH)" \
225 OS_TEST
="$(OS_TEST)" \
226 CPU_ARCH
="$(TARGET_CPU)" \
230 SUBMAKEFILES
= boot
/Makefile ssl
/Makefile pki
/Makefile locales
/Makefile
232 include $(topsrcdir
)/config
/rules.mk
234 # Attempt to properly handle NSS' refusal to implement a dependency system
235 export:: .nss.cleaned
237 .nss.cleaned
: .nss.checkout
238 ifndef MOZ_NATIVE_NSS
239 $(MAKE
) -C
$(topsrcdir
)/security
/coreconf
$(DEFAULT_GMAKE_FLAGS
) clean
240 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/lib
$(DEFAULT_GMAKE_FLAGS
) clean
242 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/lib
$(DEFAULT_GMAKE_FLAGS
) clean
243 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/shlibsign
$(DEFAULT_GMAKE_FLAGS
) clean
248 GARBAGE
+= .nss.cleaned
251 ifndef MOZ_NATIVE_NSS
255 dependclean
export packages chrome
::
258 $(MAKE
) -C locales
$@
264 ifndef MOZ_NATIVE_NSS
265 $(MAKE
) -C
$(topsrcdir
)/security
/coreconf
$(DEFAULT_GMAKE_FLAGS
)
266 $(MAKE
) -C
$(topsrcdir
)/security
/dbm
$(DEFAULT_GMAKE_FLAGS
)
267 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/lib
$(DEFAULT_GMAKE_FLAGS
)
269 # Need certutil binary for mochitest certificates generation
270 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/lib
$(DEFAULT_GMAKE_FLAGS
)
271 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/certutil
$(DEFAULT_GMAKE_FLAGS
)
272 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/pk12util
$(DEFAULT_GMAKE_FLAGS
)
275 ifndef ENABLE_TESTS
# Just avoid secondary compile
276 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/lib
$(DEFAULT_GMAKE_FLAGS
)
278 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/shlibsign
$(DEFAULT_GMAKE_FLAGS
)
280 $(INSTALL
) -m
755 $(DIST
)/lib
/$(LOADABLE_ROOT_MODULE
) $(DIST
)/bin
282 $(INSTALL
) -m
644 $(DIST
)/lib
/$(SOFTOKEN3_CHK
) $(DIST
)/bin
284 $(INSTALL
) -m
755 $(DIST
)/lib
/$(SOFTOKEN3_LIB
) $(DIST
)/bin
285 $(INSTALL
) -m
755 $(DIST
)/lib
/$(NSSDBM3_LIB
) $(DIST
)/bin
286 $(INSTALL
) -m
755 $(DIST
)/lib
/$(NSS3_LIB
) $(DIST
)/bin
287 $(INSTALL
) -m
755 $(DIST
)/lib
/$(NSSUTIL3_LIB
) $(DIST
)/bin
288 $(INSTALL
) -m
755 $(DIST
)/lib
/$(SSL3_LIB
) $(DIST
)/bin
289 $(INSTALL
) -m
755 $(DIST
)/lib
/$(SMIME3_LIB
) $(DIST
)/bin
290 $(INSTALL
) -m
755 $(SDK_LIBS
) $(DIST
)/sdk
/lib
291 ifdef HAVE_FREEBL_LIBS
293 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_CHK
) $(DIST
)/bin
295 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_LIB
) $(DIST
)/bin
297 ifdef HAVE_FREEBL_LIBS_32
299 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32INT_CHK
) $(DIST
)/bin
300 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32FPU_CHK
) $(DIST
)/bin
302 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32INT_LIB
) $(DIST
)/bin
303 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32FPU_LIB
) $(DIST
)/bin
305 ifdef HAVE_FREEBL_LIBS_32INT64
307 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32INT64_CHK
) $(DIST
)/bin
309 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32INT64_LIB
) $(DIST
)/bin
311 ifdef HAVE_FREEBL_LIBS_64
313 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_64INT_CHK
) $(DIST
)/bin
314 $(INSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_64FPU_CHK
) $(DIST
)/bin
316 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_64INT_LIB
) $(DIST
)/bin
317 $(INSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_64FPU_LIB
) $(DIST
)/bin
320 ifndef MOZ_NATIVE_NSS
321 # NSS installs headers to dist/public and we want them in dist/include
322 $(NSINSTALL
) -D
$(DIST
)/include/nss
323 (cd
$(DIST
)/public
/nss
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
324 (cd
$(DIST
)/include/nss
&& tar -xf
-)
325 (cd
$(DIST
)/public
/nss
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
326 (cd
$(DIST
)/sdk
/include && tar -xf
-)
330 $(MAKE
) -C locales
$@
339 ifndef MOZ_NATIVE_NSS
340 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(LOADABLE_ROOT_MODULE
) $(DESTDIR
)$(mozappdir
)
342 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(SOFTOKEN3_CHK
) $(DESTDIR
)$(mozappdir
)
344 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(SOFTOKEN3_LIB
) $(DESTDIR
)$(mozappdir
)
345 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(NSSDBM3_LIB
) $(DESTDIR
)$(mozappdir
)
346 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(NSS3_LIB
) $(DESTDIR
)$(mozappdir
)
347 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(NSSUTIL3_LIB
) $(DESTDIR
)$(mozappdir
)
348 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(SSL3_LIB
) $(DESTDIR
)$(mozappdir
)
349 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(SMIME3_LIB
) $(DESTDIR
)$(mozappdir
)
350 ifdef HAVE_FREEBL_LIBS
352 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_CHK
) $(DESTDIR
)$(mozappdir
)
354 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_LIB
) $(DESTDIR
)$(mozappdir
)
356 ifdef HAVE_FREEBL_LIBS_32
358 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32INT_CHK
) $(DESTDIR
)$(mozappdir
)
359 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32FPU_CHK
) $(DESTDIR
)$(mozappdir
)
361 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32INT_LIB
) $(DESTDIR
)$(mozappdir
)
362 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32FPU_LIB
) $(DESTDIR
)$(mozappdir
)
364 ifdef HAVE_FREEBL_LIBS_32INT64
366 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_32INT64_CHK
) $(DESTDIR
)$(mozappdir
)
368 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_32INT64_LIB
) $(DESTDIR
)$(mozappdir
)
370 ifdef HAVE_FREEBL_LIBS_64
372 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_64INT_CHK
) $(DESTDIR
)$(mozappdir
)
373 $(SYSINSTALL
) -m
644 $(DIST
)/lib
/$(FREEBL_64FPU_CHK
) $(DESTDIR
)$(mozappdir
)
375 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_64INT_LIB
) $(DESTDIR
)$(mozappdir
)
376 $(SYSINSTALL
) -m
755 $(DIST
)/lib
/$(FREEBL_64FPU_LIB
) $(DESTDIR
)$(mozappdir
)
381 $(MAKE
) -C locales
$@
386 clean clobber clobber_all
realclean distclean depend
::
389 $(MAKE
) -C locales
$@
393 ifndef MOZ_NATIVE_NSS
394 $(MAKE
) -C
$(topsrcdir
)/security
/coreconf
$(DEFAULT_GMAKE_FLAGS
) clean
395 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/lib
$(DEFAULT_GMAKE_FLAGS
) clean
397 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/lib
$(DEFAULT_GMAKE_FLAGS
) clean
398 $(MAKE
) -C
$(topsrcdir
)/security
/nss
/cmd
/shlibsign
$(DEFAULT_GMAKE_FLAGS
) clean
402 echo-requires-recursive
::
406 $(MAKE
) -C locales
$@