Commit 2e769ccf authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Make all, clean, veryclean, depend, install all appear to work!

Now to sort out configure enable/with options.
parent 1bee2718
##---------------------------------------------------------------------------
##
## 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"; \
......@@ -11,8 +12,7 @@ allsubs: FORCE
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"; \
......@@ -20,8 +20,7 @@ installsubs: FORCE
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"; \
......@@ -29,8 +28,7 @@ cleansubs: FORCE
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"; \
......@@ -38,8 +36,7 @@ verysubs: FORCE
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
......@@ -18,18 +19,22 @@ version.c: $(OBJS)
-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
......@@ -84,7 +84,20 @@ LIBS = -L$(LDAP_LIBDIR) $(LDAP_LIBS) $(XLIBS) $(AC_LIBS)
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 ; \
......@@ -96,3 +109,5 @@ Makefile: Makefile.in ${top_srcdir}/config.status
# empty rule for forcing rules
FORCE:
##---------------------------------------------------------------------------
......@@ -348,7 +348,6 @@ dnl AC_OUTPUT( \
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])
......@@ -371,6 +370,7 @@ libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.
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 \
......
......@@ -3,7 +3,9 @@
##
## 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)
......@@ -12,22 +14,22 @@ install: all FORCE
$(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);' \
......@@ -40,3 +42,8 @@ ldapconfig.h: ldapconfig.h.edit Makefile
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
......@@ -8,7 +8,7 @@ XSRCS = version.c
LIBRARY = liblber.a
install: $(LIBRARY) FORCE
install-local: $(LIBRARY) FORCE
-$(MKDIR) -p $(libdir)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(libdir)
@(cd /tmp; $(RANLIB) $(libdir)/$(LIBRARY))
......
......@@ -26,7 +26,8 @@ ttest: $(LIBRARY) tmpltest.o $(LIBLBER)
$(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
##
## 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)
......@@ -21,7 +21,7 @@ OBJS = main.o daemon.o connection.o search.o filter.o add.o charray.o \
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)
......@@ -79,7 +79,7 @@ version.c: libbackends.a $(OBJS) \
-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"; \
......@@ -87,7 +87,7 @@ clean: FORCE
fi; \
done
install: install-slapd install-conf install-tools
install-local: install-slapd install-conf install-tools
install-slapd: FORCE
@-$(MKDIR) $(libexecdir)
......
......@@ -15,7 +15,7 @@ XDEFS = @LDBM_DEFS@ @LTHREAD_DEFS@
PROGRAMS = libback-ldbm.a
all-srv: FORCE
all-local: FORCE
$(MAKE) $(MFLAGS) libback-ldbm.a
libback-ldbm.a: version.o
......
......@@ -8,7 +8,7 @@ PROGRAMS= libback-passwd.a
XINCLUDEDIR= -I..
XDEFS = @LTHREAD_DEFS@
all-srv: FORCE
all-local: FORCE
$(MAKE) $(MFLAGS) libback-passwd.a
libback-passwd.a: version.o
......
......@@ -10,7 +10,7 @@ PROGRAMS = libback-shell.a
XINCLUDEDIR = -I..
XDEFS = @LTHREAD_DEFS@
all-srv: FORCE
all-local: FORCE
$(MAKE) $(MFLAGS) libback-shell.a
libback-shell.a: version.o
......
......@@ -15,6 +15,12 @@
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
......@@ -24,18 +30,17 @@ OBJS2 = ../config.o ../ch_malloc.o ../backend.o ../charray.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)
......@@ -50,10 +55,10 @@ edb2-vers.c: $(EDB2LDIFOBJS)
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)
......@@ -86,70 +91,37 @@ sizecount: sizecount.o ../phonetic.o ../ch_malloc.o
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or