-BUILD_BDB2 = @BUILD_BDB2@
-
-test: tests
-tests: bdb2 ldbm
-
-bdb2: test-bdb2
-test-bdb2: FORCE
- @-$(LN_S) $(srcdir)/data .
- @if test "$(BUILD_BDB2)" = "yes" ; then \
- echo "Initiating LDAP tests..." ; \
- $(MKDIR) test-db test-repl || true; \
- $(srcdir)/scripts/all $(srcdir) bdb2 ; \
- else \
- echo "run configure with --enable-bdb2" ; \
- fi
-
-ldbm: test-ldbm
-test-ldbm: FORCE
- @-$(LN_S) $(srcdir)/data .
- @echo "Initiating LDAP tests..."
- @-$(MKDIR) test-db test-repl || true
- @$(srcdir)/scripts/all $(srcdir) ldbm
-
-passwd: test-passwd
-test-passwd: FORCE
- @-$(LN_S) $(srcdir)/data .
- @echo "Initiating LDAP tests..."
- @-$(MKDIR) test-db test-repl || true
- @$(srcdir)/scripts/passwd-search $(srcdir) passwd
+BUILD_BDB=@BUILD_BDB@
+BUILD_HDB=@BUILD_HDB@
+BUILD_LDBM=@BUILD_LDBM@
+BUILD_SQL=@BUILD_SQL@
+
+test tests:
+ @$(MAKE) bdb
+ @$(MAKE) hdb
+ @$(MAKE) ldbm
+ @$(MAKE) sql
+
+bdb test-bdb: bdb-$(BUILD_BDB)
+bdb-no:
+ @echo "run configure with --enable-bdb to run BDB tests"
+
+bdb-yes bdb-mod: FORCE
+ @echo "Initiating LDAP tests for BDB..."
+ @$(RUN) -b bdb all
+
+hdb test-hdb: hdb-$(BUILD_HDB)
+hdb-no:
+ @echo "run configure with --enable-hdb to run HDB tests"
+
+hdb-yes hdb-mod: FORCE
+ @echo "Initiating LDAP tests for HDB..."
+ @$(RUN) -b hdb all
+
+ldbm test-ldbm: ldbm-$(BUILD_LDBM)
+ldbm-no:
+ @echo "run configure with --enable-ldbm to run LDBM tests"
+
+ldbm-yes ldbm-mod: FORCE
+ @echo "Initiating LDAP tests for LDBM..."
+ @$(RUN) -b ldbm all
+
+sql test-sql: sql-$(BUILD_SQL)
+sql-no:
+ @echo "run configure with --enable-sql to run SQL tests"
+
+sql-yes sql-mod: FORCE
+ @echo "Initiating LDAP tests for SQL..."
+ @$(RUN) -b sql sql-all