Newer
Older
# You will usually NOT need to edit this file at all: instead, edit the
# Make-common file. See the LDAP INSTALL file for more information.
#-----------------------------------------------------------------------------
# Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted only
# as authorized by the OpenLDAP Public License. A copy of this
# license is available at http://www.OpenLDAP.org/license.html or
# in file LICENSE in the top-level directory of the distribution.
#
# This work is derived from the University of Michigan LDAP v3.3
# distribution. Information concerning is available at
# http://www.umich.edu/~dirsvcs/ldap/ldap.html.
#
# This work also contains materials derived from public sources.
#-----------------------------------------------------------------------------
# Copyright (c) 1994 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#-----------------------------------------------------------------------------
# LDAP lightweight X.500 Directory access top level makefile
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#
############################################################################
# #
# Usually you will not need to edit anything in this file #
# #
############################################################################
#
# Note that these definitions of standard Unix utilities are only used
# in this Makefile. The Make-common (and .make-platform) files have a
# similar set of definitions that are used in all the other LDAP Makefiles.
#
RM=rm -f
MV=mv -f
CP=cp
CAT=cat
PWD=pwd
TAIL=tail
CHMOD=chmod
FIND=find
SED=sed
LN=ln -s
MKDIR=mkdir
GREP=grep
DIRNAME=dirname
BASENAME=basename
TAR=tar
COMPRESS=compress
CO=co
CI=ci
SRCDIRS= include libraries clients servers doc
TESTDIR= tests
#
# LDAPSRC is used by the links rule
#
LDAPSRC= ..
#
# rules to make the software
#
all: makeconfig
@echo "making all"
@for i in $(SRCDIRS); do \
echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \
( cd $$i; $(MAKE) $(MFLAGS) all ); \
done
lib-only: makeconfig
@echo "making libraries only"
@echo " cd include; $(MAKE) $(MFLAGS) all"; \
cd include; $(MAKE) $(MFLAGS) all
@echo " cd libraries; $(MAKE) $(MFLAGS) all"; \
cd libraries; $(MAKE) $(MFLAGS) all
#
# rules to install the software
#
install: makeconfig
@for i in $(SRCDIRS); do \
echo; echo "cd $$i; $(MAKE) $(MFLAGS) install"; \
( cd $$i; $(MAKE) $(MFLAGS) install ); \
done
inst-lib: makeconfig
@echo "cd libraries; $(MAKE) $(MFLAGS) install"
@( cd libraries; $(MAKE) $(MFLAGS) install )
#
# rules to test the LDAP software
#
test: all
@echo " cd $(TESTDIR); $(MAKE) $(MFLAGS) all"; \
( cd $(TESTDIR); $(MAKE) $(MFLAGS) all );
#
# rules to make clean
#
clean: FORCE
@if [ -f .makefiles ]; then \
for i in $(SRCDIRS) $(TESTDIR); do \
echo; echo "cd $$i; $(MAKE) $(MFLAGS) clean"; \
( cd $$i; $(MAKE) $(MFLAGS) clean ); \
done; \
fi; \
( for d in ./obj-*; do \
if [ $$d != "./obj-*" ]; then \
( echo "making clean in $$d..."; \
cd $$d; $(MAKE) $(MFLAGS) clean; ) \
else \
exit 0; \
fi; \
done )
veryclean: FORCE
@echo; echo "cd build; $(MAKE) $(MFLAGS) -f Make-template veryclean"; \
( cd build; $(MAKE) $(MFLAGS) -f Make-template veryclean ); \
if [ -f .makefiles ]; then \
for i in $(SRCDIRS) $(TESTDIR); do \
echo; echo "cd $$i; $(MAKE) $(MFLAGS) veryclean"; \
( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \
done; \
echo "finding and removing Makefiles..."; \
for i in `$(FIND) . -type d -print`; do \
if [ -f $$i/Make-template ]; then \
echo "removing file $$i/Makefile"; \
$(RM) $$i/Makefile; \
fi; \
done; \
echo "removing file .makefiles"; \
$(RM) .makefiles; \
fi; \
( for d in ./obj-*; do \
if [ $$d != "./obj-*" ]; then \
echo "removing $$d..."; $(RM) -r $$d; \
else \
exit 0; \
fi; \
done ); \
if [ -f .make-platform ]; then \
echo "removing link .make-platform"; \
$(RM) .make-platform; \
else \
exit 0; \
fi
#
# rules to make depend
#
#
depend: makeconfig
@echo "making depend everywhere"; \
echo " cd include; $(MAKE) $(MFLAGS) all"; \
( cd include; $(MAKE) $(MFLAGS) all ); \
for i in $(SRCDIRS); do \
echo; echo "cd $$i; $(MAKE) $(MFLAGS) depend"; \
( cd $$i; $(MAKE) $(MFLAGS) depend ); \
done;
@echo " "; echo Remember to \"make depend\" after each \"make makefiles\"
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#
# rules to check out and in Make-template files
#
co-mktmpls: FORCE
@echo "checking out Make-template files..."; \
for mkfile in `$(FIND) . -name Make-template -type f -print`; do \
$(CO) -l $$mkfile; \
done
ci-mktmpls: FORCE
@echo "enter a one-word log message:"; \
read logmsg; \
echo "checking in Make-template files..."; \
for mkfile in `$(FIND) . -name Make-template -type f -print`; do \
$(CI) -m$$logmsg -u $$mkfile; \
done
lib-depend: makeconfig
@echo "cd libraries; $(MAKE) $(MFLAGS) depend"
@( cd libraries; $(MAKE) $(MFLAGS) depend )"
#
# rules to cut a new ldap distribution
#
distribution: makeconfig checkin tar
checkin: FORCE
@-VERSION=V`cat ./build/version | $(SED) -e 's/\.//'` ; \
echo "Checking in version $$VERSION"; \
for i in `$(FIND) . -name \*,v -print | \
$(SED) -e 's%RCS/%%' -e 's%,v%%'`; \
do ( \
ci -m"pre-version $$VERSION check-in" -u $$i; \
rcs -N$$VERSION: $$i ) \
done
tar: veryclean
# $(RM) ./Make-common; \
# $(CP) ./Make-common.dist ./Make-common; \
# $(CHMOD) 644 ./Make-common; \
# $(RM) ./include/ldapconfig.h.edit; \
# $(CP) ./include/ldapconfig.h.dist ./include/ldapconfig.h.edit; \
# $(CHMOD) 644 ./include/ldapconfig.h.edit;
@PWD=`pwd`; \
BASE=`$(BASENAME) $$PWD`; XFILE=/tmp/ldap-x.$$$$; \
( cd .. ; $(CAT) $$BASE/exclude >$$XFILE; \
$(FIND) $$BASE -name RCS -print >> $$XFILE ; \
$(FIND) $$BASE -name CVS -print >> $$XFILE ; \
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
$(FIND) $$BASE -name obj-\* -print >> $$XFILE ; \
$(FIND) $$BASE -name tags -print >> $$XFILE ; \
$(TAR) cvfX ./$$BASE.tar $$XFILE $$BASE; \
); \
$(RM) $$XFILE; \
echo "compressing ../$$BASE.tar..."; \
$(COMPRESS) ../$$BASE.tar
#
# rule to force check for change of platform
#
platform: FORCE
@if [ -f .make-platform ]; then \
echo "removing old link .make-platform"; \
$(RM) .make-platform; \
fi; \
$(MAKE) $(MFLAGS) .make-platform
makeconfig: .makefiles buildtools
.make-platform:
@if [ -f /usr/bin/swconfig ]; then \
UNAME=./build/uname.sh; \
elif [ -f /bin/uname ]; then \
UNAME=/bin/uname; \
elif [ -f /usr/bin/uname ]; then \
UNAME=/usr/bin/uname; \
else \
UNAME=./build/uname.sh; \
fi; \
if [ -z "$$UNAME" ]; then \
echo "unknown platform (no $$UNAME or /usr/bin/uname)"; \
echo "see the file build/PORTS for more information."; \
exit 1; \
else \
OS=`$$UNAME -s` ; OSRELEASE=`$$UNAME -r` ; \
OSVERSION=`$$UNAME -v` ; \
case $$OS in \
SunOS) \
if [ $$OSRELEASE -gt "5" -o $$OSRELEASE -lt "4" ]; then \
echo "SunOS release $$OSRELEASE unknown..."; exit 1; \
fi; \
if [ $$OSRELEASE -ge "5" ]; then \
MINORVER=`echo $$OSRELEASE|sed 's/^.*\.//'` ; \
if [ $$MINORVER -ge "6" ]; then \
PLATFORM="sunos56" ; \
else \
PLATFORM="sunos5"; \
fi; \
else \
PLATFORM="sunos4"; \
fi; \
;; \
ULTRIX) \
PLATFORM="ultrix" \
;; \
OSF1) \
PLATFORM="osf1" \
;; \
AIX) \
PLATFORM="aix" \
;; \
HP-UX) \
PLATFORM="hpux" \
;; \
Linux) \
PLATFORM="linux" \
;; \
NetBSD) \
PLATFORM="netbsd" \
;; \
OpenBSD) \
PLATFORM="openbsd" \
;; \
MAJRELEASE=`echo $$OSRELEASE | sed 's/\..*//'` ; \
if [ $$MAJRELEASE -lt 3 ]; then \
PLATFORM="freebsd2" ; \
else \
PLATFORM="freebsd3" ; \
fi; \
;; \
NeXTSTEP) \
PLATFORM="nextstep" \
;; \
SCO) \
PLATFORM="sco" \
;; \
IRIX|IRIX64) \
PLATFORM="irix" \
;; \
*) echo "unknown platform ($$OS $$OSVERSION $$OSRELEASE)..."; \
echo "see the file build/PORTS for more information."; \
exit 1; \
;; \
esac; \
fi; \
OLDIFS="$$IFS"; \
IFS=":"; \
for dir in $$PATH; do \
if [ -f $$dir/gcc ]; then \
CC=gcc; \
break; \
fi; \
done; \
IFS="$$OLDIFS"; \
$(LN) ./build/platforms/$$PLATFORM-$$CC/Make-platform .make-platform; \
echo ""; \
echo "** Set platform to $$PLATFORM with compiler $$CC..."; \
echo ""
Make-common: Make-common.dist
@if [ -f Make-common ]; then \
echo "Make-common.dist newer than Make-common, check for new options" ;\
echo "or touch Make-common to ignore."; \
exit 1; \
fi; \
echo "Copy Make-common.dist or Make-common.gmake to Make-common"; \
echo " Edit as needed before making!" ; \
exit 1
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
#
# rule to build Makefiles by concatenating Make-template file in each
# subdirectory with global Make-common, .make-platform, and
# build/Make-append files
#
.makefiles: Make-common .make-platform build/Make-append
@echo "making Makefiles..."; \
HDRFILE=/tmp/Makehdr.$$$$; \
DEFSFILE=/tmp/Makedefs.$$$$; \
$(CAT) build/Make-append ./.make-platform ./Make-common > $$DEFSFILE; \
echo "# --------------------------------------------------------" > $$HDRFILE; \
echo "# This file was automatically generated. Do not edit it." >> $$HDRFILE; \
echo "# Instead, edit the Make-common file (located in the root" >> $$HDRFILE; \
echo "# (of the LDAP distribution). See the LDAP INSTALL file" >> $$HDRFILE; \
echo "# for more information." >> $$HDRFILE; \
echo "# --------------------------------------------------------" >> $$HDRFILE; \
echo "#" >> $$HDRFILE; \
for i in `$(FIND) . -type d -print`; do \
if [ -f $$i/Make-template ]; then \
echo " creating $$i/Makefile"; \
$(RM) $$i/Makefile; \
$(CAT) $$HDRFILE $$i/Make-template $$DEFSFILE > $$i/Makefile; \
fi; \
done; \
$(RM) .makefiles; \
touch .makefiles; \
#
# rule to always build makefiles
#
makefiles: FORCE
$(RM) .makefiles
$(MAKE) $(MFLAGS) .makefiles
@echo "Please \"make depend\" before building."
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
#
# rule to create any tools we need to build everything else
#
buildtools: FORCE
@echo "making buildtools"
@echo " cd build; $(MAKE) $(MFLAGS)"
@( cd build; $(MAKE) $(MFLAGS) )
#
# rule to make a shadow (linked) build area
#
links: FORCE
@if [ -f /usr/bin/swconfig ]; then \
UNAME=./build/uname.sh; \
elif [ -f /bin/uname ]; then \
UNAME=/bin/uname; \
elif [ -f /usr/bin/uname ]; then \
UNAME=/usr/bin/uname; \
else \
UNAME=./build/uname.sh; \
fi; \
if [ ! -z "$(DEST)" ]; then \
DEST="$(DEST)"; \
else \
DEST=./obj-`$$UNAME -s`-`$$UNAME -r` ; \
fi; \
echo "making links in $$DEST..."; \
LINKLIST=/tmp/ldaplinklist.$$$$; \
$(RM) $$LINKLIST; \
$(MKDIR) $$DEST; \
cd $$DEST; $(LN) $(LDAPSRC) .src; \
$(LN) .src/Makefile . ; \
$(CP) .src/Make-common . ; $(CHMOD) 644 ./Make-common; \
for d in build $(SRCDIRS) $(TESTDIR); do \
( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \
$(LN) .src/Make-template . ; \
$(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \
-f Make-template links ) ; \
done; \
echo ""; echo "Now type:"; echo " cd $$DEST"; echo "and make there"
FORCE: