-# $Cambridge: exim/src/src/lookups/Makefile,v 1.4 2005/08/01 13:20:28 ph10 Exp $
+# Make file for building Exim's lookup modules.
+# This is called from the main make file, after cd'ing
+# to the lookups subdirectory.
-# Make file for building a library containing all the available lookups and
-# calling it lookups.a. This is called from the main make file, after cd'ing
-# to the lookups subdirectory. When the relevant LOOKUP_ macros are not
-# defined, dummy modules get compiled.
+# nb: at build time, the version of this file used will have had some
+# extra variable definitions and prepended to it and module build rules
+# interpolated below.
-OBJ = cdb.o dbmdb.o dnsdb.o dsearch.o ibase.o ldap.o lsearch.o mysql.o nis.o \
- nisplus.o oracle.o passwd.o pgsql.o spf.o sqlite.o testdb.o whoson.o \
- lf_check_file.o lf_quote.o
+# MAGIC-TAG-MODS-OBJ-RULES-GO-HERE
+
+
+all: lookups.a lf_quote.o lf_check_file.o lf_sqlperform.o $(MODS)
lookups.a: $(OBJ)
- @/bin/rm -f lookups.a
+ @$(RM_COMMAND) -f lookups.a
@echo "$(AR) lookups.a"
@$(AR) lookups.a $(OBJ)
$(RANLIB) $@
- @/bin/rm -rf ../drtables.o
-.SUFFIXES: .o .c
+.SUFFIXES: .o .c .so
.c.o:; @echo "$(CC) $*.c"
$(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $*.c
-lf_check_file.o: $(HDRS) lf_check_file.c lf_functions.h
-lf_quote.o: $(HDRS) lf_quote.c lf_functions.h
-
-cdb.o: $(HDRS) cdb.c cdb.h
-dbmdb.o: $(HDRS) dbmdb.c dbmdb.h
-dnsdb.o: $(HDRS) dnsdb.c dnsdb.h
-dsearch.o: $(HDRS) dsearch.c dsearch.h
-ibase.o: $(HDRS) ibase.c ibase.h
-ldap.o: $(HDRS) ldap.c ldap.h
-lsearch.o: $(HDRS) lsearch.c lsearch.h
-mysql.o: $(HDRS) mysql.c mysql.h
-nis.o: $(HDRS) nis.c nis.h
-nisplus.o: $(HDRS) nisplus.c nisplus.h
-oracle.o: $(HDRS) oracle.c oracle.h
-passwd.o: $(HDRS) passwd.c passwd.h
-pgsql.o: $(HDRS) pgsql.c pgsql.h
-spf.o: $(HDRS) spf.c spf.h
-sqlite.o: $(HDRS) sqlite.c sqlite.h
-testdb.o: $(HDRS) testdb.c testdb.h
-whoson.o: $(HDRS) whoson.c whoson.h
+.c.so:; @echo "$(CC) -shared $*.c"
+ $(FE)$(CC) $(LOOKUP_$*_INCLUDE) $(LOOKUP_$*_LIBS) -DDYNLOOKUP $(CFLAGS_DYNAMIC) $(CFLAGS) $(INCLUDE) $(DLFLAGS) $*.c -o $@
+
+lf_check_file.o: $(PHDRS) lf_check_file.c lf_functions.h
+lf_quote.o: $(PHDRS) lf_quote.c lf_functions.h
+lf_sqlperform.o: $(PHDRS) lf_sqlperform.c lf_functions.h
+
+cdb.o: $(PHDRS) cdb.c
+dbmdb.o: $(PHDRS) dbmdb.c
+dnsdb.o: $(PHDRS) dnsdb.c
+dsearch.o: $(PHDRS) dsearch.c
+ibase.o: $(PHDRS) ibase.c
+ldap.o: $(PHDRS) ldap.c
+lsearch.o: $(PHDRS) lsearch.c
+mysql.o: $(PHDRS) mysql.c
+nis.o: $(PHDRS) nis.c
+nisplus.o: $(PHDRS) nisplus.c
+oracle.o: $(PHDRS) oracle.c
+passwd.o: $(PHDRS) passwd.c
+pgsql.o: $(PHDRS) pgsql.c
+spf.o: $(PHDRS) spf.c
+sqlite.o: $(PHDRS) sqlite.c
+testdb.o: $(PHDRS) testdb.c
+whoson.o: $(PHDRS) whoson.c
+
+cdb.so: $(PHDRS) cdb.c
+dbmdb.so: $(PHDRS) dbmdb.c
+dnsdb.so: $(PHDRS) dnsdb.c
+dsearch.so: $(PHDRS) dsearch.c
+ibase.so: $(PHDRS) ibase.c
+ldap.so: $(PHDRS) ldap.c
+lsearch.so: $(PHDRS) lsearch.c
+mysql.so: $(PHDRS) mysql.c
+nis.so: $(PHDRS) nis.c
+nisplus.so: $(PHDRS) nisplus.c
+oracle.so: $(PHDRS) oracle.c
+passwd.so: $(PHDRS) passwd.c
+pgsql.so: $(PHDRS) pgsql.c
+spf.so: $(PHDRS) spf.c
+sqlite.so: $(PHDRS) sqlite.c
+testdb.so: $(PHDRS) testdb.c
+whoson.so: $(PHDRS) whoson.c
# End