1 |
# -*- Mode: makefile -*- |
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 Mozilla Communicator client code, released |
17 |
# March 31, 1998. |
18 |
# |
19 |
# The Initial Developer of the Original Code is |
20 |
# Netscape Communications Corporation. |
21 |
# Portions created by the Initial Developer are Copyright (C) 1998-1999 |
22 |
# the Initial Developer. All Rights Reserved. |
23 |
# |
24 |
# Contributor(s): |
25 |
# |
26 |
# Alternatively, the contents of this file may be used under the terms of |
27 |
# either of the GNU General Public License Version 2 or later (the "GPL"), |
28 |
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
29 |
# in which case the provisions of the GPL or the LGPL are applicable instead |
30 |
# of those above. If you wish to allow use of your version of this file only |
31 |
# under the terms of either the GPL or the LGPL, and not to allow others to |
32 |
# use your version of this file under the terms of the MPL, indicate your |
33 |
# decision by deleting the provisions above and replace them with the notice |
34 |
# and other provisions required by the GPL or the LGPL. If you do not delete |
35 |
# the provisions above, a recipient may use your version of this file under |
36 |
# the terms of any one of the MPL, the GPL or the LGPL. |
37 |
# |
38 |
# ***** END LICENSE BLOCK ***** |
39 |
|
40 |
ifndef OBJDIR |
41 |
ifdef OBJDIR_NAME |
42 |
OBJDIR = $(OBJDIR_NAME) |
43 |
endif |
44 |
endif |
45 |
|
46 |
NSPR_VERSION = v4.0 |
47 |
NSPR_LIBSUFFIX = 4 |
48 |
|
49 |
NSPR_LOCAL = $(MOZ_DEPTH)/dist/$(OBJDIR)/nspr |
50 |
NSPR_DIST = $(MOZ_DEPTH)/dist/$(OBJDIR) |
51 |
NSPR_OBJDIR = $(OBJDIR) |
52 |
ifeq ($(OS_ARCH), SunOS) |
53 |
NSPR_OBJDIR := $(subst _sparc,,$(NSPR_OBJDIR)) |
54 |
endif |
55 |
ifeq ($(OS_ARCH), Linux) |
56 |
LINUX_REL := $(shell uname -r) |
57 |
ifneq (,$(findstring 2.0,$(LINUX_REL))) |
58 |
NSPR_OBJDIR := $(subst _All,2.0_x86_glibc_PTH,$(NSPR_OBJDIR)) |
59 |
else |
60 |
NSPR_OBJDIR := $(subst _All,2.2_x86_glibc_PTH,$(NSPR_OBJDIR)) |
61 |
endif |
62 |
endif |
63 |
ifeq ($(OS_ARCH), AIX) |
64 |
NSPR_OBJDIR := $(subst 4.1,4.2,$(NSPR_OBJDIR)) |
65 |
endif |
66 |
ifeq ($(OS_CONFIG), IRIX6.2) |
67 |
NSPR_OBJDIR := $(subst 6.2,6.2_n32_PTH,$(NSPR_OBJDIR)) |
68 |
endif |
69 |
ifeq ($(OS_CONFIG), IRIX6.5) |
70 |
NSPR_OBJDIR := $(subst 6.5,6.5_n32_PTH,$(NSPR_OBJDIR)) |
71 |
endif |
72 |
ifeq ($(OS_ARCH), WINNT) |
73 |
ifeq ($(OBJDIR), WIN32_D.OBJ) |
74 |
NSPR_OBJDIR = WINNT4.0_DBG.OBJ |
75 |
endif |
76 |
ifeq ($(OBJDIR), WIN32_O.OBJ) |
77 |
NSPR_OBJDIR = WINNT4.0_OPT.OBJ |
78 |
endif |
79 |
endif |
80 |
NSPR_SHARED = /share/builds/components/nspr20/$(NSPR_VERSION)/$(NSPR_OBJDIR) |
81 |
ifeq ($(OS_ARCH), WINNT) |
82 |
NSPR_SHARED = nspr20/$(NSPR_VERSION)/$(NSPR_OBJDIR) |
83 |
endif |
84 |
NSPR_VERSIONFILE = $(NSPR_LOCAL)/Version |
85 |
NSPR_CURVERSION := $(shell cat $(NSPR_VERSIONFILE) 2>/dev/null) |
86 |
|
87 |
get_nspr: |
88 |
@echo "Grabbing NSPR component..." |
89 |
ifeq ($(NSPR_VERSION), $(NSPR_CURVERSION)) |
90 |
@echo "No need, NSPR is up to date in this tree (ver=$(NSPR_VERSION))." |
91 |
else |
92 |
mkdir -p $(NSPR_LOCAL) |
93 |
mkdir -p $(NSPR_DIST) |
94 |
ifneq ($(OS_ARCH), WINNT) |
95 |
cp $(NSPR_SHARED)/*.jar $(NSPR_LOCAL) |
96 |
else |
97 |
sh $(MOZ_DEPTH)/../reltools/compftp.sh $(NSPR_SHARED) $(NSPR_LOCAL) *.jar |
98 |
endif |
99 |
unzip -o $(NSPR_LOCAL)/mdbinary.jar -d $(NSPR_DIST) |
100 |
mkdir -p $(NSPR_DIST)/include |
101 |
unzip -o $(NSPR_LOCAL)/mdheader.jar -d $(NSPR_DIST)/include |
102 |
rm -rf $(NSPR_DIST)/META-INF |
103 |
rm -rf $(NSPR_DIST)/include/META-INF |
104 |
echo $(NSPR_VERSION) > $(NSPR_VERSIONFILE) |
105 |
endif |
106 |
|
107 |
SHIP_DIST = $(MOZ_DEPTH)/dist/$(OBJDIR) |
108 |
SHIP_DIR = $(SHIP_DIST)/SHIP |
109 |
|
110 |
SHIP_LIBS = libjs.$(SO_SUFFIX) libjs.a |
111 |
ifdef JS_LIVECONNECT |
112 |
SHIP_LIBS += libjsj.$(SO_SUFFIX) libjsj.a |
113 |
endif |
114 |
ifeq ($(OS_ARCH), WINNT) |
115 |
SHIP_LIBS = js32.dll js32.lib |
116 |
ifdef JS_LIVECONNECT |
117 |
SHIP_LIBS += jsj.dll jsj.lib |
118 |
endif |
119 |
endif |
120 |
SHIP_LIBS += $(LCJAR) |
121 |
SHIP_LIBS := $(addprefix $(SHIP_DIST)/lib/, $(SHIP_LIBS)) |
122 |
|
123 |
SHIP_INCS = js*.h prmjtime.h resource.h *.msg *.tbl |
124 |
ifdef JS_LIVECONNECT |
125 |
SHIP_INCS += netscape*.h nsC*.h nsI*.h |
126 |
endif |
127 |
SHIP_INCS := $(addprefix $(SHIP_DIST)/include/, $(SHIP_INCS)) |
128 |
|
129 |
SHIP_BINS = js |
130 |
ifdef JS_LIVECONNECT |
131 |
SHIP_BINS += lcshell |
132 |
endif |
133 |
ifeq ($(OS_ARCH), WINNT) |
134 |
SHIP_BINS := $(addsuffix .exe, $(SHIP_BINS)) |
135 |
endif |
136 |
SHIP_BINS := $(addprefix $(SHIP_DIST)/bin/, $(SHIP_BINS)) |
137 |
|
138 |
ifdef BUILD_OPT |
139 |
JSREFJAR = jsref_opt.jar |
140 |
else |
141 |
ifdef BUILD_IDG |
142 |
JSREFJAR = jsref_idg.jar |
143 |
else |
144 |
JSREFJAR = jsref_dbg.jar |
145 |
endif |
146 |
endif |
147 |
|
148 |
ship: |
149 |
mkdir -p $(SHIP_DIR)/$(LIBDIR) |
150 |
mkdir -p $(SHIP_DIR)/include |
151 |
mkdir -p $(SHIP_DIR)/bin |
152 |
cp $(SHIP_LIBS) $(SHIP_DIR)/$(LIBDIR) |
153 |
cp $(SHIP_INCS) $(SHIP_DIR)/include |
154 |
cp $(SHIP_BINS) $(SHIP_DIR)/bin |
155 |
cd $(SHIP_DIR); \ |
156 |
zip -r $(JSREFJAR) bin lib include |
157 |
ifdef BUILD_SHIP |
158 |
cp $(SHIP_DIR)/$(JSREFJAR) $(BUILD_SHIP) |
159 |
endif |
160 |
|
161 |
CWD = $(shell pwd) |
162 |
shipSource: $(SHIP_DIR)/jsref_src.lst .FORCE |
163 |
mkdir -p $(SHIP_DIR) |
164 |
cd $(MOZ_DEPTH)/.. ; \ |
165 |
zip $(CWD)/$(SHIP_DIR)/jsref_src.jar -@ < $(CWD)/$(SHIP_DIR)/jsref_src.lst |
166 |
ifdef BUILD_SHIP |
167 |
cp $(SHIP_DIR)/jsref_src.jar $(BUILD_SHIP) |
168 |
endif |
169 |
|
170 |
JSREFSRCDIRS := $(shell cat $(DEPTH)/SpiderMonkey.rsp) |
171 |
$(SHIP_DIR)/jsref_src.lst: .FORCE |
172 |
mkdir -p $(SHIP_DIR) |
173 |
rm -f $@ |
174 |
touch $@ |
175 |
for d in $(JSREFSRCDIRS); do \ |
176 |
cd $(MOZ_DEPTH)/..; \ |
177 |
ls -1 -d $$d | grep -v CVS | grep -v \.OBJ >> $(CWD)/$@; \ |
178 |
cd $(CWD); \ |
179 |
done |
180 |
|
181 |
.FORCE: |