mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
d2ef362f99
Fixed Dependency Generation not to mess with Make-templates. side effect: depends are not carried forward after "make makefiles"
168 lines
5.4 KiB
Plaintext
168 lines
5.4 KiB
Plaintext
#-----------------------------------------------------------------------------
|
|
# Copyright (c) 1995 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.
|
|
#
|
|
# Stand alone LDAP server daemon makefile
|
|
#
|
|
#-----------------------------------------------------------------------------
|
|
LDAPSRC = ../..
|
|
HDIR = $(LDAPSRC)/include
|
|
LDIR = $(LDAPSRC)/libraries
|
|
VERSIONFILE = $(LDAPSRC)/build/version
|
|
|
|
SRCS = main.c daemon.c connection.c search.c filter.c add.c charray.c \
|
|
attr.c entry.c config.c backend.c result.c operation.c \
|
|
dn.c compare.c modify.c delete.c modrdn.c ch_malloc.c \
|
|
value.c ava.c bind.c unbind.c abandon.c filterentry.c \
|
|
phonetic.c regex.c acl.c str2filter.c aclparse.c init.c \
|
|
detach.c strdup.c tempnam.c repl.c lock.c \
|
|
schema.c schemaparse.c monitor.c configinfo.c
|
|
OBJS = main.o daemon.o connection.o search.o filter.o add.o charray.o \
|
|
attr.o entry.o config.o backend.o result.o operation.o \
|
|
dn.o compare.o modify.o delete.o modrdn.o ch_malloc.o \
|
|
value.o ava.o bind.o unbind.o abandon.o filterentry.o \
|
|
phonetic.o regex.o acl.o str2filter.o aclparse.o init.o \
|
|
detach.o strdup.o tempnam.o repl.o lock.o \
|
|
schema.o schemaparse.o monitor.o configinfo.o
|
|
|
|
INCLUDES= -I. -I$(HDIR) $(KRBINCLUDEFLAG)
|
|
DEFINES = $(DEFS) $(LDAP_CRYPT) $(LDAP_TCP_WRAPPERS) $(SERVERDEFS)
|
|
CFLAGS = $(INCLUDES) $(THREADSINCLUDE) $(DEFINES) $(ACFLAGS) $(THREADS)
|
|
LDFLAGS = -L$(LDIR) $(KRBLIBFLAG)
|
|
LIBS = $(KRBLIBS) -llber -lldbm -lavl -llthread -lldif $(THREADSLIB) \
|
|
$(LDBMLIB) $(LDAP_CRYPT_LIB) $(LDAP_TCP_WRAPPERS_LIB) $(ALIBS)
|
|
|
|
all: FORCE
|
|
@if [ -z "$(MAKESLAPD)" ]; then \
|
|
echo "uncomment the MAKESLAPD line in Make-common to make slapd"; \
|
|
exit 0; \
|
|
else \
|
|
echo; \
|
|
$(MAKE) $(MFLAGS) backendslib; \
|
|
$(MAKE) $(MFLAGS) slapd; \
|
|
(cd tools; $(MAKE) $(MFLAGS) all); \
|
|
fi
|
|
|
|
backendslib: FORCE
|
|
@for i in back-*; do \
|
|
if [ -d $$i ]; then \
|
|
echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \
|
|
( cd $$i; $(MAKE) $(MFLAGS) all ); \
|
|
fi; \
|
|
done; \
|
|
echo; \
|
|
$(MAKE) $(MFLAGS) libbackends.a
|
|
|
|
libbackends.a: .backend
|
|
@$(RM) -r tmp
|
|
@$(MKDIR) tmp
|
|
@-for i in back-*/*.a; do \
|
|
( \
|
|
cd tmp; \
|
|
$(AR) x ../$$i; \
|
|
pre=`echo $$i | sed -e 's/\/.*$$//' -e 's/back-//'`; \
|
|
for j in *.o; do \
|
|
mv $$j $${pre}$$j; \
|
|
done; \
|
|
$(AR) ruv libbackends.a *.o 2>&1 | grep -v truncated; \
|
|
$(RM) *.o __.SYMDEF; \
|
|
echo "added backend library $$i"; \
|
|
); \
|
|
done
|
|
@mv -f tmp/libbackends.a ./libbackends.a
|
|
@$(RM) -r tmp
|
|
@if [ ! -z "$(RANLIB)" ]; then \
|
|
$(RANLIB) libbackends.a; \
|
|
fi
|
|
@ls -l libbackends.a
|
|
|
|
slapd: version.o
|
|
$(CC) $(ALDFLAGS) -o slapd $(OBJS) version.o libbackends.a \
|
|
$(LDFLAGS) $(LIBS)
|
|
slapd.pure: version.o
|
|
purify $(CC) $(ALDFLAGS) -o slapd.pure $(OBJS) version.o libbackends.a \
|
|
$(LDFLAGS) $(LIBS)
|
|
|
|
version.c: libbackends.a $(OBJS) $(LDIR)/liblber/liblber.a \
|
|
$(LDIR)/libldbm/libldbm.a $(LDIR)/liblthread/liblthread.a \
|
|
$(LDIR)/libavl/libavl.a $(LDIR)/libldif/libldif.a
|
|
$(RM) $@
|
|
(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
|
|
t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
|
|
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
|
|
-e "s|%VERSION%|$${v}|" \
|
|
< Version.c > $@)
|
|
|
|
install: all $(LDAP_LIBEXECDIR) $(LDAP_LIBEXECDIR)/slapd \
|
|
$(LDAP_ETCDIR) $(LDAP_ETCDIR)/slapd.conf \
|
|
$(LDAP_ETCDIR)/slapd.at.conf $(LDAP_ETCDIR)/slapd.oc.conf \
|
|
install-tools
|
|
|
|
$(LDAP_LIBEXECDIR)/slapd: slapd
|
|
$(INSTALL) $(INSTALLFLAGS) -m 755 slapd $(LDAP_LIBEXECDIR)
|
|
|
|
$(LDAP_ETCDIR)/slapd.conf: slapd.conf
|
|
$(SED) -e 's;%ETCDIR%;$(LDAP_ETCDIR);' slapd.conf > /tmp/slapd.$$
|
|
-$(MV) $(LDAP_ETCDIR)/slapd.conf $(LDAP_ETCDIR)/slapd.conf-
|
|
$(INSTALL) $(INSTALLFLAGS) -m 644 /tmp/slapd.$$ $(LDAP_ETCDIR)/slapd.conf
|
|
$(RM) -f /tmp/slapd.$$
|
|
|
|
$(LDAP_ETCDIR)/slapd.at.conf: slapd.at.conf
|
|
-$(MV) $(LDAP_ETCDIR)/slapd.at.conf $(LDAP_ETCDIR)/slapd.at.conf-
|
|
$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.at.conf $(LDAP_ETCDIR)
|
|
|
|
$(LDAP_ETCDIR)/slapd.oc.conf: slapd.oc.conf
|
|
-$(MV) $(LDAP_ETCDIR)/slapd.oc.conf $(LDAP_ETCDIR)/slapd.oc.conf-
|
|
$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.oc.conf $(LDAP_ETCDIR)
|
|
|
|
install-tools: FORCE
|
|
(cd tools; $(MAKE) $(MFLAGS) install)
|
|
|
|
lint: FORCE
|
|
$(LINT) $(INCLUDES) $(DEFINES) $(SRCS)
|
|
|
|
5lint: FORCE
|
|
$(5LINT) $(INCLUDES) $(DEFINES) $(SRCS)
|
|
|
|
clean: FORCE
|
|
@echo "making clean in `$(PWD)`"
|
|
$(RM) slapd slapd.pure *.o core a.out version.c libbackends.a .backend
|
|
@for i in back-* tools; do \
|
|
if [ -d $$i -a $$i != "RCS" ]; then \
|
|
echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \
|
|
( cd $$i; $(MAKE) $(MFLAGS) clean ); \
|
|
fi; \
|
|
done
|
|
|
|
depend: FORCE
|
|
$(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS)
|
|
@for i in back-* tools; do \
|
|
if [ -d $$i -a $$i != "RCS" ]; then \
|
|
echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \
|
|
( cd $$i; $(MAKE) $(MFLAGS) depend ); \
|
|
fi; \
|
|
done
|
|
|
|
|
|
links:
|
|
@echo "making links in `$(PWD)`"
|
|
@$(LN) .src/*.[ch] .src/*.conf .
|
|
@touch .backend
|
|
@for i in .src/back-* .src/tools; do \
|
|
if [ -d $$i -a $$i != ".src/RCS" ]; then \
|
|
d=`basename $$i`; \
|
|
( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \
|
|
$(LN) ../.src/$$d/Make-template . ; \
|
|
$(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \
|
|
-f Make-template links ) ; \
|
|
fi; \
|
|
done;
|
|
|