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