1
# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3
# ***** BEGIN LICENSE BLOCK *****
4
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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
16
# The Original Code is mozilla.org code.
18
# The Initial Developer of the Original Code is
19
# Netscape Communications Corporation.
20
# Portions created by the Initial Developer are Copyright (C) 1999
21
# the Initial Developer. All Rights Reserved.
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.
37
# ***** END LICENSE BLOCK *****
40
##############################################################################
42
# Makefile for the LDAP classes
44
# This makefile requires the following variables to be defined (either as
45
# environment variables or on the make invocation line):
46
# - MOZ_SRC the root of your CVS tree
47
# - JAVA_VERSION the Java version in the format n.n (e.g. 1.4)
48
# - JAVA_HOME the Java root directory
50
# A debug compile (java -g) is done by default. You can specify "DEBUG=0" on
51
# the make line to compile with '-O' option.
54
# To compile and package ldapjdk, use 'classes' and 'package' as make targets.
55
# You can compile only subsets of the classes by specifying one or more
56
# of the following: MAIN BER OPERS CLIENT CONTROLS UTIL FACTORY ERRORS SASL
57
# SASLMECHANISM TOOLS.
60
# To create and package javadoc, use 'doc' and 'docpackage' as targets.
63
# To compile and package ldapbeans, use 'beanclasses' and 'beanpackage'
67
# To compile the optional ldapfilter package, you must have OROMatcher(R)
68
# java regular expressions package com.oroinc.text.regex in your CLASSPATH.
69
# The package is available at http://www.oroinc.com. Use 'filterclasses'
70
# and 'filterpackage' as make targets.
72
##############################################################################
76
@echo "MOZ_SRC is undefined"
77
@echo " MOZ_SRC=<root directory of your CVS tree>"
78
@echo " Usage example : gmake -f ldap.mk MOZ_SRC=c:\mozilla
81
@echo "MOZ_SRC is $(MOZ_SRC)"
85
@echo "JAVA_VERSION is undefined"
86
@echo " JAVA_VERSION=n.n where n.n is 1.1, 1.2, 1.3, 1.4, etc."
87
@echo " Usage example : gmake -f ldap.mk JAVA_VERSION=1.4"
90
@echo "JAVA_VERSION is $(JAVA_VERSION)"
93
ifeq ($(JAVA_VERSION), 1.1)
94
@echo "JAVA_HOME is undefined"
95
@echo " JAVA_HOME=<directory where java is installed>"
96
@echo " Usage example : gmake -f ldap.mk JAVA_HOME=c:\jdk1.1.8 JAVA_VERSION=1.1"
99
@echo "WARNING: JAVA_HOME is undefined; Using java from the PATH, expected version is" $(JAVA_VERSION)
103
@echo "JAVA_HOME is $(JAVA_HOME)"
106
ARCH := $(shell uname -s)
109
ifeq ($(ARCH), WINNT)
110
MOZ_DIR:=$(subst \,/,$(MOZ_SRC))
111
BASEDIR:=$(MOZ_DIR)/mozilla/directory/java-sdk
113
ifeq ($(ARCH), WIN95)
114
MOZ_DIR:=$(subst \,/,$(MOZ_SRC))
115
BASEDIR:=$(MOZ_DIR)/mozilla/directory/java-sdk
117
BASEDIR := $(shell cd $(MCOM_ROOT); pwd)
121
ifeq ($(ARCH), WINNT)
122
JDK := $(subst \,/,$(JAVA_HOME))
125
ifeq ($(ARCH), WIN95)
126
JDK := $(subst \,/,$(JAVA_HOME))
134
JSS_LIB=$(BASEDIR)/ldapjdk/lib/jss32_stub.jar
135
JAASLIB=$(BASEDIR)/ldapjdk/lib/jaas.jar
136
JSSELIB=$(BASEDIR)/ldapjdk/lib/jnet.jar$(SEP)$(BASEDIR)/ldapjdk/lib/jsse.jar
138
# Set up the JAVACLASSPATH
139
JAVACLASSPATH:=$(CLASSPATH)$(SEP)$(BASEDIR)/ldapjdk
140
ifeq ($(JAVA_VERSION), 1.1)
141
JAVACLASSPATH:=$(JDK)/lib/classes.zip$(SEP)$(JAVACLASSPATH)$(SEP)$(JAASLIB)
143
ifeq ($(JAVA_VERSION), 1.2)
144
JAVACLASSPATH:=$(JAVACLASSPATH)$(SEP)$(JAASLIB)$(SEP)$(JSSELIB)$(SEP)$(JSS_LIB)
146
ifeq ($(JAVA_VERSION), 1.3)
147
JAVACLASSPATH:=$(JAVACLASSPATH)$(SEP)$(JAASLIB)$(SEP)$(JSSELIB)$(SEP)$(JSS_LIB)
150
JAVACLASSPATH:=$(JAVACLASSPATH)$(SEP)$(JSS_LIB)
161
#defualt mode is debug (-g)
162
JAVAC=$(JDKBIN)javac -g -classpath "$(JAVACLASSPATH)"
165
JAVAC=$(JDKBIN)javac -g -classpath "$(JAVACLASSPATH)"
167
JAVAC=$(JDKBIN)javac -O -classpath "$(JAVACLASSPATH)"
177
JAVADOC=$(JDKBIN)javadoc -classpath "$(JAVACLASSPATH)$(SEP)$(BASEDIR)/ldapbeans"
180
# Destination for class files and packages
181
CLASS_DEST=$(BASEDIR)/dist/classes
184
DISTDIR=$(MCOM_ROOT)/dist
185
CLASSDIR=$(MCOM_ROOT)/dist/classes
186
CLASSPACKAGEDIR=$(DISTDIR)/packages
187
BASEPACKAGENAME=ldapjdk.jar
189
TOOLSTARGETDIR=$(DISTDIR)/tools
190
TOOLSDIR=$(BASEDIR)/tools
192
ERRORSDIR=$(CLASSDIR)/netscape/ldap/errors
193
SASLDIR=com/netscape/sasl
194
SASLMECHANISMDIR=com/netscape/sasl/mechanisms
198
basics: .CHECK_VARS $(DISTDIR) $(CLASSDIR)
204
basepackage: $(CLASSPACKAGEDIR)
205
cd $(DISTDIR)/classes; rm -f ../packages/$(BASEPACKAGENAME); $(JAR) cvf ../packages/$(BASEPACKAGENAME) netscape/ldap/*.class netscape/ldap/client/*.class netscape/ldap/client/opers/*.class netscape/ldap/ber/stream/*.class netscape/ldap/controls/*.class netscape/ldap/factory/*.class netscape/ldap/util/*.class netscape/ldap/errors/*.props com/netscape/sasl/*.class com/netscape/sasl/mechanisms/*.class *.class
208
cd ldapjdk/$(SRCDIR); $(JAVAC) -d "$(CLASS_DEST)" *.java
211
ifneq ($(JAVA_VERSION), 1.1)
212
cd ldapjdk/$(SRCDIR)/factory; $(JAVAC) -d "$(CLASS_DEST)" *.java
216
cd ldapjdk/$(SRCDIR)/client; $(JAVAC) -d "$(CLASS_DEST)" *.java
219
cd ldapjdk/$(SRCDIR)/client/opers; $(JAVAC) -d "$(CLASS_DEST)" *.java
222
cd ldapjdk/$(SRCDIR)/ber/stream; $(JAVAC) -d "$(CLASS_DEST)" *.java
225
cd ldapjdk/$(SRCDIR)/util; $(JAVAC) -d "$(CLASS_DEST)" *.java
227
SASLMECHANISM: basics
228
cd ldapjdk/$(SASLMECHANISMDIR); $(JAVAC) -d "$(CLASS_DEST)" *.java
231
cd ldapjdk/$(SASLDIR); $(JAVAC) -d "$(CLASS_DEST)" *.java
233
ERRORS: basics $(ERRORSDIR)
234
cp -p ldapjdk/$(SRCDIR)/errors/*.props $(ERRORSDIR)
237
cd ldapjdk/$(SRCDIR)/controls; $(JAVAC) -d "$(CLASS_DEST)" *.java
240
cd tools; $(JAVAC) -d "$(CLASS_DEST)" *.java
242
LDAPCLASSES: BER OPERS CLIENT MAIN FACTORY UTIL CONTROLS ERRORS SASL SASLMECHANISM TOOLS
244
##########################################################################
246
##########################################################################
247
DOCDIR=$(DISTDIR)/doc
249
DOCPACKAGE=$(CLASSPACKAGEDIR)/$(DOCNAME)
251
BERDOCCLASSES=netscape.ldap.ber.stream
252
SASLDOCCLASSES=com.netscape.sasl com.netscape.sasl.mechanisms
253
ifneq ($(JAVA_VERSION), 1.1)
254
FACTORYDOCCLASSES := netscape.ldap.factory
257
DOCCLASSES=netscape.ldap netscape.ldap.beans netscape.ldap.controls \
258
netscape.ldap.util $(FACTORYDOCCLASSES) \
259
$(SASLDOCCLASSES) $(TOOLSDIR)/*.java $(BERDOCCLASSES)
261
doc: $(DISTDIR) $(DOCDIR)
262
$(JAVADOC) -d $(DOCDIR) $(DOCCLASSES)
264
docpackage: $(DOCDIR) $(CLASSPACKAGEDIR)
265
cd $(DOCDIR); rm -f ../packages/$(DOCNAME); $(JAR) cvf ../packages/$(DOCNAME) *.html *.css netscape/ldap/*.html netscape/ldap/beans/*.html netscape/ldap/controls/*.html netscape/ldap/util/*.html netscape/ldap/ber/stream/*.html
268
##########################################################################
270
##########################################################################
271
BEANDIR=$(BASEDIR)/ldapbeans/netscape/ldap/beans
272
BEANPACKAGENAME=ldapbeans.jar
275
cd ldapbeans/$(SRCDIR)/beans; $(JAVAC) -d "$(CLASS_DEST)" *.java
277
beanpackage: $(CLASSPACKAGEDIR)
278
cd $(DISTDIR)/classes; rm -f ../packages/$(BEANPACKAGENAME); $(JAR) cvf ../packages/$(BEANPACKAGENAME) netscape/ldap/beans
280
##########################################################################
282
##########################################################################
283
FILTERCLASSDIR=$(MCOM_ROOT)/dist/ldapfilt
284
FILTER_CLASS_DEST=$(BASEDIR)/dist/ldapfilt
285
FILTERJAR=ldapfilt.jar
287
filterclasses: $(FILTERCLASSDIR)
288
cd ldapfilter/netscape/ldap/util; $(JAVAC) -d "$(FILTER_CLASS_DEST)" *.java
290
filterpackage: $(CLASSPACKAGEDIR)
291
cd "$(FILTER_CLASS_DEST)"; rm -f ../packages/$(FILTERJAR); $(JAR) cvf ../packages/$(FILTERJAR) netscape/ldap/util/*.class