Now to sort out configure enable/with options.
+##---------------------------------------------------------------------------
##
## Makes subdirectories
##
-all: allsubs
-allsubs: FORCE
+
+all-common: all-local FORCE
@echo "Making all in `$(PWD)`"
@for i in $(SUBDIRS); do \
echo " Entering subdirectory $$i"; \
echo " "; \
done
-install: installsubs
-installsubs: FORCE
+install-common: install-local FORCE
@echo "Making install in `$(PWD)`"
@for i in $(SUBDIRS); do \
echo " Entering subdirectory $$i"; \
echo " "; \
done
-clean: cleansubs
-cleansubs: FORCE
+clean-common: clean-local FORCE
@echo "Making clean in `$(PWD)`"
@for i in $(SUBDIRS); do \
echo " Entering subdirectory $$i"; \
echo " "; \
done
-veryclean: verysubs
-verysubs: FORCE
+veryclean-common: veryclean-local FORCE
@echo "Making veryclean in `$(PWD)`"
@for i in $(SUBDIRS); do \
echo " Entering subdirectory $$i"; \
echo " "; \
done
-depend: dependsubs
-dependsubs: FORCE
+depend-common: depend-local FORCE
@echo "Making depend in `$(PWD)`"
@for i in $(SUBDIRS); do \
echo " Entering subdirectory $$i"; \
+##---------------------------------------------------------------------------
##
## Makefile Template for Non-Source Directories
##
+##---------------------------------------------------------------------------
##
## Makefile Template for Libraries
##
-all: $(LIBRARY) $(PROGRAMS)
+all-common: $(LIBRARY) $(PROGRAMS)
$(LIBRARY): version.o
$(AR) ru $@ $(OBJS) version.o
-e "s|%VERSION%|$${v}|" \
< Version.c > $@)
-install: all
+install-common: install-local
-lint: FORCE
+lint: lint-local FORCE
$(LINT) $(DEFS) $(DEFINES) $(SRCS)
-lint5: FORCE
+lint5: lint5-local FORCE
$(5LINT) $(DEFS) $(DEFINES) $(SRCS)
-clean: FORCE
+clean-common: clean-local
$(RM) $(LIBRARY) ../$(LIBRARY) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) \
*.o a.out core version.c
-depend: FORCE
+depend-common: depend-local
$(MKDEP) $(DEFS) $(DEFINES) $(SRCS)
+veryclean-common: veryclean-local clean-common
+
+lint-local: FORCE
+lint5-local: FORCE
+##---------------------------------------------------------------------------
##
## Makefile Template for Programs
##
-all: $(PROGRAMS)
+all-common: all-local $(PROGRAMS)
-install: all
+install-common: all install-local
-lint: FORCE
- $(LINT) $(DEFS) $(DEFINES) $(SRCS)
-
-lint5: FORCE
- $(5LINT) $(DEFS) $(DEFINES) $(SRCS)
+clean-common: clean-local
+ $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) *.o a.out core
-clean: FORCE
- $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) \
- *.o a.out core
+veryclean-common: veryclean-local clean-local
-depend: FORCE
+depend-common: depend-local
$(MKDEP) $(DEFS) $(DEFINES) $(SRCS)
+lint: lint-local
+ $(LINT) $(DEFS) $(DEFINES) $(SRCS)
+
+lint5: lint5-local
+ $(5LINT) $(DEFS) $(DEFINES) $(SRCS)
+
+# these could be empty
+lint-local: FORCE
+lint5-local: FORCE
+##---------------------------------------------------------------------------
##
## Makefile Template for Servers
##
-all: FORCE
+all-common: FORCE
@if [ "$(BUILD_SRV)" = "yes" ]; then \
$(MAKE) $(MFLAGS) all-srv; \
else \
echo "run configure with $(BUILD_OPT) to build $(PROGRAMS)"; \
fi
-clean: clean-srv FORCE
-lint: FORCE
+clean-common: FORCE
+ @if [ "$(BUILD_SRV)" = "yes" ]; then \
+ $(MAKE) $(MFLAGS) clean-srv; \
+ else \
+ echo "run configure with $(BUILD_OPT) to clean $(PROGRAMS)"; \
+ fi
+
+veryclean-common: FORCE
+ @if [ "$(BUILD_SRV)" = "yes" ]; then \
+ $(MAKE) $(MFLAGS) veryclean-srv; \
+ else \
+ echo "run configure with $(BUILD_OPT) to very clean $(PROGRAMS)"; \
+ fi
+
+lint-common: FORCE
@if [ "$(BUILD_SRV)" = "yes" ]; then \
$(MAKE) $(MFLAGS) lint-srv; \
else \
echo "run configure with $(BUILD_OPT) to lint $(PROGRAMS)"; \
fi
-5lint: FORCE
+5lint-common: FORCE
@if [ "$(BUILD_SRV)" = "yes" ]; then \
$(MAKE) $(MFLAGS) 5lint-srv; \
else \
echo "run configure with $(BUILD_OPT) to 5lint $(PROGRAMS)"; \
fi
-depend: FORCE
+depend-common: FORCE
@if [ "$(BUILD_SRV)" = "yes" ]; then \
$(MAKE) $(MFLAGS) depend-srv; \
else \
- echo "run configure with $(BUILD_OPT) to mkdepend $(PROGRAMS)"; \
+ echo "run configure with $(BUILD_OPT) to depend $(PROGRAMS)"; \
+ fi
+
+install-common: FORCE
+ @if [ "$(BUILD_SRV)" = "yes" ]; then \
+ $(MAKE) $(MFLAGS) install-srv; \
+ else \
+ echo "run configure with $(BUILD_OPT) to install $(PROGRAMS)"; \
fi
-all-srv: FORCE
+all-srv: all-local
-install-srv: all-srv FORCE
+install-srv: all-srv install-local
-lint-srv: FORCE
+lint-srv: lint-local
$(LINT) $(DEFS) $(DEFINES) $(SRCS)
-5lint-srv: FORCE
+5lint-srv: lint5-local
$(5LINT) $(DEFS) $(DEFINES) $(SRCS)
-clean-srv: FORCE
- $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) \
- *.o a.out core
+clean-srv: clean-local
+ $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) *.o a.out core
-depend-srv: FORCE
+depend-srv: depend-local
$(MKDEP) $(DEFS) $(DEFINES) $(SRCS)
+
+veryclean-srv: clean-srv veryclean-local
CFLAGS = $(AC_CFLAGS) $(DEFS) $(DEFINES)
LDFLAGS = $(AC_LDFLAGS)
-default: all
+all: all-common FORCE
+install: install-common FORCE
+clean: clean-common FORCE
+veryclean: veryclean-common FORCE
+depend: depend-common FORCE
+
+# empty local rules
+all-local:
+install-local:
+clean-local:
+veryclean-local:
+depend-local:
+lint-local:
+lint5-local:
Makefile: Makefile.in ${top_srcdir}/config.status
@if [ $(top_srcdir) = $(srcdir) ]; then ; \
# empty rule for forcing rules
FORCE:
+
+##---------------------------------------------------------------------------
dnl contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
dnl contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
dnl contrib/whois++/Makefile:build/top.mk:contrib/whois++/Makefile.in:build/rules.mk \
-dnl servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
dnl Makefile:build/top.mk:Makefile.in:build/dir.mk, \
dnl [date > stamp-h])
libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
+servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
##
## include Makefile.in for OpenLDAP
-install: all FORCE
+all-local: ldapconfig.h FORCE
+
+install-local: FORCE
-$(MKDIR) -p $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 ldap.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 lber.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 disptmpl.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 srchpref.h $(includedir)
-all: ldapconfig.h FORCE
-
-clean: FORCE
+clean-local: FORCE
$(RM) ldapconfig.h
-veryclean: clean FORCE
-depend: ldapconfig.h FORCE
+veryclean-local: clean-local FORCE
+
+depend-local: ldapconfig.h FORCE
ldapconfig.h: ldapconfig.h.edit Makefile
@$(RM) $@
+ @echo "Making ldapconfig.h"
@echo "/*" > $@; \
- echo " * This file was automatically generated. Do not edit it." >> $@; \
- echo " * Instead, edit the file ldapconfig.h.edit. See the LDAP" >> $@; \
- echo " * INSTALL file for more information." >> $@; \
- echo " */ " >> $@; \
- echo "" >> $@; \
+ echo " * This file was automatically generated. Do not edit it." >> $@; \
+ echo " * Instead, edit the file ldapconfig.h.edit. See the LDAP" >> $@; \
+ echo " * INSTALL file for more information." >> $@; \
+ echo " */ " >> $@; \
+ echo "" >> $@; \
$(SED) \
-e 's;%SYSCONFDIR%;$(sysconfdir);' \
-e 's;%BINDIR%;$(bindir);' \
ldapconfig.h.edit >> $@; \
$(CHMOD) 444 $@
+all-common: all-local
+install-common: install-local
+clean-common: clean-local
+veryclean-common: veryclean-local
+depend-common: depend-local
LIBRARY = liblber.a
-install: $(LIBRARY) FORCE
+install-local: $(LIBRARY) FORCE
-$(MKDIR) -p $(libdir)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(libdir)
@(cd /tmp; $(RANLIB) $(libdir)/$(LIBRARY))
$(CC) $(LDFLAGS) -o $@ test.o $(LIBS)
CFFILES= ldapfilter.conf ldapfriendly ldaptemplates.conf ldapsearchprefs.conf
-install: $(LIBRARY) $(CFFILES) FORCE
+
+install-local: $(LIBRARY) $(CFFILES) FORCE
-$(MKDIR) -p $(libdir)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(libdir)
@(cd /tmp; $(RANLIB) $(libdir)/$(LIBRARY))
##
## Makefile for -lldbm
##
+
LIBRARY = libldbm.a
XPROGRAMS = testldbm
SRCS = ldbm.c
##
## Makefile for -lldif
##
+
LIBRARY = libldif.a
SRCS = line64.c
OBJS = line64.o
##
## Makefile for -llthread
##
+
LIBRARY = liblthread.a
XSRCS = version.c
SRCS = thread.c stack.c
##
## Makefile for -lutil
##
+
LIBRARY = liblutil.a
SRCS = base64.c md5.c sha1.c
OBJS = base64.o md5.o sha1.o
--- /dev/null
+##
+## Makefile.in for ldapd
+##
+PROGRAMS=ldapd
+XPROGRAMS=sldapd
+SRCS = main.c detach.c setproctitle.c request.c bind.c result.c error.c \
+ search.c util.c compare.c message.c add.c delete.c modrdn.c modify.c \
+ abandon.c syntax.c association.c kerberos.c certificate.c
+OBJS = main.o detach.o setproctitle.o request.o bind.o result.o error.o \
+ search.o util.o compare.o message.o add.o delete.o modrdn.o modify.o \
+ abandon.o syntax.o association.o kerberos.o LDAP_tables.o \
+ certificate.o
+
+BUILD_OPT = "--enable-ldapd"
+BUILD_SRV = @BUILD_LDAPD@
+
+XDEFS= @LDAPD_DEFS@
+XLIBS= @LDAPD_LIBS@
+
+all-local: $(PROGRAMS)
+
+ldapd: version.o
+ $(CC) $(LDFLAGS) -o $@ $(OBJS) version.o $(LIBS)
+
+sldapd: version.o
+ $(CC) $(LDFLAGS) -static -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS) -lresolv
+
+version.c: $(OBJS) $(LDIR)/liblber/liblber.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 > $@)
+
+request.o: LDAP-types.h
+
+LDAP_tables.c: ldap.py
+ @if [ ! -z "$(PEPSY)" ]; then \
+ $(PEPSY) -A ldap.py; \
+ else \
+ touch LDAP_tables.c LDAP-types.h; \
+ fi
+
+LDAP-types.h: LDAP_tables.c
+
+install-local: FORCE
+ @$(MKDIR) -p $(libexecdir)
+ $(INSTALL) $(INSTALLFLAGS) -m 755 ldapd $(LDAP_LIBEXECDIR)
BUILD_OPT = "--enable-slapd"
BUILD_SRV = @BUILD_SLAPD@
-all-srv: FORCE
+all-local: FORCE
$(MAKE) $(MFLAGS) backendslib
$(MAKE) $(MFLAGS) slapd
(cd tools; $(MAKE) $(MFLAGS) all)
-e "s|%VERSION%|$${v}|" \
< Version.c > $@)
-clean: FORCE
+clean-local: FORCE
@for i in back-* tools; do \
if [ -d $$i ] ; then \
echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \
fi; \
done
-install: install-slapd install-conf install-tools
+install-local: install-slapd install-conf install-tools
install-slapd: FORCE
@-$(MKDIR) $(libexecdir)
PROGRAMS = libback-ldbm.a
-all-srv: FORCE
+all-local: FORCE
$(MAKE) $(MFLAGS) libback-ldbm.a
libback-ldbm.a: version.o
XINCLUDEDIR= -I..
XDEFS = @LTHREAD_DEFS@
-all-srv: FORCE
+all-local: FORCE
$(MAKE) $(MFLAGS) libback-passwd.a
libback-passwd.a: version.o
XINCLUDEDIR = -I..
XDEFS = @LTHREAD_DEFS@
-all-srv: FORCE
+all-local: FORCE
$(MAKE) $(MFLAGS) libback-shell.a
libback-shell.a: version.o
HAVE_ISODE = @HAVE_ISODE@
BUILD_LDBM = @BUILD_LDBM@
+PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry \
+ ldif2id2children centipede ldbmtest ldif
+
+SRCS = centipede.c ldbmcat.c ldbmtest.c sizecount.c \
+ ldif.c ldif2id2children.c ldif2id2entry.c ldif2index.c ldif2ldbm.c
+
EDB2LDIFSRCS = edb2ldif.c ldapsyntax.c
EDB2LDIFOBJS = edb2ldif.o ldapsyntax.o ../strdup.o
../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
../schemaparse.o ../strdup.o
-all: build-edb2ldif ldif2index ldif2ldbm ldbmcat ldif2id2entry \
- ldif2id2children centipede ldbmtest ldif
+all-local: build-edb2ldif build-chlog2replog $(PROGRAMS)
XDEFS = @SLAPD_DEFS@ @LDBM_DEFS@ @LTHREAD_DEFS@
XLIBS = @SLAPD_LIBS@ -lavl -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@
build-edb2ldif: FORCE
@if [ "$(HAVE_ISODE)" = "yes" ]; then \
- $(MAKE) $(MFLAGS) edb2ldif; \
- else \
- echo "run configure with --with-isode to build edb2ldif"; \
- fi
+ $(MAKE) $(MFLAGS) edb2ldif; \
+ else \
+ echo "run configure with --with-isode to build edb2ldif"; \
+ fi
edb2ldif: edb2-vers.o
$(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)
build-chlog2replog: FORCE
@if [ "$(HAVE_ISODE)" = "yes" ]; then \
- $(MAKE) $(MFLAGS) chlog2replog; \
- else \
- echo "run configure with --with-isode to build chlog2replog"; \
- fi
+ $(MAKE) $(MFLAGS) chlog2replog; \
+ else \
+ echo "run configure with --with-isode to build chlog2replog"; \
+ fi
chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o
$(CC) $(LDFLAGS) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
ldbmtest: ldbmtest.o ../libbackends.a $(OBJS2)
$(CC) $(LDFLAGS) -o ldbmtest ldbmtest.o $(OBJS2) ../libbackends.a $(LIBS)
-install: $(sbindir) $(sbindir)/edb2ldif $(sbindir)/ldif2ldbm \
- $(sbindir)/ldif2index $(sbindir)/ldif2id2entry \
- $(sbindir)/ldif2id2children $(sbindir)/ldbmcat \
- $(sbindir)/centipede $(sbindir)/ldbmtest \
- $(sbindir)/ldif
-
-$(sbindir)/edb2ldif: build-edb2ldif
- @if [ "$(HAVE_ISODE)" = "yes" ]; then \
- $(INSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \
- else \
- exit 0; \
- fi
+clean-local: FORCE
+ $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) edb2-vers.c *.o a.out core
-$(sbindir)/chlog2replog: build-chlog2replog
+depend-local: FORCE
@if [ "$(HAVE_ISODE)" = "yes" ]; then \
- $(INSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir); \
- else \
- exit 0; \
- fi
+ DEPENDEXTRAS="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
+ fi; \
+ $(MKDEP) $(DEFS) $(DEFINES) $$DEPENDEXTRAS $(SRCS)
-$(sbindir)/ldif2ldbm: ldif2ldbm
+install-local: install-isode FORCE
+ @-$(MKDIR) -p $(sbindir)
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(sbindir)
-
-$(sbindir)/ldif2index: ldif2index
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(sbindir)
-
-$(sbindir)/ldif2id2entry: ldif2id2entry
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(sbindir)
-
-$(sbindir)/ldif2id2children: ldif2id2children
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(sbindir)
-
-$(sbindir)/ldbmcat: ldbmcat
$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(sbindir)
-
-$(sbindir)/ldif: ldif
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif $(sbindir)
-
-$(sbindir)/centipede: centipede
$(INSTALL) $(INSTALLFLAGS) -m 755 centipede $(sbindir)
-
-$(sbindir)/ldbmtest: ldbmtest
$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(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 ldif2ldbm.sed.c ldbmtest
-
-depend: ldif2ldbm.sed.c FORCE
- @if [ ! -z "$(HAVE_ISODE)" ]; 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 ldif2ldbm.sed.c ldbmtest.c ldif.c
-
-links:
- @echo "making links in `$(PWD)`"
- @$(LN) .src/*.[ch] .
+install-isode: FORCE
+ @-$(MKDIR) -p $(sbindir)
+ @if [ "$(HAVE_ISODE)" = "yes" ]; then \
+ $(INSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \
+ $(INSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir); \
+ else \
+ exit 0; \
+ fi
+
+all-common: all-local FORCE
+install-common: all-common install-local FORCE
+depend-common: depend-local FORCE
+clean-common: clean-local FORCE
+veryclean-common: clean-common veryclean-local FORCE
BUILD_OPT = "--enable-slurpd"
BUILD_SRV = @BUILD_SLURPD@
-all-srv: slurpd
+all-local: slurpd
XDEFS = @SLURPD_DEFS@ @LTHREAD_DEFS@
XLIBS = @SLURPD_LIBS@ -llthread @LTHREAD_LIBS@
-e "s|%VERSION%|$${v}|" \
< Version.c > $@)
-install: install-srv FORCE
+install-local: FORCE
@-$(MKDIR) -p $(libexecdir)
$(INSTALL) $(INSTALLFLAGS) -m 755 slurpd $(libexecdir)
SCRIPTSDIR=./scripts
-all: FORCE
+all-local: FORCE
@echo "Initiating LDAP tests..."; \
$(MKDIR) -p test-db test-repl ; \
$(SCRIPTSDIR)/all $(SCRIPTSDIR)
-install: FORCE
-depend: FORCE
-veryclean: clean
-
-clean: FORCE
+clean-local: FORCE
$(RM) test-db/[!C]* test-repl/[!C]* *core
+
+veryclean-local: clean
+
+depend-local: FORCE
+
+install-local: FORCE
+
+all-common: all-local
+install-common: install-local
+clean-common: clean-local
+veryclean-common: veryclean-local
+depend-common: depend-local