Home | History | Annotate | Line # | Download | only in slapd
Makefile.in revision 1.1.1.10
      1       1.1     lukem ## Makefile.in for slapd
      2   1.1.1.4      tron # $OpenLDAP$
      3       1.1     lukem ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
      4       1.1     lukem ##
      5  1.1.1.10  christos ## Copyright 1998-2024 The OpenLDAP Foundation.
      6       1.1     lukem ## All rights reserved.
      7       1.1     lukem ##
      8       1.1     lukem ## Redistribution and use in source and binary forms, with or without
      9       1.1     lukem ## modification, are permitted only as authorized by the OpenLDAP
     10       1.1     lukem ## Public License.
     11       1.1     lukem ##
     12       1.1     lukem ## A copy of this license is available in the file LICENSE in the
     13       1.1     lukem ## top-level directory of the distribution or, alternatively, at
     14       1.1     lukem ## <http://www.OpenLDAP.org/license.html>.
     15       1.1     lukem 
     16   1.1.1.9  christos SLAPTOOLS=slapadd slapcat slapdn slapindex slapmodify slappasswd slaptest slapauth slapacl slapschema
     17       1.1     lukem PROGRAMS=slapd $(SLAPTOOLS)
     18       1.1     lukem XPROGRAMS=sslapd libbackends.a .backend liboverlays.a
     19       1.1     lukem XSRCS=version.c
     20       1.1     lukem 
     21   1.1.1.9  christos SUBDIRS=back-* slapi overlays pwmods
     22       1.1     lukem 
     23       1.1     lukem NT_SRCS = nt_svc.c
     24       1.1     lukem NT_OBJS = nt_svc.o ../../libraries/liblutil/slapdmsg.res
     25       1.1     lukem 
     26       1.1     lukem SRCS	= main.c globals.c bconfig.c config.c daemon.c \
     27       1.1     lukem 		connection.c search.c filter.c add.c cr.c \
     28       1.1     lukem 		attr.c entry.c backend.c result.c operation.c \
     29       1.1     lukem 		dn.c compare.c modify.c delete.c modrdn.c ch_malloc.c \
     30  1.1.1.10  christos 		value.c verbs.c ava.c bind.c unbind.c abandon.c filterentry.c \
     31       1.1     lukem 		phonetic.c acl.c str2filter.c aclparse.c init.c user.c \
     32  1.1.1.10  christos 		lock.c logging.c controls.c extended.c passwd.c proxyp.c \
     33       1.1     lukem 		schema.c schema_check.c schema_init.c schema_prep.c \
     34       1.1     lukem 		schemaparse.c ad.c at.c mr.c syntax.c oc.c saslauthz.c \
     35       1.1     lukem 		oidm.c starttls.c index.c sets.c referral.c root_dse.c \
     36       1.1     lukem 		sasl.c module.c mra.c mods.c sl_malloc.c zn_malloc.c limits.c \
     37       1.1     lukem 		operational.c matchedValues.c cancel.c syncrepl.c \
     38       1.1     lukem 		backglue.c backover.c ctxcsn.c ldapsync.c frontend.c \
     39       1.1     lukem 		slapadd.c slapcat.c slapcommon.c slapdn.c slapindex.c \
     40       1.1     lukem 		slappasswd.c slaptest.c slapauth.c slapacl.c component.c \
     41   1.1.1.9  christos 		aci.c txn.c slapschema.c slapmodify.c \
     42       1.1     lukem 		$(@PLAT@_SRCS)
     43       1.1     lukem 
     44       1.1     lukem OBJS	= main.o globals.o bconfig.o config.o daemon.o \
     45       1.1     lukem 		connection.o search.o filter.o add.o cr.o \
     46       1.1     lukem 		attr.o entry.o backend.o backends.o result.o operation.o \
     47       1.1     lukem 		dn.o compare.o modify.o delete.o modrdn.o ch_malloc.o \
     48  1.1.1.10  christos 		value.o verbs.o ava.o bind.o unbind.o abandon.o filterentry.o \
     49       1.1     lukem 		phonetic.o acl.o str2filter.o aclparse.o init.o user.o \
     50  1.1.1.10  christos 		lock.o logging.o controls.o extended.o passwd.o proxyp.o \
     51       1.1     lukem 		schema.o schema_check.o schema_init.o schema_prep.o \
     52       1.1     lukem 		schemaparse.o ad.o at.o mr.o syntax.o oc.o saslauthz.o \
     53       1.1     lukem 		oidm.o starttls.o index.o sets.o referral.o root_dse.o \
     54       1.1     lukem 		sasl.o module.o mra.o mods.o sl_malloc.o zn_malloc.o limits.o \
     55       1.1     lukem 		operational.o matchedValues.o cancel.o syncrepl.o \
     56       1.1     lukem 		backglue.o backover.o ctxcsn.o ldapsync.o frontend.o \
     57       1.1     lukem 		slapadd.o slapcat.o slapcommon.o slapdn.o slapindex.o \
     58       1.1     lukem 		slappasswd.o slaptest.o slapauth.o slapacl.o component.o \
     59   1.1.1.9  christos 		aci.o txn.o slapschema.o slapmodify.o \
     60       1.1     lukem 		$(@PLAT@_OBJS)
     61       1.1     lukem 
     62       1.1     lukem LDAP_INCDIR= ../../include -I$(srcdir) -I$(srcdir)/slapi -I.
     63       1.1     lukem LDAP_LIBDIR= ../../libraries
     64       1.1     lukem 
     65       1.1     lukem SLAP_DIR=
     66       1.1     lukem SLAPD_STATIC_DEPENDS=@SLAPD_NO_STATIC@ libbackends.a liboverlays.a
     67       1.1     lukem SLAPD_STATIC_BACKENDS=@SLAPD_STATIC_BACKENDS@
     68       1.1     lukem SLAPD_DYNAMIC_BACKENDS=@SLAPD_DYNAMIC_BACKENDS@
     69       1.1     lukem 
     70       1.1     lukem SLAPI_LIBS=@LIBSLAPI@ @SLAPI_LIBS@
     71       1.1     lukem 
     72       1.1     lukem XDEFS = $(MODULES_CPPFLAGS)
     73       1.1     lukem XLDFLAGS = $(MODULES_LDFLAGS)
     74       1.1     lukem 
     75       1.1     lukem XLIBS = $(SLAPD_STATIC_DEPENDS) $(SLAPD_L) $(MODULES_LIBS)
     76       1.1     lukem XXLIBS = $(SLAPD_LIBS) $(SECURITY_LIBS) $(LUTIL_LIBS)
     77       1.1     lukem XXXLIBS = $(LTHREAD_LIBS) $(SLAPI_LIBS)
     78       1.1     lukem 
     79       1.1     lukem BUILD_OPT = "--enable-slapd"
     80       1.1     lukem BUILD_SRV = @BUILD_SLAPD@
     81       1.1     lukem 
     82       1.1     lukem all-local-srv: all-cffiles
     83       1.1     lukem 
     84       1.1     lukem NT_SLAPD_DEPENDS = slapd.exp
     85       1.1     lukem NT_SLAPD_OBJECTS = slapd.exp symdummy.o $(OBJS) version.o
     86       1.1     lukem 
     87       1.1     lukem UNIX_SLAPD_DEPENDS = $(SLAPD_STATIC_DEPENDS) version.o $(SLAPD_L)
     88       1.1     lukem UNIX_SLAPD_OBJECTS = $(OBJS) version.o
     89       1.1     lukem 
     90       1.1     lukem SLAPD_DEPENDS = $(@PLAT@_SLAPD_DEPENDS)
     91       1.1     lukem SLAPD_OBJECTS = $(@PLAT@_SLAPD_OBJECTS)
     92       1.1     lukem 
     93       1.1     lukem # Notes about slapd for Windows
     94       1.1     lukem # =============================
     95       1.1     lukem # slapd.exe must export all of its global symbols, just like a DLL.
     96       1.1     lukem # The purpose of this is to allow dynamic modules (dynamic backends
     97       1.1     lukem # or external dynamic modules) to bind with the symbols at run-time.
     98       1.1     lukem # 
     99       1.1     lukem # Exporting symbols from an .EXE is a bit tricky and involves multiple
    100       1.1     lukem # steps. First a .DEF file must be generated. The .DEF file indicates
    101       1.1     lukem # the set of symbols that are to be exported. Many times, it's possible
    102       1.1     lukem # to manually create this file with an editor. However, with slapd,
    103       1.1     lukem # we want to export EVERY global symbol that it knows about (NOT including
    104       1.1     lukem # symbols that are imported from other DLLs). The set of symbols to
    105       1.1     lukem # export INCLUDES symbols from all static libraries that slapd gets
    106       1.1     lukem # linked with, e.g. avl, lunicode, lutil, etc. This list
    107   1.1.1.9  christos # will also include liblber and libldap if they were built as static
    108       1.1     lukem # libraries. ALSO included will be symbols from other STATIC libraries
    109       1.1     lukem # outside the domain of the OpenLDAP source tree, e.g. regex, ltdl,
    110       1.1     lukem # crypto, ssl, sasl, etc. (If these libraries are dynamic, we won't want
    111       1.1     lukem # to include their symbols in the list). The correct set of symbols
    112       1.1     lukem # CAN be determined at build time. The slapd.def target automatically
    113       1.1     lukem # determines the correct set of symbols and generates the slapd.def file.
    114       1.1     lukem #
    115       1.1     lukem # The slapd.def file, serving multiple purposes, will:
    116       1.1     lukem #
    117       1.1     lukem # 1) be used to generate libslapd.a, the import library for slapd.exe.
    118       1.1     lukem #
    119       1.1     lukem # 2) be used to generate the symdummy.c file.
    120       1.1     lukem #
    121  1.1.1.10  christos # 3) be used to help create slapd.exp, the binary-formatted slapd export file.
    122       1.1     lukem #
    123       1.1     lukem # The import library is used by dynamic modules at link time. With this
    124       1.1     lukem # library, dynamic modules indicate to the linker that it will resolve
    125       1.1     lukem # these symbols from the slapd.exe binary at run-time. Of course, whenever
    126       1.1     lukem # a module imports dynamic symbols, those symbols should be marked with
    127       1.1     lukem # the __declspec(dllimport) directive in the header files that the dynamic
    128       1.1     lukem # modules build with. In OpenLDAP, this is handled automatically in the
    129       1.1     lukem # header files. (See ldap_cdefs.h for an explanation). Writers of
    130       1.1     lukem # dynamic backend modules should keep in mind that slapd.exe might export
    131       1.1     lukem # other global symbols that are not part of OpenLDAP (e.g. regex, ltdl,
    132       1.1     lukem # crypto, ssl, sasl, etc.) When a writer actually uses (i.e. imports) these
    133       1.1     lukem # symbols, he must verify that the header files from these external packages
    134       1.1     lukem # include a mechanism to mark imported symbols with the __declspec(dllimport)
    135       1.1     lukem # directive. Whether or not such a mechanism exists, the writer must be
    136       1.1     lukem # able to include these directives appropriately when their symbols are
    137       1.1     lukem # being imported from slapd.exe. The directive is not completely necessary
    138       1.1     lukem # for functions, but it is required for variables.
    139       1.1     lukem #
    140       1.1     lukem # The symdummy.c file basically references EVERY symbol available to slapd.exe,
    141       1.1     lukem # including symbols that slapd.exe never actually referenced. The file
    142       1.1     lukem # is compiled and included at link time. Without this object file, slapd.exe
    143       1.1     lukem # would NOT export symbols that it never referenced. The reason that these
    144       1.1     lukem # symbols must still be exported is because a dynamic module may want to
    145       1.1     lukem # use a symbol even if it had not been referenced by slapd.exe.
    146       1.1     lukem #
    147       1.1     lukem 
    148       1.1     lukem #
    149       1.1     lukem # slapd.def REALLY depends upon all slapd objects and all static libraries
    150       1.1     lukem # included in $(LIBS), including static libraries outside of OpenLDAP.
    151       1.1     lukem # When slapd.def is built, the absolute paths to all static libraries
    152       1.1     lukem # (both inside and outside of OpenLDAP) are generated. We don't have
    153       1.1     lukem # any way to include this generated list as a dependency of slapd.def (sigh).
    154       1.1     lukem # Thus, we do the best we can by depending on version.o, which depends
    155       1.1     lukem # on its own very long list of dependencies.
    156       1.1     lukem #
    157       1.1     lukem slapd.def: libbackends.a liboverlays.a version.o
    158       1.1     lukem 	@for i in XX $(LDFLAGS) ; do \
    159       1.1     lukem 	    path=`expr "$$i" : "-L\(.*\)"`; \
    160       1.1     lukem 	    if test $$? != 0; then continue; fi; \
    161       1.1     lukem 	    paths="$$paths $$path"; \
    162       1.1     lukem 	done; \
    163       1.1     lukem 	objs=""; \
    164       1.1     lukem 	for i in $(OBJS) version.o $(LIBS) ; do \
    165       1.1     lukem 	    obj="" ; \
    166       1.1     lukem 	    case $$i in \
    167       1.1     lukem 		-l*) \
    168       1.1     lukem 		    done="" ;\
    169       1.1     lukem 		    base=`expr "$$i" : "-l\(.*\)"`; \
    170       1.1     lukem 		    for p in . $$paths ; do \
    171       1.1     lukem 			for ext in la dll dll.a a ; do \
    172       1.1     lukem 			    path=$$p/lib$$base.$$ext; \
    173       1.1     lukem 			    test ! -f $$path && continue; \
    174       1.1     lukem 			    if test $$ext = la ; then \
    175       1.1     lukem 				for t in dlname old_library ; do \
    176       1.1     lukem 				    line=`grep "^$$t=" $$path`; \
    177       1.1     lukem 				    lib=`expr "$$line" : "[^']*'\(.*\)'"`; \
    178       1.1     lukem 				    test -n "$$lib" && test -f $$p/$$lib && \
    179       1.1     lukem 					path=$$p/$$lib && break; \
    180       1.1     lukem 				done; \
    181       1.1     lukem 				test $$t = dlname && ext=dll; \
    182       1.1     lukem 				test $$t = old_library && ext=a; \
    183       1.1     lukem 			    fi; \
    184       1.1     lukem 			    if test $$ext = a ; then \
    185       1.1     lukem 				obj=$$path; \
    186       1.1     lukem 			    fi; \
    187       1.1     lukem 			    done=done; \
    188       1.1     lukem 			    break; \
    189       1.1     lukem 			done; \
    190       1.1     lukem 			test -n "$$done" && break; \
    191       1.1     lukem 		    done; \
    192       1.1     lukem 		    test -z "$$obj" && continue; \
    193       1.1     lukem 		    ;; \
    194       1.1     lukem 		*.la) \
    195       1.1     lukem 		    if test -n "$(LTSTATIC)"; then \
    196       1.1     lukem 			    base=`expr "$$i" : ".*/\(.*\).la"`; \
    197       1.1     lukem 			    path=`expr "$$i" : "\(.*/\).*"`; \
    198       1.1     lukem 			    obj=$$path.libs/$$base.a; \
    199       1.1     lukem 		    fi; \
    200       1.1     lukem 		    ;; \
    201       1.1     lukem 		*.dll.a) \
    202       1.1     lukem 		    ;; \
    203       1.1     lukem 		*.o | *.a) \
    204       1.1     lukem 		    obj=$$i; \
    205       1.1     lukem 	    esac; \
    206       1.1     lukem 	    objs="$$objs $$obj"; \
    207       1.1     lukem 	done; \
    208       1.1     lukem 	echo dlltool --exclude-symbols main,ServiceMain@8 --export-all-symbols \
    209       1.1     lukem 			--output-def $@.tmp $$objs; \
    210       1.1     lukem 	dlltool --exclude-symbols main,ServiceMain@8 --export-all-symbols \
    211       1.1     lukem 			--output-def $@.tmp $$objs;
    212       1.1     lukem 	echo EXPORTS > $@
    213   1.1.1.7  christos 	$(SED) -e 1,2d -e 's/ @ [0-9][0-9]*//' -e '/\.refptr\./d' $@.tmp | sort >> $@
    214       1.1     lukem 	$(RM) $@.tmp
    215       1.1     lukem 
    216       1.1     lukem symdummy.c: slapd.def
    217       1.1     lukem 	$(RM) $@
    218       1.1     lukem 	@echo "generating $@..."; \
    219       1.1     lukem 	echo "static void never_called() {" > $@.tmp; \
    220       1.1     lukem 	cat $< | while read line; \
    221       1.1     lukem 	do \
    222       1.1     lukem 	    set dummy $$line; \
    223       1.1     lukem 	    case $$# in \
    224       1.1     lukem 		3) \
    225       1.1     lukem 		    echo "int $$2();" >> $@; \
    226       1.1     lukem 		    echo "$$2();" >> $@.tmp; \
    227       1.1     lukem 		    ;; \
    228       1.1     lukem 		4) \
    229       1.1     lukem 		    echo "extern int $$2;" >> $@; \
    230       1.1     lukem 		    echo "$$2 = 0;" >> $@.tmp; \
    231       1.1     lukem 		    ;; \
    232       1.1     lukem 	    esac; \
    233       1.1     lukem 	done; \
    234       1.1     lukem 	echo "" >> $@; \
    235       1.1     lukem 	echo "}" >> $@.tmp; \
    236       1.1     lukem 	cat $@.tmp >> $@; \
    237       1.1     lukem 	$(RM) $@.tmp
    238       1.1     lukem 
    239       1.1     lukem libslapd.a: symdummy.o
    240       1.1     lukem 	dlltool --dllname slapd.exe --input-def slapd.def --output-lib $@
    241       1.1     lukem 
    242       1.1     lukem slapd.exp: libslapd.a
    243       1.1     lukem 	@echo $(LTLINK) -Wl,--base-file,slapd.base -o slapd \
    244       1.1     lukem 		$(OBJS) symdummy.o version.o $(LIBS) $(WRAP_LIBS); \
    245       1.1     lukem 	$(LTLINK) -Wl,--base-file,slapd.base -o slapd \
    246       1.1     lukem 		$(OBJS) symdummy.o version.o $(LIBS) $(WRAP_LIBS)
    247       1.1     lukem 	$(RM) slapd.exe
    248       1.1     lukem 	@echo dlltool --dllname slapd.exe --input-def slapd.def \
    249       1.1     lukem 		--base-file slapd.base --output-exp $@; \
    250       1.1     lukem 	dlltool --dllname slapd.exe --input-def slapd.def \
    251       1.1     lukem 		--base-file slapd.base --output-exp $@; \
    252       1.1     lukem 	echo $(LTLINK) -Wl,--base-file,slapd.base -o slapd $@ \
    253       1.1     lukem 		$(OBJS) symdummy.o version.o $(LIBS) $(WRAP_LIBS); \
    254       1.1     lukem 	$(LTLINK) -Wl,--base-file,slapd.base -o slapd $@ \
    255       1.1     lukem 		$(OBJS) symdummy.o version.o $(LIBS) $(WRAP_LIBS)
    256       1.1     lukem 	$(RM) slapd.exe
    257       1.1     lukem 	@echo dlltool --dllname slapd.exe --input-def slapd.def \
    258       1.1     lukem 		--base-file slapd.base --output-exp $@; \
    259       1.1     lukem 	dlltool --dllname slapd.exe --input-def slapd.def \
    260       1.1     lukem 		--base-file slapd.base --output-exp $@
    261       1.1     lukem 
    262   1.1.1.4      tron slapi/libslapi.la: FORCE
    263   1.1.1.9  christos 	cd slapi && $(MAKE) $(MFLAGS) all
    264       1.1     lukem 
    265       1.1     lukem slapd: $(SLAPD_DEPENDS) @LIBSLAPI@
    266       1.1     lukem 	$(LTLINK) -o $@ $(SLAPD_OBJECTS) $(LIBS) \
    267       1.1     lukem 		$(WRAP_LIBS)
    268       1.1     lukem 	$(RM) $(SLAPTOOLS)
    269       1.1     lukem 	for i in $(SLAPTOOLS); do \
    270       1.1     lukem 		$(LN_S) slapd$(EXEEXT) $$i$(EXEEXT); done
    271       1.1     lukem 
    272       1.1     lukem 
    273       1.1     lukem sslapd: version.o
    274       1.1     lukem 	$(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS)
    275       1.1     lukem 
    276       1.1     lukem dummy $(SLAPD_DYNAMIC_BACKENDS): slapd
    277   1.1.1.9  christos 	cd $@ && $(MAKE) $(MFLAGS) all
    278       1.1     lukem 	@touch $@
    279       1.1     lukem 
    280       1.1     lukem dynamic_overlays: slapd
    281   1.1.1.9  christos 	cd overlays && $(MAKE) $(MFLAGS) dynamic
    282   1.1.1.9  christos 
    283   1.1.1.9  christos dynamic_pwmods: slapd
    284   1.1.1.9  christos 	cd pwmods && $(MAKE) $(MFLAGS) dynamic
    285       1.1     lukem 
    286       1.1     lukem #
    287       1.1     lukem # In Windows, dynamic backends have to be built after slapd. For this
    288       1.1     lukem # reason, we only build static backends now and dynamic backends later.
    289       1.1     lukem #
    290       1.1     lukem .backend: FORCE
    291       1.1     lukem 	@if test -n "$(SLAPD_STATIC_BACKENDS)"; then \
    292       1.1     lukem 	    echo "building static backends..."; \
    293       1.1     lukem 	    for i in XX $(SLAPD_STATIC_BACKENDS); do \
    294       1.1     lukem 	    	if test $$i != XX; then \
    295   1.1.1.9  christos 		    echo " "; echo "  cd $$i && $(MAKE) $(MFLAGS) all"; \
    296   1.1.1.9  christos 		    ( cd $$i && $(MAKE) $(MFLAGS) all ); \
    297       1.1     lukem 		    if test $$? != 0; then exit 1; fi; \
    298       1.1     lukem 		fi; \
    299       1.1     lukem 	    done; \
    300       1.1     lukem 	    echo " "; \
    301       1.1     lukem 	fi
    302       1.1     lukem 
    303       1.1     lukem libbackends.a: .backend
    304       1.1     lukem 	@$(RM) -r tmp
    305       1.1     lukem 	@$(MKDIR) tmp
    306       1.1     lukem 	@-for i in back-*/*.a; do \
    307       1.1     lukem 		( \
    308       1.1     lukem 		  cd tmp; \
    309       1.1     lukem 		  $(AR) x ../$$i; \
    310       1.1     lukem 		  pre=`echo $$i | $(SED) -e 's/\/.*$$//' -e 's/back-//'`; \
    311       1.1     lukem 		  for j in *.o; do \
    312       1.1     lukem 			mv $$j $${pre}$$j; \
    313       1.1     lukem 		  done; \
    314       1.1     lukem 		  $(AR) ruv libbackends.a *.o 2>&1 | grep -v truncated; \
    315       1.1     lukem 		  $(RM) *.o __.SYMDEF  ________64ELEL_ ; \
    316       1.1     lukem 		  echo "added backend library $$i"; \
    317       1.1     lukem 		  echo ""; \
    318       1.1     lukem 		); \
    319       1.1     lukem 	done
    320       1.1     lukem 	@mv -f tmp/libbackends.a ./libbackends.a
    321       1.1     lukem 	@$(RM) -r tmp
    322       1.1     lukem 	@if test ! -z "$(RANLIB)" ; then \
    323       1.1     lukem 		$(RANLIB) libbackends.a; \
    324       1.1     lukem 	fi
    325       1.1     lukem 	@ls -l libbackends.a; echo ""
    326       1.1     lukem 
    327       1.1     lukem liboverlays.a: FORCE
    328   1.1.1.9  christos 	cd overlays && $(MAKE) $(MFLAGS) static
    329       1.1     lukem 
    330       1.1     lukem version.c: Makefile
    331       1.1     lukem 	@-$(RM) $@
    332       1.1     lukem 	$(MKVERSION) -s -n Versionstr slapd > $@
    333       1.1     lukem 
    334       1.1     lukem version.o: version.c $(OBJS) $(SLAPD_LIBDEPEND) 
    335       1.1     lukem 
    336       1.1     lukem backends.o: backends.c $(srcdir)/slap.h
    337       1.1     lukem 
    338       1.1     lukem depend-local-srv: FORCE
    339       1.1     lukem 	@for i in $(SUBDIRS); do \
    340       1.1     lukem 		if test -d $$i && test -f $$i/Makefile ; then \
    341   1.1.1.9  christos 			echo; echo "  cd $$i && $(MAKE) $(MFLAGS) depend"; \
    342   1.1.1.9  christos 			( cd $$i && $(MAKE) $(MFLAGS) depend ); \
    343       1.1     lukem 			if test $$? != 0 ; then exit 1; fi ; \
    344       1.1     lukem 		fi; \
    345       1.1     lukem 	done
    346       1.1     lukem 	@echo ""
    347       1.1     lukem 
    348       1.1     lukem clean-local:
    349       1.1     lukem 	$(RM) *.exp *.def *.base *.a *.objs symdummy.c
    350       1.1     lukem 
    351       1.1     lukem veryclean-local:
    352       1.1     lukem 	$(RM) backends.c
    353       1.1     lukem 
    354       1.1     lukem clean-local-srv: FORCE
    355       1.1     lukem 	@for i in $(SUBDIRS); do \
    356       1.1     lukem 		if test -d $$i && test -f $$i/Makefile ; then \
    357   1.1.1.9  christos 			echo; echo "  cd $$i && $(MAKE) $(MFLAGS) clean"; \
    358   1.1.1.9  christos 			( cd $$i && $(MAKE) $(MFLAGS) clean ); \
    359       1.1     lukem 			if test $$? != 0 ; then exit 1; fi ; \
    360       1.1     lukem 		fi; \
    361       1.1     lukem 	done
    362       1.1     lukem 	$(RM) *.tmp all-cffiles
    363       1.1     lukem 
    364       1.1     lukem veryclean-local-srv: FORCE
    365       1.1     lukem 	@for i in $(SUBDIRS); do \
    366       1.1     lukem 		if test -d $$i && test -f $$i/Makefile ; then \
    367   1.1.1.9  christos 			echo; echo "  cd $$i && $(MAKE) $(MFLAGS) clean"; \
    368   1.1.1.9  christos 			( cd $$i && $(MAKE) $(MFLAGS) veryclean ); \
    369       1.1     lukem 		fi; \
    370       1.1     lukem 	done
    371       1.1     lukem 
    372       1.1     lukem install-local-srv: install-slapd install-tools \
    373   1.1.1.9  christos 	install-conf install-schema install-tools
    374       1.1     lukem 
    375       1.1     lukem install-slapd: FORCE
    376       1.1     lukem 	-$(MKDIR) $(DESTDIR)$(libexecdir)
    377       1.1     lukem 	-$(MKDIR) $(DESTDIR)$(localstatedir)/run
    378   1.1.1.9  christos 	$(LTINSTALL) $(INSTALLFLAGS) $(STRIP_OPTS) -m 755 \
    379       1.1     lukem 		slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
    380       1.1     lukem 	@for i in $(SUBDIRS); do \
    381       1.1     lukem 	    if test -d $$i && test -f $$i/Makefile ; then \
    382   1.1.1.9  christos 		echo; echo "  cd $$i && $(MAKE) $(MFLAGS) install"; \
    383   1.1.1.9  christos 		( cd $$i && $(MAKE) $(MFLAGS) install ); \
    384       1.1     lukem 		if test $$? != 0 ; then exit 1; fi ; \
    385       1.1     lukem 	    fi; \
    386       1.1     lukem 	done
    387       1.1     lukem 
    388   1.1.1.9  christos all-cffiles: slapd $(SLAPD_DYNAMIC_BACKENDS) dynamic_overlays dynamic_pwmods
    389       1.1     lukem 	@if test $(PLAT) = NT; then \
    390       1.1     lukem 	    sysconfdir=`cygpath -w $(sysconfdir) | \
    391       1.1     lukem 		$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
    392       1.1     lukem 	    localstatedir=`cygpath -w $(localstatedir) | \
    393       1.1     lukem 		$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
    394       1.1     lukem 	    moduledir=`cygpath -w $(moduledir) | \
    395       1.1     lukem 		$(SED) -e 's/\\\\/\\\\\\\\\\\\\\\\/g'`; \
    396       1.1     lukem 	else \
    397       1.1     lukem 	    sysconfdir=$(sysconfdir); \
    398       1.1     lukem 	    localstatedir=$(localstatedir); \
    399       1.1     lukem 	    moduledir=$(moduledir); \
    400       1.1     lukem 	fi; \
    401       1.1     lukem 	$(SED) -e "s;%SYSCONFDIR%;$$sysconfdir;" \
    402       1.1     lukem 		-e "s;%LOCALSTATEDIR%;$$localstatedir;" \
    403       1.1     lukem 		-e "s;%MODULEDIR%;$$moduledir;" \
    404   1.1.1.9  christos 		$(srcdir)/slapd.conf > slapd.conf.tmp || exit $$? ; \
    405   1.1.1.4      tron 	$(SED) -e "s;%SYSCONFDIR%;$$sysconfdir;" \
    406   1.1.1.4      tron 		-e "s;%LOCALSTATEDIR%;$$localstatedir;" \
    407   1.1.1.4      tron 		-e "s;%MODULEDIR%;$$moduledir;" \
    408   1.1.1.9  christos 		$(srcdir)/slapd.ldif > slapd.ldif.tmp || exit $$? ;
    409   1.1.1.9  christos 	@if test -n "$(systemdsystemunitdir)"; then \
    410   1.1.1.9  christos 		$(SED) -e "s;%LIBEXECDIR%;$(libexecdir);" \
    411   1.1.1.9  christos 			$(srcdir)/slapd.service > slapd.service.tmp ; \
    412   1.1.1.9  christos 	fi
    413       1.1     lukem 	touch all-cffiles
    414       1.1     lukem 
    415       1.1     lukem install-schema: FORCE
    416       1.1     lukem 	@if test -d $(DESTDIR)$(schemadir) ; then \
    417       1.1     lukem 		echo "MOVING EXISTING SCHEMA DIR to $(DESTDIR)$(schemadir).$$$$" ; \
    418       1.1     lukem 		mv $(DESTDIR)$(schemadir) $(DESTDIR)$(schemadir).$$$$ ; \
    419       1.1     lukem 	fi
    420       1.1     lukem 	$(MKDIR) $(DESTDIR)$(schemadir)
    421       1.1     lukem 	@SD=$(DESTDIR)$(schemadir) ; \
    422       1.1     lukem 	files=`cd $(srcdir)/schema ; echo README *.ldif *.schema` ; \
    423       1.1     lukem 	for i in $$files ; do \
    424       1.1     lukem 		echo $(INSTALL) $(INSTALLFLAGS) -m 444 schema/$$i $$SD/$$i ; \
    425       1.1     lukem 		$(INSTALL) $(INSTALLFLAGS) -m 444 $(srcdir)/schema/$$i $$SD/$$i ; \
    426       1.1     lukem 	done
    427       1.1     lukem 
    428       1.1     lukem install-conf: FORCE
    429       1.1     lukem 	@-$(MKDIR) $(DESTDIR)$(sysconfdir)
    430       1.1     lukem 	$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.conf.tmp $(DESTDIR)$(sysconfdir)/slapd.conf.default
    431       1.1     lukem 	if test ! -f $(DESTDIR)$(sysconfdir)/slapd.conf; then \
    432       1.1     lukem 		echo "installing slapd.conf in $(sysconfdir)"; \
    433       1.1     lukem 		echo "$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.conf.tmp $(DESTDIR)$(sysconfdir)/slapd.conf"; \
    434       1.1     lukem 		$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.conf.tmp $(DESTDIR)$(sysconfdir)/slapd.conf; \
    435       1.1     lukem 	else \
    436       1.1     lukem 		echo "PRESERVING EXISTING CONFIGURATION FILE $(DESTDIR)$(sysconfdir)/slapd.conf" ; \
    437       1.1     lukem 	fi
    438   1.1.1.4      tron 	$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif.default
    439   1.1.1.4      tron 	if test ! -f $(DESTDIR)$(sysconfdir)/slapd.ldif; then \
    440   1.1.1.4      tron 		echo "installing slapd.ldif in $(sysconfdir)"; \
    441   1.1.1.4      tron 		echo "$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif"; \
    442   1.1.1.4      tron 		$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif; \
    443   1.1.1.4      tron 	else \
    444   1.1.1.4      tron 		echo "PRESERVING EXISTING CONFIGURATION FILE $(DESTDIR)$(sysconfdir)/slapd.ldif" ; \
    445   1.1.1.4      tron 	fi
    446   1.1.1.9  christos 	if test -n "$(systemdsystemunitdir)" && test ! -f $(DESTDIR)$(systemdsystemunitdir)/slapd.service; then \
    447   1.1.1.9  christos 		$(MKDIR) $(DESTDIR)$(systemdsystemunitdir); \
    448   1.1.1.9  christos 		echo "installing slapd.service in $(systemdsystemunitdir)"; \
    449   1.1.1.9  christos 		echo "$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/slapd.service"; \
    450   1.1.1.9  christos 		$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/slapd.service; \
    451   1.1.1.9  christos 	fi
    452       1.1     lukem 
    453       1.1     lukem install-db-config: FORCE
    454       1.1     lukem 	@-$(MKDIR) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir)
    455       1.1     lukem 	@-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-data
    456       1.1     lukem 	$(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \
    457       1.1     lukem 		$(DESTDIR)$(localstatedir)/openldap-data/DB_CONFIG.example
    458       1.1     lukem 	$(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \
    459       1.1     lukem 		$(DESTDIR)$(sysconfdir)/DB_CONFIG.example
    460       1.1     lukem 
    461       1.1     lukem install-tools: FORCE
    462       1.1     lukem 	-$(MKDIR) $(DESTDIR)$(sbindir)
    463       1.1     lukem 	for i in $(SLAPTOOLS); do \
    464       1.1     lukem 		$(RM) $(DESTDIR)$(sbindir)/$$i$(EXEEXT); \
    465       1.1     lukem 		$(LN_S) -f $(DESTDIR)$(libexecdir)/slapd$(EXEEXT) $(DESTDIR)$(sbindir)/$$i$(EXEEXT); \
    466       1.1     lukem 	done
    467       1.1     lukem 
    468