1#
2# ***** BEGIN LICENSE BLOCK *****
3# Version: MPL 1.1/GPL 2.0/LGPL 2.1
4#
5# The contents of this file are subject to the Mozilla Public License Version
6# 1.1 (the "License"); you may not use this file except in compliance with
7# the License. You may obtain a copy of the License at
8# http://www.mozilla.org/MPL/
9#
10# Software distributed under the License is distributed on an "AS IS" basis,
11# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12# for the specific language governing rights and limitations under the
13# License.
14#
15# The Original Code is mozilla.org code.
16#
17# The Initial Developer of the Original Code is
18# Netscape Communications Corporation.
19# Portions created by the Initial Developer are Copyright (C) 1998
20# the Initial Developer. All Rights Reserved.
21#
22# Contributor(s):
23#
24# Alternatively, the contents of this file may be used under the terms of
25# either of the GNU General Public License Version 2 or later (the "GPL"),
26# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27# in which case the provisions of the GPL or the LGPL are applicable instead
28# of those above. If you wish to allow use of your version of this file only
29# under the terms of either the GPL or the LGPL, and not to allow others to
30# use your version of this file under the terms of the MPL, indicate your
31# decision by deleting the provisions above and replace them with the notice
32# and other provisions required by the GPL or the LGPL. If you do not delete
33# the provisions above, a recipient may use your version of this file under
34# the terms of any one of the MPL, the GPL or the LGPL.
35#
36# ***** END LICENSE BLOCK *****
37
38!if !defined(MOZ_TOP)
39#enable builds from changed top level directories
40MOZ_TOP=mozilla
41!endif
42
43#//------------------------------------------------------------------------
44#// Figure out how to do the pull.
45#//------------------------------------------------------------------------
46!if "$(MOZ_BRANCH)" != ""
47CVS_BRANCH=-r $(MOZ_BRANCH)
48HAVE_BRANCH=1
49!else
50HAVE_BRANCH=0
51!endif
52
53#//
54#// Temporary hardcode (while we figure out how to do this)
55#//	to support the Core modularity efforts...
56#//
57
58
59LDAPSDK_BRANCH =-r LDAPSDK_40_BRANCH
60
61!if "$(MOZ_DATE)" != ""
62CVS_BRANCH=-D "$(MOZ_DATE)"
63HAVE_DATE=1
64!else
65HAVE_DATE=0
66!endif
67
68!if $(HAVE_DATE) && $(HAVE_BRANCH)
69ERR_MESSAGE=$(ERR_MESSAGE)^
70Cannot specify both MOZ_BRANCH and MOZ_DATE
71!endif
72
73NMAKE=@nmake -nologo -$(MAKEFLAGS)
74
75#//------------------------------------------------------------------------
76#//
77#// Stuff a do complete pull and build
78#//
79#//------------------------------------------------------------------------
80
81default:: 		build_all
82
83pull_and_build_all::     pull_all    \
84			    build_all
85
86#// Do this when you pull a new tree, or else you will often get bugs
87#// when replaceing an old dist with a new dist.
88
89pull_clobber_build_all:: pull_all \
90			clobber_all \
91			build_all
92
93clobber_build_all:: 	clobber_all \
94			build_all
95
96# In theory, we should use some symbol in ns/config/liteness.mak,
97# but we haven't pulled the file yet.  So, refer to MOZ_LITE and
98# MOZ_MEDIUM explicitly .
99pull_all::
100
101
102#    -cvs co $(LDAPSDK_BRANCH) DirectorySDKSource
103
104
105
106#pull_client_source_product:
107#x-CEB-x    @echo +++ client.mak: checking out the client with "$(CVS_BRANCH)"
108#x-CEB-x    cd $(MOZ_SRC)\.
109#x-CEB-x    -cvs -d ":pserver:$(USERNAME)@cvsserver:/m/pub" co $(CVS_BRANCH) MozillaSourceWin
110#x-CEB-x    -cvs -d ":pserver:$(USERNAME)@cvsserver:/m/pub" co $(CVS_BRANCH) mozilla/lib/libnet
111
112build_all:              build_ldap
113
114
115
116build_ldap:
117    @echo +++ ldapsdk.mak: building ldap
118    cd $(MOZ_SRC)\mozilla\directory\c-sdk\ldap\libraries\msdos\winsock
119    @echo +++ ldapsdk.mak: depend step
120    $(NMAKE) -f nsldap.mak DEPEND=1
121    @echo +++ ldapsdk.mak: build step
122     $(NMAKE) -f nsldap.mak
123    @echo +++ ldapsdk.mak: library creation
124    $(NMAKE) -f nsldap.mak static
125    $(NMAKE) -f nsldap.mak dynamic
126    $(NMAKE) -f nsldap.mak EXPORT=1
127
128#
129# remove all source files from the tree and print a report of what was missed
130#
131clobber_all:
132    cd $(MOZ_SRC)\mozilla\directory\c-sdk\ldap\libraries\msdos\winsock
133    $(NMAKE) -f nsldap.mak clobber_all
134
135depend:
136    -del /s /q make.dep
137    $(NMAKE) -f makefile.win depend
138
139quick:
140    @cd $(MOZ_SRC)\.
141    @cvs co ns/quickup
142    @cd $(MOZ_SRC)\$(MOZ_TOP)\quickup
143    @$(MOZ_TOOLS)\perl5\perl doupdate.pl
144
145#//------------------------------------------------------------------------
146#// Utility stuff...
147#//------------------------------------------------------------------------
148
149#//------------------------------------------------------------------------
150# Verify that MOZ_SRC is set correctly
151#//------------------------------------------------------------------------
152
153# Check to see if it is set at all
154!if "$(MOZ_SRC)"!=""
155
156#
157# create a temp file at the root and make sure it is visible from MOZ_SRC
158#
159!if [copy $(MAKEDIR)\ldapsdk.mak $(MAKEDIR)\xyzzy.tmp > NUL] == 0
160!endif
161
162!if !EXIST( $(MOZ_SRC)\mozilla\directory\xyzzy.tmp )
163ERR_MESSAGE=$(ERR_MESSAGE)^
164MOZ_SRC isn't set correctly: [$(MOZ_SRC)\mozilla\directory]!=[$(MAKEDIR)]
165!endif
166
167!if [del $(MAKEDIR)\xyzzy.tmp]
168!endif
169
170!else
171# MOZ_SRC isn't set at all
172ERR_MESSAGE=$(ERR_MESSAGE)^
173Environment variable MOZ_SRC isn't set.
174!endif
175
176!if !defined(MOZ_TOOLS)
177ERR_MESSAGE=$(ERR_MESSAGE)^
178Environment variable MOZ_TOOLS isn't set.
179!endif
180
181
182#//------------------------------------------------------------------------
183#// Display error
184#//------------------------------------------------------------------------
185
186
187!if "$(ERR_MESSAGE)" != ""
188ERR_MESSAGE = ^
189ldapsdk.mak:  ^
190$(ERR_MESSAGE) ^
191^
192ldapsdk.mak: usage^
193^
194nmake -f ldapsdk.mak [MOZ_BRANCH=<cvs_branch_name>] ^
195		    [MOZ_DATE=<cvs_date>]^
196		    [pull_and_build_all]^
197		    [pull_all]^
198		    [build_all]^
199		    [build_ldap]^
200
201^
202Environment variables:^
203^
204MOZ_SRC     set to the directory above ns or "$(MAKEDIR)\.."^
205MOZ_TOOLS   set to the directory containing the java compiler see ^
206		http://warp/tools/nt^
207JAVA_HOME   set to the same thing as MOZ_TOOLS^
208
209!ERROR $(ERR_MESSAGE)
210
211!endif
212