6d01a1dade223016cf8326f93c7792b5fec8d6b6
[platform/upstream/nss.git] / Makefile
1 #! gmake
2 #
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7 #######################################################################
8 # (1) Include initial platform-independent assignments (MANDATORY).   #
9 #######################################################################
10
11 include manifest.mn
12
13 #######################################################################
14 # (2) Include "global" configuration information. (OPTIONAL)          #
15 #######################################################################
16
17 include $(CORE_DEPTH)/coreconf/config.mk
18
19 #######################################################################
20 # (3) Include "component" configuration information. (OPTIONAL)       #
21 #######################################################################
22
23
24
25 #######################################################################
26 # (4) Include "local" platform-dependent assignments (OPTIONAL).      #
27 #######################################################################
28
29
30
31 #######################################################################
32 # (5) Execute "global" rules. (OPTIONAL)                              #
33 #######################################################################
34
35 include $(CORE_DEPTH)/coreconf/rules.mk
36
37 #######################################################################
38 # (6) Execute "component" rules. (OPTIONAL)                           #
39 #######################################################################
40
41
42
43 #######################################################################
44 # (7) Execute "local" rules. (OPTIONAL).                              #
45 #######################################################################
46
47 nss_build_all: build_nspr all
48
49 nss_clean_all: clobber_nspr clobber
50
51 NSPR_CONFIG_STATUS = $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)/config.status
52 NSPR_CONFIGURE = $(CORE_DEPTH)/../nspr/configure
53
54 #
55 # Translate coreconf build options to NSPR configure options.
56 #
57
58 ifeq ($(OS_TARGET),Android)
59 NSPR_CONFIGURE_OPTS += --with-android-ndk=$(ANDROID_NDK) --target=arm-linux-androideabi --with-android-version=$(OS_TARGET_RELEASE)
60 endif
61 ifdef BUILD_OPT
62 NSPR_CONFIGURE_OPTS += --disable-debug --enable-optimize
63 endif
64 ifdef USE_X32
65 NSPR_CONFIGURE_OPTS += --enable-x32
66 endif
67 ifdef USE_64
68 NSPR_CONFIGURE_OPTS += --enable-64bit
69 endif
70 ifeq ($(OS_TARGET),WIN95)
71 NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
72 endif
73 ifdef USE_DEBUG_RTL
74 NSPR_CONFIGURE_OPTS += --enable-debug-rtl
75 endif
76 ifdef NS_USE_GCC
77 NSPR_COMPILERS = CC=gcc CXX=g++
78 endif
79
80 #
81 # Some pwd commands on Windows (for example, the pwd
82 # command in Cygwin) return a pathname that begins
83 # with a (forward) slash.  When such a pathname is
84 # passed to Windows build tools (for example, cl), it
85 # is mistaken as a command-line option.  If that is the case,
86 # we use a relative pathname as NSPR's prefix on Windows.
87 #
88
89 USEABSPATH="YES"
90 ifeq (,$(filter-out WIN%,$(OS_TARGET)))
91 ifeq (,$(findstring :,$(shell pwd)))
92 USEABSPATH="NO"
93 endif
94 endif
95 ifeq ($(USEABSPATH),"YES")
96 NSPR_PREFIX = $(shell pwd)/../dist/$(OBJDIR_NAME)
97 else
98 NSPR_PREFIX = $$(topsrcdir)/../dist/$(OBJDIR_NAME)
99 endif
100
101 $(NSPR_CONFIG_STATUS): $(NSPR_CONFIGURE)
102         mkdir -p $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
103         cd $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) ; \
104         $(NSPR_COMPILERS) sh ../configure \
105         $(NSPR_CONFIGURE_OPTS) \
106         --with-dist-prefix='$(NSPR_PREFIX)' \
107         --with-dist-includedir='$(NSPR_PREFIX)/include'
108
109 build_nspr: $(NSPR_CONFIG_STATUS)
110         $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
111
112 clobber_nspr: $(NSPR_CONFIG_STATUS)
113         $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) clobber
114
115 build_docs:
116         $(MAKE) -C $(CORE_DEPTH)/doc
117
118 clean_docs:
119         $(MAKE) -C $(CORE_DEPTH)/doc clean
120
121 nss_RelEng_bld: import all
122
123 package:
124         $(MAKE) -C pkg publish
125