BUILD_MONITOR=@BUILD_MONITOR@
BUILD_CACHE=@BUILD_CACHE@
-test: tests
-tests: int-bdb
+test: tests
+tests: ldbm
+ldbm: hdb
+hdb: bdb
-int-bdb: test-bdb
- @$(MAKE) int-hdb
-int-hdb: test-hdb
- @$(MAKE) int-ldbm
-int-ldbm: test-ldbm
-
-bdb: test-bdb
-test-bdb: FORCE
+links: data schema ucdata
+data:
@-$(LN_S) $(srcdir)/data .
+schema:
@-$(LN_S) $(top_srcdir)/servers/slapd/schema .
+ucdata:
@-$(LN_S) ../libraries/liblunicode ucdata
- @if test "$(BUILD_BDB)" != "no"; then \
- echo "Initiating LDAP tests for BDB..." ; \
- $(MKDIR) test-db test-repl || true; \
- $(srcdir)/scripts/all $(srcdir) bdb $(BUILD_BDB) $(BUILD_MONITOR) $(BUILD_CACHE) bdb ; \
- else \
- echo "run configure with --enable-bdb" ; \
- fi
-hdb: test-hdb
-test-hdb: FORCE
- @-$(LN_S) $(srcdir)/data .
- @-$(LN_S) $(top_srcdir)/servers/slapd/schema .
- @-$(LN_S) ../libraries/liblunicode ucdata
- @if test "$(BUILD_HDB)" != "no" ; then \
- echo "Initiating LDAP tests for HDB..." ; \
- $(MKDIR) test-db test-repl || true; \
- $(srcdir)/scripts/all $(srcdir) hdb $(BUILD_HDB) $(BUILD_MONITOR) $(BUILD_CACHE) hdb ; \
- else \
- echo "run configure with --enable-hdb" ; \
- fi
+dirs: test-db test-repl
+test-db test-repl:
+ @$(MKDIR) $@
-ldbm: test-ldbm
-test-ldbm: FORCE
- @-$(LN_S) $(srcdir)/data .
- @-$(LN_S) $(top_srcdir)/servers/slapd/schema .
- @-$(LN_S) ../libraries/liblunicode ucdata
- @if test "$(BUILD_LDBM)" != "no" ; then \
- echo "Initiating LDAP tests for LDBM..." ; \
- $(MKDIR) test-db test-repl || true; \
- if test "$(BUILD_BDB)" != "no"; then \
- $(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_LDBM) $(BUILD_MONITOR) $(BUILD_CACHE) bdb ; \
+test-bdb: bdb
+bdb: bdb-$(BUILD_BDB)
+bdb-no:
+ @echo "run configure with --enable-bdb"
+
+bdb-yes bdb-mod: links dirs FORCE
+ @echo "Initiating LDAP tests for BDB..."
+ @MONITORDB=$(BUILD_MONITOR) PROXYCACHE=$(BUILD_CACHE) BACKENDTYPE=$(BUILD_BDB) $(srcdir)/scripts/all $(srcdir) bdb bdb
+
+test-hdb: hdb
+hdb: hdb-$(BUILD_HDB)
+hdb-no:
+ @echo "run configure with --enable-hdb"
+
+hdb-yes hdb-mod: links dirs FORCE
+ @echo "Initiating LDAP tests for HDB..."
+ @MONITORDB=$(BUILD_MONITOR) PROXYCACHE=$(BUILD_CACHE) BACKENDTYPE=$(BUILD_HDB) $(srcdir)/scripts/all $(srcdir) hdb hdb
+
+test-ldbm: ldbm
+ldbm: ldbm-$(BUILD_LDBM)
+ldbm-no:
+ @echo "run configure with --enable-ldbm"
+
+ldbm-yes ldbm-mod: links dirs FORCE
+ @echo "Initiating LDAP tests for LDBM..."
+ @MONITORDB=$(BUILD_MONITOR); PROXYCACHE=$(BUILD_CACHE); \
+ BACKENDTYPE=$(BUILD_LDBM); export MONITORDB PROXYCACHE BACKENDTYPE; \
+ if test "$(BUILD_BDB)" != "no"; then \
+ $(srcdir)/scripts/all $(srcdir) ldbm bdb ; \
+ else \
+ if test "$(BUILD_HDB)" != "no"; then \
+ $(srcdir)/scripts/all $(srcdir) ldbm hdb ; \
else \
- if test "$(BUILD_HDB)" != "no"; then \
- $(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_LDBM) $(BUILD_MONITOR) $(BUILD_CACHE) hdb ; \
- else \
- $(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_LDBM) $(BUILD_MONITOR) $(BUILD_CACHE) no ; \
- fi ; \
+ $(srcdir)/scripts/all $(srcdir) ldbm no ; \
fi ; \
- else \
- echo "run configure with --enable-ldbm" ; \
fi
passwd: test-passwd
-test-passwd: FORCE
- @-$(LN_S) $(srcdir)/data .
- @-$(LN_S) $(top_srcdir)/servers/slapd/schema .
- @-$(LN_S) ../libraries/liblunicode ucdata
+test-passwd: links dirs FORCE
@echo "Initiating LDAP tests..."
- @-$(MKDIR) test-db test-repl || true
@$(srcdir)/scripts/passwd-search $(srcdir) passwd
test-nis-schema: test-nis-schema-ldbm
-test-nis-schema-ldbm:
- @-$(LN_S) $(srcdir)/data .
- @-$(LN_S) $(top_srcdir)/servers/slapd/schema .
- @-$(LN_S) ../libraries/liblunicode ucdata
+test-nis-schema-ldbm: links dirs FORCE
@echo "Initiating LDAP server with NIS schema & ldbm backend..."; \
- $(MKDIR) test-db test-repl ; \
$(srcdir)/scripts/startup_nis_ldap_server.sh $(srcdir) ldbm
clean-local: FORCE
echo ">>>>> Backend: $BACKEND"
-if test $# -eq 0 ; then
- BACKENDTYPE=yes
-else
- BACKENDTYPE=$1; shift
-fi
-
-echo ">>>>> Backend Type: $BACKENDTYPE"
-
-if test $# -eq 0 ; then
- MONITOR=no
-else
- MONITOR=$1; shift
-fi
+MONITORDB=${MONITORDB-no}
+PROXYCACHE=${PROXYCACHE-no}
+BACKENDTYPE=${BACKENDTYPE-yes}
-SHTOOL="$SRCDIR/../build/shtool"
+export MONITORDB PROXYCACHE BACKENDTYPE
-if test $# -eq 0 ; then
- PROXYCACHE=no
-else
- PROXYCACHE=$1; shift
-fi
+echo ">>>>> Backend Type: $BACKENDTYPE"
if test $# -eq 0 ; then
SYNCREPL=no
SYNCREPL=$1; shift
fi
+SHTOOL="$SRCDIR/../build/shtool"
+
TB=`$SHTOOL echo -e "%B"`
TN=`$SHTOOL echo -e "%b"`
for CMD in $SRCDIR/scripts/test*; do
echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."
- $CMD $SRCDIR $BACKEND $BACKENDTYPE $MONITOR $PROXYCACHE $SYNCREPL
+ $CMD $SRCDIR $BACKEND $SYNCREPL
RC=$?
if test $RC -eq 0 ; then
echo ">>>>> $CMD completed ${TB}OK${TN}."