]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/Makefile.in
Fix prev commit
[openldap] / servers / slapd / Makefile.in
index 2ece47608f9e08569ff874fce624d168525e0c87..c044775b3a281950ba6b3a7d0113b4df80c14af2 100644 (file)
@@ -1,13 +1,25 @@
+## Makefile.in for slapd
 # $OpenLDAP$
-## Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
-## COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Makefile.in for slapd
+## Copyright 1998-2004 The OpenLDAP Foundation.
+## All rights reserved.
 ##
-PROGRAMS=slapd
-XPROGRAMS=sslapd libbackends.a .backend
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+
+SLAPTOOLS=slapadd slapcat slapindex slappasswd
+PROGRAMS=slapd $(SLAPTOOLS)
+XPROGRAMS=sslapd libbackends.a .backend liboverlays.a
 XSRCS=version.c
 
+SUBDIRS=back-* shell-backends slapi overlays
+
 NT_SRCS = nt_svc.c
 NT_OBJS = nt_svc.o ../../libraries/liblutil/slapdmsg.res
 
@@ -23,6 +35,7 @@ SRCS  = main.c globals.c config.c daemon.c \
                oidm.c starttls.c index.c sets.c referral.c root_dse.c \
                sasl.c module.c mra.c mods.c sl_malloc.c limits.c \
                backglue.c operational.c matchedValues.c cancel.c syncrepl.c \
+               slapadd.c slapcat.c slapcommon.c slapindex.c slappasswd.c \
                backover.c ctxcsn.c ldapsync.c sessionlog.c $(@PLAT@_SRCS)
 
 OBJS   = main.o globals.o config.o daemon.o \
@@ -37,6 +50,7 @@ OBJS  = main.o globals.o config.o daemon.o \
                oidm.o starttls.o index.o sets.o referral.o root_dse.o \
                sasl.o module.o mra.o mods.o sl_malloc.o limits.o \
                backglue.o operational.o matchedValues.o cancel.o syncrepl.o \
+               slapadd.o slapcat.o slapcommon.o slapindex.o slappasswd.o \
                backover.o ctxcsn.o ldapsync.o sessionlog.o $(@PLAT@_OBJS)
 
 LDAP_INCDIR= ../../include -I$(srcdir)/slapi
@@ -52,8 +66,8 @@ SLAPI_LIBS=@LIBSLAPI@ @SLAPI_LIBS@
 XDEFS = $(MODULES_CPPFLAGS)
 XLDFLAGS = $(MODULES_LDFLAGS)
 
-XLIBS = $(SLAPD_STATIC_DEPENDS) $(SLAPD_L)
-XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
+XLIBS = $(SLAPD_STATIC_DEPENDS) $(SLAPD_L) liboverlays.a
+XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) $(SECURITY_LIBS) $(LUTIL_LIBS)
 XXXLIBS = $(LTHREAD_LIBS) $(SLAPI_LIBS) $(MODULES_LIBS)
 
 BUILD_OPT = "--enable-slapd"
@@ -67,7 +81,7 @@ NT_SLAPD_OBJECTS = slapd.exp symdummy.o $(OBJS) version.o
 UNIX_SLAPD_DEPENDS = $(SLAPD_STATIC_DEPENDS) version.o $(SLAPD_L)
 UNIX_SLAPD_OBJECTS = $(OBJS) version.o
 
-SLAPD_DEPENDS = $(@PLAT@_SLAPD_DEPENDS)
+SLAPD_DEPENDS = liboverlays.a $(@PLAT@_SLAPD_DEPENDS)
 SLAPD_OBJECTS = $(@PLAT@_SLAPD_OBJECTS)
 
 # Notes about slapd for Windows
@@ -83,7 +97,7 @@ SLAPD_OBJECTS = $(@PLAT@_SLAPD_OBJECTS)
 # we want to export EVERY global symbol that it knows about (NOT including
 # symbols that are imported from other DLLs). The set of symbols to
 # export INCLUDES symbols from all static libraries that slapd gets
-# linked with, e.g. avl, ldbm, ldif, lunicode, lutil, etc. This list
+# linked with, e.g. avl, ldbm, lunicode, lutil, etc. This list
 # will also include liblber and libldap_r if they were built as static
 # libraries. ALSO included will be symbols from other STATIC libraries
 # outside the domain of the OpenLDAP source tree, e.g. regex, ltdl,
@@ -134,7 +148,7 @@ SLAPD_OBJECTS = $(@PLAT@_SLAPD_OBJECTS)
 # Thus, we do the best we can by depending on version.o, which depends
 # on its own very long list of dependencies.
 #
-slapd.def: libbackends.a version.o
+slapd.def: libbackends.a liboverlays.a version.o
        @for i in $(LDFLAGS) ; do \
            path=`expr "$$i" : "-L\(.*\)"`; \
            if test $$? != 0; then continue; fi; \
@@ -239,13 +253,14 @@ libslapi.a: slapi/.libs/libslapi.a
 slapd: $(SLAPD_DEPENDS) @LIBSLAPI@
        $(LTLINK) -o $@ $(SLAPD_OBJECTS) $(LIBS) \
                $(WRAP_LIBS)
+       rm -f $(SLAPTOOLS)
+       for i in $(SLAPTOOLS); do \
+               $(LN_S) slapd $$i; done
+
 
 sslapd: version.o
        $(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS)
 
-tools $(SLAPD_DYNAMIC_BACKENDS): slapd
-       cd $@; $(MAKE) $(MFLAGS) all
-       @touch $@
 
 #
 # In Windows, dynamic backends have to be built after slapd. For this
@@ -288,6 +303,9 @@ libbackends.a: .backend
        fi
        @ls -l libbackends.a; echo ""
 
+liboverlays.a: FORCE
+       @cd overlays; $(MAKE) $(MFLAGS) all
+
 version.c: Makefile
        @-$(RM) $@
        $(MKVERSION) -s -n Versionstr slapd > $@
@@ -295,7 +313,7 @@ version.c: Makefile
 version.o: version.c $(OBJS) $(SLAPD_LIBDEPEND) 
 
 depend-local-srv: FORCE
-       @for i in back-* shell-backends slapi tools; do \
+       @for i in $(SUBDIRS); do \
                if test -d $$i -a -f $$i/Makefile ; then \
                        echo; echo "  cd $$i; $(MAKE) $(MFLAGS) depend"; \
                        ( cd $$i; $(MAKE) $(MFLAGS) depend ); \
@@ -308,7 +326,7 @@ clean-local:
        rm -f *.exp *.def *.base *.a *.objs symdummy.c
 
 clean-local-srv: FORCE
-       @for i in back-* shell-backends slapi tools; do \
+       @for i in $(SUBDIRS); do \
                if test -d $$i -a -f $$i/Makefile ; then \
                        echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
                        ( cd $$i; $(MAKE) $(MFLAGS) clean ); \
@@ -318,7 +336,7 @@ clean-local-srv: FORCE
        rm -f *.tmp all-cffiles
 
 veryclean-local-srv: FORCE
-       @for i in back-* shell-backends slapi tools; do \
+       @for i in $(SUBDIRS); do \
                if test -d $$i -a -f $$i/Makefile ; then \
                        echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
                        ( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \
@@ -329,10 +347,10 @@ install-local-srv: install-slapd install-conf install-schema install-tools
 
 install-slapd: FORCE
        -$(MKDIR) $(DESTDIR)$(libexecdir)
-       -$(MKDIR) $(DESTDIR)$(localstatedir)
+       -$(MKDIR) $(DESTDIR)$(localstatedir)/run
        $(LTINSTALL) $(INSTALLFLAGS) -s -m 755 \
                slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
-       @for i in back-* shell-backends slapi tools; do \
+       @for i in $(SUBDIRS); do \
            if test -d $$i -a -f $$i/Makefile ; then \
                echo; echo "  cd $$i; $(MAKE) $(MFLAGS) install"; \
                ( cd $$i; $(MAKE) $(MFLAGS) install ); \
@@ -340,7 +358,7 @@ install-slapd: FORCE
            fi; \
        done
 
-all-cffiles: slapd $(SLAPD_DYNAMIC_BACKENDS) tools
+all-cffiles: slapd $(SLAPD_DYNAMIC_BACKENDS)
        @if test $(PLAT) = NT; then \
            sysconfdir=`cygpath -w $(sysconfdir) | \
                $(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
@@ -392,6 +410,8 @@ install-conf: FORCE
        fi
 
 install-tools: FORCE
-       @-$(MKDIR) $(DESTDIR)$(sbindir)
-       (cd tools; $(MAKE) $(MFLAGS) install)
+       -$(MKDIR) $(DESTDIR)$(sbindir)
+       cd $(DESTDIR)$(sbindir); rm -f $(SLAPTOOLS); \
+       for i in $(SLAPTOOLS); do \
+               $(LN_S) $(DESTDIR)$(libexecdir)/slapd $$i; done