openldap/servers/slapd/tools/Make-template
Kurt Zeilenga d2ef362f99 Removed use of paths not defined in ldapconfig.h.edit.
Fixed Dependency Generation not to mess with Make-templates.
	side effect: depends are not carried forward after "make makefiles"
1998-08-20 03:56:19 +00:00

174 lines
5.9 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 tools makefile
#
#-----------------------------------------------------------------------------
LDAPSRC = ../../..
HDIR = $(LDAPSRC)/include
LDIR = $(LDAPSRC)/libraries
VERSIONFILE = $(LDAPSRC)/build/version
EDB2LDIFSRCS = edb2ldif.c ldapsyntax.c
EDB2LDIFOBJS = edb2ldif.o ldapsyntax.o ../strdup.o
OBJS2 = ../config.o ../ch_malloc.o ../backend.o ../charray.o \
../aclparse.o ../schema.o ../result.o ../filterentry.o \
../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
../schemaparse.o ../regex.o ../strdup.o
INCLUDES= -I. -I$(HDIR) $(EXINCLUDES)
DEFINES = $(DEFS) $(LDAP_CRYPT) $(SERVERDEFS) $(THREADS)
CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS)
LDFLAGS = -L$(LDIR) $(EXLDFLAGS)
LIBS = -lldif -lldap -llber -lldbm -lavl $(LDBMLIB) $(EXLIBS) $(ALIBS)
LIBS2 = -lldif -lldbm -lavl $(LDBMLIB) -llber $(KRBLIBFLAG) $(KRBLIBS) \
-llthread $(THREADSLIB) $(ALIBS) $(LDAP_CRYPT_LIB)
all: build-edb2ldif ldif2index ldif2ldbm ldbmcat ldif2id2entry \
ldif2id2children centipede ldbmtest ldif
build-edb2ldif: FORCE
@if [ "$(HAVEISODE)" = "yes" ]; then \
$(MAKE) $(MFLAGS) CC=$(CC) EXINCLUDES="$(ISODEINCLUDEFLAG)" \
EXLDFLAGS="$(ISODELIBFLAG)" EXLIBS="$(ISODELIBS)" edb2ldif; \
else \
echo "uncomment the HAVEISODE=yes line in the Make-common file to build edb2ldif"; \
fi
edb2ldif: edb2-vers.o
$(CC) $(ALDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o \
$(LDFLAGS) $(LIBS)
edb2-vers.c: $(EDB2LDIFOBJS)
$(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}|" \
< Vers-edb2.c > $@)
build-chlog2replog: FORCE
@if [ "$(HAVEISODE)" = "yes" ]; then \
$(MAKE) $(MFLAGS) CC=$(CC) EXINCLUDES="$(ISODEINCLUDEFLAG)" \
EXLDFLAGS="$(ISODELIBFLAG)" EXLIBS="$(ISODELIBS)" chlog2replog; \
else \
echo "uncomment the HAVEISODE=yes line in the Make-common file to build chlog2replog"; \
fi
chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o
$(CC) $(ALDFLAGS) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o \
$(LDFLAGS) $(LIBS)
ldif2index: ldif2index.o ../libbackends.a $(OBJS2)
$(CC) $(ALDFLAGS) -o $@ ldif2index.o $(OBJS2) \
../libbackends.a $(LDFLAGS) $(LIBS2)
ldif2ldbm: ldif2ldbm.o ../libbackends.a $(OBJS2)
$(CC) $(ALDFLAGS) -o $@ ldif2ldbm.o $(OBJS2) \
../libbackends.a $(LDFLAGS) $(LIBS2)
ldif2id2entry: ldif2id2entry.o ../libbackends.a $(OBJS2)
$(CC) $(ALDFLAGS) -o $@ ldif2id2entry.o $(OBJS2) \
../libbackends.a $(LDFLAGS) $(LIBS2)
ldif2id2children: ldif2id2children.o ../libbackends.a $(OBJS2)
$(CC) $(ALDFLAGS) -o $@ ldif2id2children.o $(OBJS2) \
../libbackends.a $(LDFLAGS) $(LIBS2)
ldbmcat: ldbmcat.o
$(CC) $(ALDFLAGS) -o $@ ldbmcat.o $(LDFLAGS) $(LIBS)
ldif: ldif.o
$(CC) $(ALDFLAGS) -o $@ ldif.o $(LDFLAGS) $(LIBS) $(LIBS2)
centipede: centipede.o
$(CC) $(ALDFLAGS) -o $@ centipede.o $(LDFLAGS) $(LIBS) \
$(KRBLIBFLAG) $(KRBLIBS)
sizecount: sizecount.o ../phonetic.o ../ch_malloc.o
$(CC) $(ALDFLAGS) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o \
$(LDFLAGS) $(LIBS) $(KRBLIBFLAG) $(KRBLIBS)
ldbmtest: ldbmtest.o ../libbackends.a $(OBJS2)
$(CC) $(ALDFLAGS) -o ldbmtest ldbmtest.o $(OBJS2) \
../libbackends.a $(LDFLAGS) $(LIBS2)
install: $(LDAP_SBINDIR) $(LDAP_SBINDIR)/edb2ldif $(LDAP_SBINDIR)/ldif2ldbm \
$(LDAP_SBINDIR)/ldif2index $(LDAP_SBINDIR)/ldif2id2entry \
$(LDAP_SBINDIR)/ldif2id2children $(LDAP_SBINDIR)/ldbmcat \
$(LDAP_SBINDIR)/centipede $(LDAP_SBINDIR)/ldbmtest \
$(LDAP_SBINDIR)/ldif
$(LDAP_SBINDIR)/edb2ldif: build-edb2ldif
@if [ "$(HAVEISODE)" = "yes" ]; then \
$(INSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(LDAP_SBINDIR); \
else \
exit 0; \
fi
$(LDAP_SBINDIR)/chlog2replog: build-chlog2replog
@if [ "$(HAVEISODE)" = "yes" ]; then \
$(INSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(LDAP_SBINDIR); \
else \
exit 0; \
fi
$(LDAP_SBINDIR)/ldif2ldbm: ldif2ldbm
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(LDAP_SBINDIR)
$(LDAP_SBINDIR)/ldif2index: ldif2index
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(LDAP_SBINDIR)
$(LDAP_SBINDIR)/ldif2id2entry: ldif2id2entry
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(LDAP_SBINDIR)
$(LDAP_SBINDIR)/ldif2id2children: ldif2id2children
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(LDAP_SBINDIR)
$(LDAP_SBINDIR)/ldbmcat: ldbmcat
$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(LDAP_SBINDIR)
$(LDAP_SBINDIR)/ldif: ldif
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif $(LDAP_SBINDIR)
$(LDAP_SBINDIR)/centipede: centipede
$(INSTALL) $(INSTALLFLAGS) -m 755 centipede $(LDAP_SBINDIR)
$(LDAP_SBINDIR)/ldbmtest: ldbmtest
$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(LDAP_SBINDIR)
lint: FORCE
$(LINT) $(INCLUDES) $(DEFINES) $(SRCS)
5lint: FORCE
$(5LINT) $(INCLUDES) $(DEFINES) $(SRCS)
clean: FORCE
@echo "making clean in `$(PWD)`"
$(RM) edb2ldif ldif2index *.o core a.out edb2-vers.c \
ldif2ldbm ldif2id2entry ldif2id2children ldbmcat ldif \
centipede chlog2replog sizecount ldbmtest
depend: FORCE
@if [ ! -z "$(HAVEISODE)" ]; then \
DEPENDEXTRAS="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
fi; \
$(MKDEP) $(INCLUDES) $(DEFINES) $$DEPENDEXTRAS ldif2index.c \
ldif2ldbm.c ldif2id2entry.c ldif2id2children.c ldbmcat.c \
centipede.c sizecount.c ldbmtest.c ldif.c
links:
@echo "making links in `$(PWD)`"
@$(LN) .src/*.[ch] .