Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 274 lines (226 sloc) 6.951 kb
da3d45b Initial version
mcafee%netscape.com authored
1 #!gmake
2 # The contents of this file are subject to the Netscape Public License
3 # Version 1.0 (the "NPL"); you may not use this file except in
4 # compliance with the NPL. You may obtain a copy of the NPL at
5 # http://www.mozilla.org/NPL/
6 #
7 # Software distributed under the NPL is distributed on an "AS IS" basis,
8 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
9 # for the specific language governing rights and limitations under the
10 # NPL.
11 #
12 # The Initial Developer of this code under the NPL is Netscape
13 # Communications Corporation. Portions created by Netscape are
14 # Copyright (C) 1998 Netscape Communications Corporation. All Rights
15 # Reserved.
16
17 # Build the Mozilla client.
18 #
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
19 # This needs CVSROOT set to work, e.g.,
20 # setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
21 # or
22 # setenv CVSROOT :pserver:username%somedomain.org@cvs.mozilla.org:/cvsroot
0576b35 more comments
mcafee%netscape.com authored
23 #
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
24 # To checkout and build a tree,
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
25 # 1. cvs co mozilla/client.mk
26 # 2. cd mozilla
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
27 # 3. gmake -f client.mk
da3d45b Initial version
mcafee%netscape.com authored
28 #
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
29 # Other targets (gmake -f client.mk [targets...]),
5a37b68 Fix LD_LIBRARY_PATH for nspr. Drop '.sh' from mozconfig name.
slamm%netscape.com authored
30 # checkout
31 # build
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
32 # realclean (also clobber_all)
33 # clean (also clobber)
0576b35 more comments
mcafee%netscape.com authored
34 #
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
35 # See http://www.mozilla.org/build/unix.html for more information.
0576b35 more comments
mcafee%netscape.com authored
36 #
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
37 # Options:
fd3432b Pthreads is on by default now for configure. Make client.mk do the same.
slamm%netscape.com authored
38 # MOZ_OBJDIR - Destination object directory
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
39 # also,
fd3432b Pthreads is on by default now for configure. Make client.mk do the same.
slamm%netscape.com authored
40 # MOZ_CO_BRANCH - Branch tag to use for checkout (default: HEAD)
41 # MOZ_CO_MODULE - Module to checkout (default: SeaMonkeyEditor)
42 # MOZ_CVS_FLAGS - Flags to pass cvs (default: -q -z3)
43 # MOZ_CO_FLAGS - Flags to pass after 'cvs co' (default: -P)
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
44
45 CWD := $(shell pwd)
46 ifeq (mozilla, $(notdir $(CWD)))
47 ROOTDIR := $(shell dirname $(CWD))
cbed2d5 Change myconfig to mozconfig.
slamm%netscape.com authored
48 TOPSRCDIR := $(CWD)
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
49 else
50 ROOTDIR := $(CWD)
cbed2d5 Change myconfig to mozconfig.
slamm%netscape.com authored
51 TOPSRCDIR := $(CWD)/mozilla
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
52 endif
53
54 AUTOCONF := autoconf
55 MKDIR := mkdir
56 SH := /bin/sh
533eaba updated to allow for one-step building
alecf%netscape.com authored
57 ifndef MAKE
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
58 MAKE := gmake
59 endif
0f7f94e Fix bustage: OBJDIR wasn't defined correctly. (also add webconfig target...
slamm%netscape.com authored
60
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
61 # Check for some file in the tree.
62 ifeq (,$(wildcard $(TOPSRCDIR)/config/Makefile.in))
63 _IS_FIRST_CHECKOUT := 1
533eaba updated to allow for one-step building
alecf%netscape.com authored
64 endif
65
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
66 #######################################################################
67 # Defines
68 #
69
70 ####################################
71 # CVS
533eaba updated to allow for one-step building
alecf%netscape.com authored
72
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
73 # Basic CVS flags
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
74 ifndef MOZ_CVS_FLAGS
75 MOZ_CVS_FLAGS := -q -z 3
533eaba updated to allow for one-step building
alecf%netscape.com authored
76 endif
77
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
78 # Anything that we should use on all checkouts
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
79 ifdef MOZ_CO_FLAGS
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
80 CVS_CO_FLAGS := $(MOZ_CO_FLAGS)
533eaba updated to allow for one-step building
alecf%netscape.com authored
81 else
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
82 CVS_CO_FLAGS := -P
533eaba updated to allow for one-step building
alecf%netscape.com authored
83 endif
84
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
85 # Add the CVS root to CVS_CO_FLAGS if needed
86 CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null)
87 ifneq ($(MOZ_CVS_ROOT),)
88 ifneq ($(MOZ_CVS_ROOT),$(CVSROOT))
89 MOZ_CVS_FLAGS := $(MOZ_CVS_FLAGS) -d $(CVS_ROOT_IN_TREE)
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
90 endif
533eaba updated to allow for one-step building
alecf%netscape.com authored
91 endif
92
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
93 CVSCO := cvs $(MOZ_CVS_FLAGS) co $(CVS_CO_FLAGS)
94 CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
95
96 ####################################
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
97 # Load mozconfig Options
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
98
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
99 # See build pages, http://www.mozilla.org/build/unix.html,
100 # for how to set up mozconfig.
101 MOZCONFIG2DEFS := mozilla/build/autoconf/mozconfig2defs.sh
102 run_for_side_effects := \
103 $(shell cd $(ROOTDIR); \
104 if test ! -f $(MOZCONFIG2DEFS); then \
105 $(CVSCO) mozilla/build/autoconf/find-mozconfig.sh; \
106 $(CVSCO) $(MOZCONFIG2DEFS); \
107 else true; \
108 fi; \
109 $(MOZCONFIG2DEFS) mozilla/.client-defs.mk)
110 include $(TOPSRCDIR)/.client-defs.mk
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
111
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
112 ####################################
113 # Options that may come from mozconfig
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
114
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
115 ifdef MOZ_CO_BRANCH
116 CVSCO := $(CVSCO) -r $(MOZ_CO_BRANCH)
533eaba updated to allow for one-step building
alecf%netscape.com authored
117 endif
da3d45b Initial version
mcafee%netscape.com authored
118
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
119 ifndef MOZ_CO_MODULE
120 MOZ_CO_MODULE := SeaMonkeyEditor
a9d58ef Fix motif autoconf build -- pass MOZ_TOOLKIT through
akkana%netscape.com authored
121 endif
122
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
123 ifdef MOZ_OBJDIR
124 OBJDIR := $(MOZ_OBJDIR)
125 else
126 OBJDIR := $(TOPSRCDIR)
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
127 endif
cd82a60 Turn on debug by default
akkana%netscape.com authored
128
533eaba updated to allow for one-step building
alecf%netscape.com authored
129
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
130 #######################################################################
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
131 # Rules
533eaba updated to allow for one-step building
alecf%netscape.com authored
132 #
133
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
134 ifdef _IS_FIRST_CHECKOUT
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
135 all: checkout build
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
136 else
137 all: checkout depend build
138 endif
da3d45b Initial version
mcafee%netscape.com authored
139
5d0fa52 Add clean targets. Add windows equivalent targets.
slamm%netscape.com authored
140 # Windows equivalents
141 pull_all: checkout
142 build_all: build
143 clobber: clean
144 clobber_all: realclean
145 pull_and_build_all: checkout build
da3d45b Initial version
mcafee%netscape.com authored
146
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
147 ####################################
533eaba updated to allow for one-step building
alecf%netscape.com authored
148 # CVS checkout
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
149
da3d45b Initial version
mcafee%netscape.com authored
150 checkout:
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
151 @if test -f $(CVSCO_LOGFILE) ; then \
152 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
d006a19 Made it acceptable to QNX's shell.
briano%netscape.com authored
153 else true; \
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
154 fi
155 @date > $(CVSCO_LOGFILE)
156 cd $(ROOTDIR) && \
d44daed Now it'll be able to capture all of CVS's output instead of just stdout.
briano%netscape.com authored
157 $(CVSCO) $(MOZ_CO_MODULE) 2>&1 | tee -a $(CVSCO_LOGFILE)
2729f84 Summarize checkout conflicts before dying.
slamm%netscape.com authored
158 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
159 if test "$$conflicts" ; then \
160 echo "$(MAKE): *** Conflicts during checkout." ;\
161 echo "$$conflicts" ;\
162 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
7212a7d Moving egrep -q to redirect to /dev/null to get around egrep portability...
mcafee%netscape.com authored
163 exit 1; \
d006a19 Made it acceptable to QNX's shell.
briano%netscape.com authored
164 else true; \
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
165 fi
166
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
167 ####################################
0f7f94e Fix bustage: OBJDIR wasn't defined correctly. (also add webconfig target...
slamm%netscape.com authored
168 # Web configure
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
169
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
170 WEBCONFIG_URL := http://cvs-mirror.mozilla.org/webtools/build/config.cgi
171 WEBCONFIG_FILE := $(HOME)/.mozconfig
172
0e58583 Make sure .mozconfig.mk can be read. Even for first checkout. Pre-fill ...
slamm%netscape.com authored
173 MOZCONFIG2URL := build/autoconf/mozconfig2url.sh
0f7f94e Fix bustage: OBJDIR wasn't defined correctly. (also add webconfig target...
slamm%netscape.com authored
174 webconfig:
0e58583 Make sure .mozconfig.mk can be read. Even for first checkout. Pre-fill ...
slamm%netscape.com authored
175 @url=$(WEBCONFIG_URL); \
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
176 cd $(TOPSRCDIR); \
177 if test ! -f $(MOZCONFIG2URL); then \
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
178 (cd ..; $(CVSCO) mozilla/$(MOZCONFIG2URL);) \
d006a19 Made it acceptable to QNX's shell.
briano%netscape.com authored
179 else true; \
0e58583 Make sure .mozconfig.mk can be read. Even for first checkout. Pre-fill ...
slamm%netscape.com authored
180 fi; \
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
181 url=$$url`$(MOZCONFIG2URL)`; \
0e58583 Make sure .mozconfig.mk can be read. Even for first checkout. Pre-fill ...
slamm%netscape.com authored
182 echo Running netscape with the following url: ;\
183 echo ;\
184 echo $$url ;\
185 netscape -remote "openURL($$url)" || netscape $$url ;\
186 echo ;\
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
187 echo 1. Fill out the form on the browser. ;\
188 echo 2. Save the results to $(WEBCONFIG_FILE).
0f7f94e Fix bustage: OBJDIR wasn't defined correctly. (also add webconfig target...
slamm%netscape.com authored
189
190 # netscape -remote "saveAs($(WEBCONFIG_FILE))"
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
191
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
192 #####################################################
193 # First Checkout
194
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
195 ifdef _IS_FIRST_CHECKOUT
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
196 # First time, do build target in a new process to pick up new files.
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
197 build:
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
198 $(MAKE) -f $(TOPSRCDIR)/client.mk build
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
199 else
da3d45b Initial version
mcafee%netscape.com authored
200
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
201 #####################################################
202 # After First Checkout
203
204
205 ####################################
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
206 # Configure
207
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
208 ALL_TRASH += \
209 $(OBJDIR)/config.cache \
210 $(OBJDIR)/config.log \
211 $(OBJDIR)/config.status \
212 $(OBJDIR)/config-defs.h \
213 $(NULL)
214
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
215 CONFIG_STATUS := $(wildcard $(OBJDIR)/config.status)
216 CONFIG_CACHE := $(wildcard $(OBJDIR)/config.cache)
217
218 ifdef RUN_AUTOCONF_LOCALLY
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
219 EXTRA_CONFIG_DEPS := \
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
220 $(TOPSRCDIR)/aclocal.m4 \
221 $(TOPSRCDIR)/build/autoconf/gtk.m4 \
222 $(TOPSRCDIR)/build/autoconf/altoptions.m4 \
223 $(NULL)
224
43c116c Look for nspr in /usr/lib. Add nspr check to build target. New documenta...
slamm%netscape.com authored
225 $(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS)
533eaba updated to allow for one-step building
alecf%netscape.com authored
226 @echo Generating $@ using autoconf
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
227 cd $(TOPSRCDIR); $(AUTOCONF)
228 endif
533eaba updated to allow for one-step building
alecf%netscape.com authored
229
b140f4f Fix the dependencies for running configure.Have it depend on .client-def...
slamm%netscape.com authored
230 $(OBJDIR)/Makefile: $(TOPSRCDIR)/configure $(TOPSRCDIR)/allmakefiles.sh $(TOPSRCDIR)/.client-defs.mk
d006a19 Made it acceptable to QNX's shell.
briano%netscape.com authored
231 @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
232 @echo cd $(OBJDIR);
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
233 @echo ../configure
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
234 @cd $(OBJDIR) && \
235 $(TOPSRCDIR)/configure $(CONFIG_FLAGS) \
236 || echo Fix above errors and then restart with \"$(MAKE) -f client.mk build\"
237
238 ifdef CONFIG_STATUS
239 $(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
240 cd $(OBJDIR); \
241 CONFIG_FILES=config/autoconf.mk ./config.status
242 endif
533eaba updated to allow for one-step building
alecf%netscape.com authored
243
dc221d9 Added mozilla/configure target so that build: does not always run config...
cls%seawood.org authored
244
e2dd332 Add depend target. Move find-mozconfig.sh checkout into mozconfig2*.sh s...
slamm%netscape.com authored
245 ####################################
246 # Depend
247
248 depend:
249 @if test -d $(OBJDIR)/dist; then \
250 cd $(OBJDIR); $(MAKE) $@; \
251 else \
252 echo "$(MAKE): Skipping depend. No $(OBJDIR)/dist." 2>&1 ;\
253 fi
254
255 ####################################
256 # Build it
257
258 build: nspr $(OBJDIR)/Makefile
259 cd $(OBJDIR); $(MAKE);
260
261 ####################################
262 # Other targets
263
5d0fa52 Add clean targets. Add windows equivalent targets.
slamm%netscape.com authored
264 # Pass these target onto the real build system
265 clean realclean:
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
266 cd $(OBJDIR); $(MAKE) $@
267 rm -fr $(ALL_TRASH)
5d0fa52 Add clean targets. Add windows equivalent targets.
slamm%netscape.com authored
268
d4a0600 overhaul. Quit if conflicts during checkout. Make default target pull an...
slamm%netscape.com authored
269 # (! IS_FIRST_CHECKOUT)
270 endif
b6d5309 Let configure deal with nspr and pthreads insteads of client.mk Take pat...
slamm%netscape.com authored
271
272 .PHONY: checkout nspr depend build clean realclean
273
Something went wrong with that request. Please try again.