76e56da610aba331cdff2b27acd7ee0e45519ee3
[exim.git] / src / src / lookups / Makefile
1 # $Cambridge: exim/src/src/lookups/Makefile,v 1.9 2009/06/10 07:34:05 tom Exp $
2
3 # Make file for building all the available lookups.
4 # This is called from the main make file, after cd'ing
5 # to the lookups subdirectory.
6
7 # because the variable is EXPERIMENTAL_SPF and not LOOKUP_SPF
8 # we put this one here by default and compile a dummy if
9 # EXPERIMENTAL_SPF is not defined
10 OBJ=spf.o
11 MODS=
12
13 ifeq ($(LOOKUP_CDB),2)
14 MODS += cdb.so
15 LOOKUP_cdb_INCLUDE = $(LOOKUP_CDB_INCLUDE)
16 LOOKUP_cdb_LIBS = $(LOOKUP_CDB_LIBS)
17 else
18 ifneq ($(LOOKUP_CDB),)
19 OBJ += cdb.o
20 endif
21 endif
22
23 ifeq ($(LOOKUP_DBM),2)
24 MODS += dbmdb.so
25 LOOKUP_dbmdb_INCLUDE = $(LOOKUP_DBM_INCLUDE)
26 LOOKUP_dbmdb_LIBS = $(LOOKUP_DBM_LIBS)
27 else
28 ifneq ($(LOOKUP_DBM),)
29 OBJ += dbmdb.o
30 endif
31 endif
32
33 ifeq ($(LOOKUP_DNSDB),2)
34 MODS += dnsdb.so
35 LOOKUP_dnsdb_INCLUDE = $(LOOKUP_DNSDB_INCLUDE)
36 LOOKUP_dnsdb_LIBS = $(LOOKUP_DNSDB_LIBS)
37 else
38 ifneq ($(LOOKUP_DNSDB),)
39 OBJ += dnsdb.o
40 endif
41 endif
42
43 ifeq ($(LOOKUP_DSEARCH),2)
44 MODS += dsearch.so
45 LOOKUP_dsearch_INCLUDE = $(LOOKUP_DSEARCH_INCLUDE)
46 LOOKUP_dsearch_LIBS = $(LOOKUP_DSEARCH_LIBS)
47 else
48 ifneq ($(LOOKUP_DSEARCH),)
49 OBJ += dsearch.o
50 endif
51 endif
52
53 ifeq ($(LOOKUP_IBASE),2)
54 MODS += ibase.so
55 LOOKUP_ibase_INCLUDE = $(LOOKUP_IBASE_INCLUDE)
56 LOOKUP_ibase_LIBS = $(LOOKUP_IBASE_LIBS)
57 else
58 ifneq ($(LOOKUP_IBASE),)
59 OBJ += ibase.o
60 endif
61 endif
62
63 ifneq ($(LOOKUP_LDAP),)
64 OBJ += ldap.o
65 endif
66
67 ifeq ($(LOOKUP_LSEARCH),2)
68 MODS += lsearch.so
69 LOOKUP_lsearch_INCLUDE = $(LOOKUP_LSEARCH_INCLUDE)
70 LOOKUP_lsearch_LIBS = $(LOOKUP_LSEARCH_LIBS)
71 else
72 ifneq ($(LOOKUP_LSEARCH),)
73 OBJ += lsearch.o
74 endif
75 endif
76
77 ifeq ($(LOOKUP_MYSQL),2)
78 MODS += mysql.so
79 LOOKUP_mysql_INCLUDE = $(LOOKUP_MYSQL_INCLUDE)
80 LOOKUP_mysql_LIBS = $(LOOKUP_MYSQL_LIBS)
81 else
82 ifneq ($(LOOKUP_MYSQL),)
83 OBJ += mysql.o
84 endif
85 endif
86
87 ifeq ($(LOOKUP_NIS),2)
88 MODS += nis.so
89 LOOKUP_nis_INCLUDE = $(LOOKUP_NIS_INCLUDE)
90 LOOKUP_nis_LIBS = $(LOOKUP_NIS_LIBS)
91 else
92 ifneq ($(LOOKUP_NIS),)
93 OBJ += nis.o
94 endif
95 endif
96
97 ifeq ($(LOOKUP_NISPLUS),2)
98 MODS += nisplus.so
99 LOOKUP_nisplus_INCLUDE = $(LOOKUP_NISPLUS_INCLUDE)
100 LOOKUP_nisplus_LIBS = $(LOOKUP_NISPLUS_LIBS)
101 else
102 ifneq ($(LOOKUP_NISPLUS),)
103 OBJ += nisplus.o
104 endif
105 endif
106
107 ifeq ($(LOOKUP_ORACLE),2)
108 MODS += oracle.so
109 LOOKUP_oracle_INCLUDE = $(LOOKUP_ORACLE_INCLUDE)
110 LOOKUP_oracle_LIBS = $(LOOKUP_ORACLE_LIBS)
111 else
112 ifneq ($(LOOKUP_ORACLE),)
113 OBJ += oracle.o
114 endif
115 endif
116
117 ifeq ($(LOOKUP_PASSWD),2)
118 MODS += passwd.so
119 LOOKUP_passwd_INCLUDE = $(LOOKUP_PASSWD_INCLUDE)
120 LOOKUP_passwd_LIBS = $(LOOKUP_PASSWD_LIBS)
121 else
122 ifneq ($(LOOKUP_PASSWD),)
123 OBJ += passwd.o
124 endif
125 endif
126
127 ifeq ($(LOOKUP_PGSQL),2)
128 MODS += pgsql.so
129 LOOKUP_pgsql_INCLUDE = $(LOOKUP_PGSQL_INCLUDE)
130 LOOKUP_pgsql_LIBS = $(LOOKUP_PGSQL_LIBS)
131 else
132 ifneq ($(LOOKUP_PGSQL),)
133 OBJ += pgsql.o
134 endif
135 endif
136
137 ifeq ($(LOOKUP_SQLITE),2)
138 MODS += sqlite.so
139 LOOKUP_sqlite_INCLUDE = $(LOOKUP_SQLITE_INCLUDE)
140 LOOKUP_sqlite_LIBS = $(LOOKUP_SQLITE_LIBS)
141 else
142 ifneq ($(LOOKUP_SQLITE),)
143 OBJ += sqlite.o
144 endif
145 endif
146
147 ifeq ($(LOOKUP_TESTDB),2)
148 MODS += testdb.so
149 LOOKUP_testdb_INCLUDE = $(LOOKUP_TESTDB_INCLUDE)
150 LOOKUP_testdb_LIBS = $(LOOKUP_TESTDB_LIBS)
151 else
152 ifneq ($(LOOKUP_TESTDB),)
153 OBJ += testdb.o
154 endif
155 endif
156
157 ifeq ($(LOOKUP_WHOSON),2)
158 MODS += whoson.so
159 LOOKUP_whoson_INCLUDE = $(LOOKUP_WHOSON_INCLUDE)
160 LOOKUP_whoson_LIBS = $(LOOKUP_WHOSON_LIBS)
161 else
162 ifneq ($(LOOKUP_WHOSON),)
163 OBJ += whoson.o
164 endif
165 endif
166
167
168 all:             lookups.a lf_quote.o lf_check_file.o lf_sqlperform.o $(MODS)
169
170 lookups.a:       $(OBJ)
171                  @$(RM_COMMAND) -f lookups.a
172                  @echo "$(AR) lookups.a"
173                  @$(AR) lookups.a $(OBJ)
174                  $(RANLIB) $@
175
176 .SUFFIXES:       .o .c .so
177 .c.o:;           @echo "$(CC) $*.c"
178                  $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $*.c
179
180 .c.so:;          @echo "$(CC) -shared $*.c"
181                  $(FE)$(CC) $(LOOKUP_$*_INCLUDE) $(LOOKUP_$*_LIBS) -DDYNLOOKUP -shared -rdynamic $(CFLAGS) $(INCLUDE) $(DLFLAGS) $*.c -o $@
182
183 lf_check_file.o: $(HDRS) lf_check_file.c  lf_functions.h
184 lf_quote.o:      $(HDRS) lf_quote.c       lf_functions.h
185 lf_sqlperform.o: $(HDRS) lf_sqlperform.c  lf_functions.h
186
187 cdb.o:           $(HDRS) cdb.c
188 dbmdb.o:         $(HDRS) dbmdb.c
189 dnsdb.o:         $(HDRS) dnsdb.c
190 dsearch.o:       $(HDRS) dsearch.c
191 ibase.o:         $(HDRS) ibase.c
192 ldap.o:          $(HDRS) ldap.c
193 lsearch.o:       $(HDRS) lsearch.c
194 mysql.o:         $(HDRS) mysql.c
195 nis.o:           $(HDRS) nis.c
196 nisplus.o:       $(HDRS) nisplus.c
197 oracle.o:        $(HDRS) oracle.c
198 passwd.o:        $(HDRS) passwd.c
199 pgsql.o:         $(HDRS) pgsql.c
200 spf.o:           $(HDRS) spf.c
201 sqlite.o:        $(HDRS) sqlite.c
202 testdb.o:        $(HDRS) testdb.c
203 whoson.o:        $(HDRS) whoson.c
204
205 cdb.so:           $(HDRS) cdb.c
206 dbmdb.so:         $(HDRS) dbmdb.c
207 dnsdb.so:         $(HDRS) dnsdb.c
208 dsearch.so:       $(HDRS) dsearch.c
209 ibase.so:         $(HDRS) ibase.c
210 ldap.so:          $(HDRS) ldap.c
211 lsearch.so:       $(HDRS) lsearch.c
212 mysql.so:         $(HDRS) mysql.c
213 nis.so:           $(HDRS) nis.c
214 nisplus.so:       $(HDRS) nisplus.c
215 oracle.so:        $(HDRS) oracle.c
216 passwd.so:        $(HDRS) passwd.c
217 pgsql.so:         $(HDRS) pgsql.c
218 spf.so:           $(HDRS) spf.c
219 sqlite.so:        $(HDRS) sqlite.c
220 testdb.so:        $(HDRS) testdb.c
221 whoson.so:        $(HDRS) whoson.c
222
223 # End