+all-local-srv: all-cffiles
+
+NT_DYN_DEFS = -DLBER_DECL=dllimport -DLDAP_DECL=dllimport
+
+DEFINES = $(@PLAT@_@LIB_LINKAGE@_DEFS)
+
+# The tricky part about building slapd in NT is that it will export symbols
+# like a DLL. The symbols that it exports should be representative of all
+# of the static symbols that it knows about.
+
+NT_EXP = slapd.exp
+NT_IMPLIB = libslapd.a
+NT_DUMMY = symdummy.o
+
+# Add extra def targets here
+EXTRA_DEFS =
+
+# NT needs this if libltdl is built statically. You'll have to fix the path
+# to point to where libltdl was built, then put ltdl.def in EXTRA_DEFS
+ltdl.def: ../../../libtool/libltdl/*.o
+ dlltool --export-all-symbols --output-def $@ $^
+
+DYNAMIC_DEFS = liblber.def libldap_r.def
+
+STATIC_DEFS = libavl.def libldbm.def libldif.def liblutil.def slapd.def \
+ $(EXTRA_DEFS)
+
+libavl.def: $(LDAP_LIBDIR)/libavl/*.o
+ dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
+
+liblber.def: $(LDAP_LIBDIR)/liblber/*.o
+ dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
+
+libldap_r.def: $(LDAP_LIBDIR)/libldap_r/*.o
+ dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
+
+libldbm.def: $(LDAP_LIBDIR)/libldbm/*.o
+ dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
+
+libldif.def: $(LDAP_LIBDIR)/libldif/*.o
+ dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
+
+liblutil.def: $(LDAP_LIBDIR)/liblutil/*.o
+ dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
+
+slapd.def: $(OBJS) version.o
+ dlltool --export-all-symbols --exclude-symbols main,ServiceMain@8 --output-def $@ `ls $^ | grep -v test`