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 |
|
---|
39 | # Configuration information for building in the NSPR source module
|
---|
40 |
|
---|
41 | # Define an include-at-most-once-flag
|
---|
42 | NSPR_CONFIG_MK = 1
|
---|
43 |
|
---|
44 | #
|
---|
45 | # The variable definitions in this file are inputs to NSPR's
|
---|
46 | # build system. This file, if present, is included at the
|
---|
47 | # beginning of config.mk.
|
---|
48 | #
|
---|
49 | # For example:
|
---|
50 | #
|
---|
51 | # BUILD_OPT=1
|
---|
52 | # USE_PTHREADS=1
|
---|
53 | # NS_USE_GCC=
|
---|
54 | #
|
---|
55 | ifndef topsrcdir
|
---|
56 | topsrcdir=$(MOD_DEPTH)
|
---|
57 | endif
|
---|
58 |
|
---|
59 | ifndef srcdir
|
---|
60 | srcdir=.
|
---|
61 | endif
|
---|
62 |
|
---|
63 | NFSPWD = $(MOD_DEPTH)/config/nfspwd
|
---|
64 |
|
---|
65 | CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
|
---|
66 | $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
|
---|
67 | CCCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
|
---|
68 | $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
|
---|
69 | # For purify
|
---|
70 | NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
|
---|
71 | $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
|
---|
72 | NOMD_CCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
|
---|
73 | $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
|
---|
74 |
|
---|
75 | LDFLAGS = $(OS_LDFLAGS)
|
---|
76 |
|
---|
77 | define MAKE_OBJDIR
|
---|
78 | if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
|
---|
79 | endef
|
---|
80 |
|
---|
81 | LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS)
|
---|
82 |
|
---|
83 | ifeq ($(OS_ARCH),Darwin)
|
---|
84 | PWD := $(shell pwd)
|
---|
85 | endif
|
---|
86 |
|
---|
87 | ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
|
---|
88 | INSTALL = $(NSINSTALL)
|
---|
89 | else
|
---|
90 | ifeq ($(NSDISTMODE),copy)
|
---|
91 | # copy files, but preserve source mtime
|
---|
92 | INSTALL = $(NSINSTALL) -t
|
---|
93 | else
|
---|
94 | ifeq ($(NSDISTMODE),absolute_symlink)
|
---|
95 | # install using absolute symbolic links
|
---|
96 | ifeq ($(OS_ARCH),Darwin)
|
---|
97 | INSTALL = $(NSINSTALL) -L $(PWD)
|
---|
98 | else
|
---|
99 | INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
|
---|
100 | endif
|
---|
101 | else
|
---|
102 | # install using relative symbolic links
|
---|
103 | INSTALL = $(NSINSTALL) -R
|
---|
104 | endif
|
---|
105 | endif
|
---|
106 | endif # (WINNT || OS2) && !CROSS_COMPILE
|
---|
107 |
|
---|
108 | DEPENDENCIES = $(OBJDIR)/.md
|
---|
109 |
|
---|
110 | ifdef BUILD_DEBUG_GC
|
---|
111 | DEFINES += -DDEBUG_GC
|
---|
112 | endif
|
---|
113 |
|
---|
114 | GARBAGE += $(DEPENDENCIES) core $(wildcard core.[0-9]*)
|
---|
115 |
|
---|
116 | DIST_GARBAGE += Makefile
|
---|
117 |
|
---|
118 | ####################################################################
|
---|
119 | #
|
---|
120 | # The NSPR-specific configuration
|
---|
121 | #
|
---|
122 | ####################################################################
|
---|
123 |
|
---|
124 | DEFINES += -DFORCE_PR_LOG
|
---|
125 |
|
---|
126 | ifeq ($(_PR_NO_CLOCK_TIMER),1)
|
---|
127 | DEFINES += -D_PR_NO_CLOCK_TIMER
|
---|
128 | endif
|
---|
129 |
|
---|
130 | ifeq ($(USE_PTHREADS), 1)
|
---|
131 | DEFINES += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
|
---|
132 | endif
|
---|
133 |
|
---|
134 | ifeq ($(PTHREADS_USER), 1)
|
---|
135 | DEFINES += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
|
---|
136 | endif
|
---|
137 |
|
---|
138 | ifeq ($(USE_IPV6),1)
|
---|
139 | DEFINES += -D_PR_INET6
|
---|
140 | endif
|
---|
141 |
|
---|
142 | ifeq ($(MOZ_UNICODE),1)
|
---|
143 | DEFINES += -DMOZ_UNICODE
|
---|
144 | endif
|
---|
145 |
|
---|
146 | ####################################################################
|
---|
147 | #
|
---|
148 | # Configuration for the release process
|
---|
149 | #
|
---|
150 | ####################################################################
|
---|
151 |
|
---|
152 | MDIST = /m/dist
|
---|
153 | ifeq ($(OS_ARCH),WINNT)
|
---|
154 | MDIST = //helium/dist
|
---|
155 | MDIST_DOS = $(subst /,\\,$(MDIST))
|
---|
156 | endif
|
---|
157 |
|
---|
158 | # RELEASE_DIR is ns/dist/<module name>
|
---|
159 |
|
---|
160 | RELEASE_DIR = $(MOD_DEPTH)/dist/release/$(MOD_NAME)
|
---|
161 |
|
---|
162 | RELEASE_INCLUDE_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/include
|
---|
163 | RELEASE_BIN_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/bin
|
---|
164 | RELEASE_LIB_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/lib
|
---|