Fix autoconf 2.70 compatibility
[platform/upstream/krb5.git] / src / Makefile.in
1 datadir=@datadir@
2
3 mydir=.
4 # Don't build sample by default, and definitely don't install them
5 # for production use:
6 #       plugins/locate/python
7 #       plugins/preauth/wpse
8 #       plugins/preauth/cksum_body
9 SUBDIRS=util include lib \
10         @sam2_plugin@ \
11         plugins/audit \
12         plugins/audit/test \
13         @audit_plugin@ \
14         plugins/kadm5_hook/test \
15         plugins/kadm5_auth/test \
16         plugins/hostrealm/test \
17         plugins/localauth/test \
18         plugins/pwqual/test \
19         plugins/authdata/greet_server \
20         plugins/authdata/greet_client \
21         plugins/certauth/test \
22         plugins/kdb/db2 \
23         @ldap_plugin_dir@ \
24         @lmdb_plugin_dir@ \
25         plugins/kdb/test \
26         plugins/kdcpolicy/test \
27         plugins/preauth/otp \
28         plugins/preauth/pkinit \
29         plugins/preauth/spake \
30         plugins/preauth/test \
31         plugins/tls/k5tls \
32         kdc kadmin kprop clients appl tests \
33         config-files build-tools man doc @po@
34 WINSUBDIRS=include util lib ccapi windows clients appl plugins\preauth\spake
35 BUILDTOP=$(REL).
36
37 SRCS =  
38 HDRS = 
39
40 # Why aren't these flags showing up in Windows builds?
41 ##DOS##CPPFLAGS=$(CPPFLAGS) -D_X86_=1  -DWIN32 -D_WIN32 -W3 -D_WINNT
42
43 # Lots of things will start to depend on the thread support, which
44 # needs autoconf.h, but building "all" in include requires that util/et
45 # have been built first.  Until we can untangle this, let's just check
46 # that autoconf.h is up to date before going into any of the subdirectories.
47 all-prerecurse generate-files-mac-prerecurse: update-autoconf-h
48 update-autoconf-h:
49         (cd include && $(MAKE) autoconf.h osconf.h)
50
51 ##DOS##!if 0
52 # This makefile doesn't use lib.in, but we still need shlib.conf here.
53 config.status: $(top_srcdir)/config/shlib.conf
54 ##DOS##!endif
55
56 all-windows: maybe-awk Makefile-windows
57
58 world:
59         date
60         make $(MFLAGS) all
61         date
62
63 INSTALLMKDIRS = $(KRB5ROOT) $(KRB5MANROOT) $(KRB5OTHERMKDIRS) \
64                 $(ADMIN_BINDIR) $(SERVER_BINDIR) $(CLIENT_BINDIR) \
65                 $(ADMIN_MANDIR) $(SERVER_MANDIR) $(CLIENT_MANDIR) \
66                 $(FILE_MANDIR) $(OVERVIEW_MANDIR) \
67                 $(ADMIN_CATDIR) $(SERVER_CATDIR) $(CLIENT_CATDIR) \
68                 $(FILE_CATDIR) $(OVERVIEW_CATDIR) \
69                 $(KRB5_LIBDIR) $(KRB5_INCDIR) \
70                 $(KRB5_DB_MODULE_DIR) $(KRB5_PA_MODULE_DIR) \
71                 $(KRB5_AD_MODULE_DIR) \
72                 $(KRB5_LIBKRB5_MODULE_DIR) $(KRB5_TLS_MODULE_DIR) \
73                 @localstatedir@ @localstatedir@/krb5kdc \
74                 @runstatedir@ @runstatedir@/krb5kdc \
75                 $(KRB5_INCSUBDIRS) $(datadir) $(EXAMPLEDIR) \
76                 $(PKGCONFIG_DIR)
77
78 install-strip:
79         $(MAKE) install INSTALL_STRIP=-s
80
81 install-recurse: install-mkdirs
82
83 install-mkdirs:
84         @for i in $(INSTALLMKDIRS); do \
85                 $(srcdir)/config/mkinstalldirs $(DESTDIR)$$i; \
86         done
87
88 install-headers-mkdirs:
89         $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)
90         $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/gssapi
91         $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/gssrpc
92 install-headers-prerecurse: install-headers-mkdirs
93
94 clean-:: clean-windows
95 clean-unix::
96         $(RM) *.o core skiptests
97
98 # Microsoft Windows build process...
99 #
100
101 config-windows: Makefile-windows
102 #       @echo Making in include
103 #       cd include
104 #       $(MAKE) -$(MFLAGS)
105 #       cd ..
106
107 #
108 # We need outpre-dir explicitly in here because we may
109 # try to build wconfig on a config-windows.
110 #
111 ##DOS##$(WCONFIG_EXE): outpre-dir wconfig.c
112 ##DOS## $(CC) -Fe$@ -Fo$*.obj wconfig.c $(CCLINKOPTION)
113 ##DOS## $(_VC_MANIFEST_EMBED_EXE)
114
115 ##DOS##MKFDEP=$(WCONFIG_EXE) config\win-pre.in config\win-post.in
116
117 WINMAKEFILES=Makefile \
118         appl\Makefile appl\gss-sample\Makefile \
119         ccapi\Makefile \
120         ccapi\lib\win\Makefile \
121         ccapi\server\win\Makefile \
122         ccapi\test\Makefile \
123         clients\Makefile clients\kdestroy\Makefile \
124         clients\kinit\Makefile clients\klist\Makefile \
125         clients\kpasswd\Makefile clients\kvno\Makefile \
126         clients\kcpytkt\Makefile clients\kdeltkt\Makefile \
127         clients\kswitch\Makefile \
128         include\Makefile \
129         lib\Makefile lib\crypto\Makefile lib\crypto\krb\Makefile \
130         lib\crypto\builtin\Makefile lib\crypto\builtin\aes\Makefile \
131         lib\crypto\builtin\enc_provider\Makefile \
132         lib\crypto\builtin\des\Makefile lib\crypto\builtin\md5\Makefile \
133         lib\crypto\builtin\camellia\Makefile lib\crypto\builtin\md4\Makefile \
134         lib\crypto\builtin\hash_provider\Makefile \
135         lib\crypto\builtin\sha2\Makefile lib\crypto\builtin\sha1\Makefile \
136         lib\crypto\crypto_tests\Makefile \
137         lib\gssapi\Makefile lib\gssapi\generic\Makefile \
138         lib\gssapi\krb5\Makefile lib\gssapi\mechglue\Makefile \
139         lib\gssapi\spnego\Makefile \
140         lib\krb5\Makefile \
141         lib\krb5\asn.1\Makefile lib\krb5\ccache\Makefile \
142         lib\krb5\ccache\ccapi\Makefile \
143         lib\krb5\error_tables\Makefile \
144         lib\krb5\keytab\Makefile \
145         lib\krb5\krb\Makefile \
146         lib\krb5\os\Makefile lib\krb5\posix\Makefile \
147         lib\krb5\rcache\Makefile \
148         lib\krb5\unicode\Makefile \
149         util\Makefile \
150         util\et\Makefile util\profile\Makefile util\profile\testmod\Makefile \
151         util\support\Makefile \
152         util\windows\Makefile \
153         windows\Makefile windows\lib\Makefile windows\ms2mit\Makefile \
154         windows\kfwlogon\Makefile windows\leashdll\Makefile \
155         windows\leash\Makefile windows\leash\htmlhelp\Makefile \
156         plugins\preauth\spake\Makefile
157
158 ##DOS##Makefile-windows: $(MKFDEP) $(WINMAKEFILES)
159
160 ##DOS##Makefile: Makefile.in $(MKFDEP)
161 ##DOS## $(WCONFIG) config < $@.in > $@
162 ##DOS##appl\Makefile: appl\Makefile.in $(MKFDEP)
163 ##DOS## $(WCONFIG) config < $@.in > $@
164 ##DOS##appl\gss-sample\Makefile: appl\gss-sample\Makefile.in $(MKFDEP)
165 ##DOS## $(WCONFIG) config < $@.in > $@
166 ##DOS##ccapi\Makefile: ccapi\Makefile.in $(MKFDEP)
167 ##DOS## $(WCONFIG) config < $@.in > $@
168 ##DOS##ccapi\lib\win\Makefile: ccapi\lib\win\Makefile.in $(MKFDEP)
169 ##DOS## $(WCONFIG) config < $@.in > $@
170 ##DOS##ccapi\server\win\Makefile: ccapi\server\win\Makefile.in $(MKFDEP)
171 ##DOS## $(WCONFIG) config < $@.in > $@
172 ##DOS##ccapi\test\Makefile: ccapi\test\Makefile.in $(MKFDEP)
173 ##DOS## $(WCONFIG) config < $@.in > $@
174 ##DOS##clients\Makefile: clients\Makefile.in $(MKFDEP)
175 ##DOS## $(WCONFIG) config < $@.in > $@
176 ##DOS##clients\kdestroy\Makefile: clients\kdestroy\Makefile.in $(MKFDEP)
177 ##DOS## $(WCONFIG) config < $@.in > $@
178 ##DOS##clients\kinit\Makefile: clients\kinit\Makefile.in $(MKFDEP)
179 ##DOS## $(WCONFIG) config < $@.in > $@
180 ##DOS##clients\klist\Makefile: clients\klist\Makefile.in $(MKFDEP)
181 ##DOS## $(WCONFIG) config < $@.in > $@
182 ##DOS##clients\kpasswd\Makefile: clients\kpasswd\Makefile.in $(MKFDEP)
183 ##DOS## $(WCONFIG) config < $@.in > $@
184 ##DOS##clients\kswitch\Makefile: clients\kswitch\Makefile.in $(MKFDEP)
185 ##DOS## $(WCONFIG) config < $@.in > $@
186 ##DOS##clients\kvno\Makefile: clients\kvno\Makefile.in $(MKFDEP)
187 ##DOS## $(WCONFIG) config < $@.in > $@
188 ##DOS##clients\kcpytkt\Makefile: clients\kcpytkt\Makefile.in $(MKFDEP)
189 ##DOS## $(WCONFIG) config < $@.in > $@
190 ##DOS##clients\kdeltkt\Makefile: clients\kdeltkt\Makefile.in $(MKFDEP)
191 ##DOS## $(WCONFIG) config < $@.in > $@
192 ##DOS##include\Makefile: include\Makefile.in $(MKFDEP)
193 ##DOS## $(WCONFIG) config < $@.in > $@
194 ##DOS##lib\Makefile: lib\Makefile.in $(MKFDEP)
195 ##DOS## $(WCONFIG) config < $@.in > $@
196 ##DOS##lib\crypto\Makefile: lib\crypto\Makefile.in $(MKFDEP)
197 ##DOS## $(WCONFIG) config < $@.in > $@
198 ##DOS##lib\crypto\krb\Makefile: lib\crypto\krb\Makefile.in $(MKFDEP)
199 ##DOS## $(WCONFIG) config < $@.in > $@
200 ##DOS##lib\crypto\builtin\aes\Makefile: lib\crypto\builtin\aes\Makefile.in $(MKFDEP)
201 ##DOS## $(WCONFIG) config < $@.in > $@
202 ##DOS##lib\crypto\builtin\enc_provider\Makefile: lib\crypto\builtin\enc_provider\Makefile.in $(MKFDEP)
203 ##DOS## $(WCONFIG) config < $@.in > $@
204 ##DOS##lib\crypto\builtin\des\Makefile: lib\crypto\builtin\des\Makefile.in $(MKFDEP)
205 ##DOS## $(WCONFIG) config < $@.in > $@
206 ##DOS##lib\crypto\builtin\md5\Makefile: lib\crypto\builtin\md5\Makefile.in $(MKFDEP)
207 ##DOS## $(WCONFIG) config < $@.in > $@
208 ##DOS##lib\crypto\builtin\camellia\Makefile: lib\crypto\builtin\camellia\Makefile.in $(MKFDEP)
209 ##DOS## $(WCONFIG) config < $@.in > $@
210 ##DOS##lib\crypto\builtin\md4\Makefile: lib\crypto\builtin\md4\Makefile.in $(MKFDEP)
211 ##DOS## $(WCONFIG) config < $@.in > $@
212 ##DOS##lib\crypto\builtin\hash_provider\Makefile: lib\crypto\builtin\hash_provider\Makefile.in $(MKFDEP)
213 ##DOS## $(WCONFIG) config < $@.in > $@
214 ##DOS##lib\crypto\builtin\sha2\Makefile: lib\crypto\builtin\sha2\Makefile.in $(MKFDEP)
215 ##DOS## $(WCONFIG) config < $@.in > $@
216 ##DOS##lib\crypto\builtin\sha1\Makefile: lib\crypto\builtin\sha1\Makefile.in $(MKFDEP)
217 ##DOS## $(WCONFIG) config < $@.in > $@
218 ##DOS##lib\crypto\builtin\Makefile: lib\crypto\builtin\Makefile.in $(MKFDEP)
219 ##DOS## $(WCONFIG) config < $@.in > $@
220 ##DOS##lib\crypto\crypto_tests\Makefile: lib\crypto\crypto_tests\Makefile.in $(MKFDEP)
221 ##DOS## $(WCONFIG) config < $@.in > $@
222 ##DOS##lib\gssapi\Makefile: lib\gssapi\Makefile.in $(MKFDEP)
223 ##DOS## $(WCONFIG) config < $@.in > $@
224 ##DOS##lib\gssapi\generic\Makefile: lib\gssapi\generic\Makefile.in $(MKFDEP)
225 ##DOS## $(WCONFIG) config < $@.in > $@
226 ##DOS##lib\gssapi\mechglue\Makefile: lib\gssapi\mechglue\Makefile.in $(MKFDEP)
227 ##DOS## $(WCONFIG) config < $@.in > $@
228 ##DOS##lib\gssapi\spnego\Makefile: lib\gssapi\spnego\Makefile.in $(MKFDEP)
229 ##DOS## $(WCONFIG) config < $@.in > $@
230 ##DOS##lib\gssapi\krb5\Makefile: lib\gssapi\krb5\Makefile.in $(MKFDEP)
231 ##DOS## $(WCONFIG) config < $@.in > $@
232 ##DOS##lib\krb5\Makefile: lib\krb5\Makefile.in $(MKFDEP)
233 ##DOS## $(WCONFIG) config < $@.in > $@
234 ##DOS##lib\krb5\asn.1\Makefile: lib\krb5\asn.1\Makefile.in $(MKFDEP)
235 ##DOS## $(WCONFIG) config < $@.in > $@
236 ##DOS##lib\krb5\ccache\Makefile: lib\krb5\ccache\Makefile.in $(MKFDEP)
237 ##DOS## $(WCONFIG) config < $@.in > $@
238 ##DOS##lib\krb5\ccache\ccapi\Makefile: lib\krb5\ccache\ccapi\Makefile.in $(MKFDEP)
239 ##DOS## $(WCONFIG) config < $@.in > $@
240 ##DOS##lib\krb5\error_tables\Makefile: lib\krb5\error_tables\Makefile.in $(MKFDEP)
241 ##DOS## $(WCONFIG) config < $@.in > $@
242 ##DOS##lib\krb5\keytab\Makefile: $$@.in $(MKFDEP)
243 ##DOS## $(WCONFIG) config < $@.in > $@
244 ##DOS##lib\krb5\krb\Makefile: lib\krb5\krb\Makefile.in $(MKFDEP)
245 ##DOS## $(WCONFIG) config < $@.in > $@
246 ##DOS##lib\krb5\os\Makefile: lib\krb5\os\Makefile.in $(MKFDEP)
247 ##DOS## $(WCONFIG) config < $@.in > $@
248 ##DOS##lib\krb5\posix\Makefile: lib\krb5\posix\Makefile.in $(MKFDEP)
249 ##DOS## $(WCONFIG) config < $@.in > $@
250 ##DOS##lib\krb5\rcache\Makefile: lib\krb5\rcache\Makefile.in $(MKFDEP)
251 ##DOS## $(WCONFIG) config < $@.in > $@
252 ##DOS##lib\krb5\unicode\Makefile: lib\krb5\unicode\Makefile.in $(MKFDEP)
253 ##DOS## $(WCONFIG) config < $@.in > $@
254 ##DOS##util\Makefile: util\Makefile.in $(MKFDEP)
255 ##DOS## $(WCONFIG) config < $@.in > $@
256 ##DOS##util\et\Makefile: util\et\Makefile.in $(MKFDEP)
257 ##DOS## $(WCONFIG) config < $@.in > $@
258 ##DOS##util\profile\Makefile: util\profile\Makefile.in $(MKFDEP)
259 ##DOS## $(WCONFIG) config < $@.in > $@
260 ##DOS##util\profile\testmod\Makefile: util\profile\testmod\Makefile.in $(MKFDEP)
261 ##DOS## $(WCONFIG) config < $@.in > $@
262 ##DOS##util\support\Makefile: util\support\Makefile.in $(MKFDEP)
263 ##DOS## $(WCONFIG) config < $@.in > $@
264 ##DOS##util\windows\Makefile: util\windows\Makefile.in $(MKFDEP)
265 ##DOS## $(WCONFIG) config < $@.in > $@
266 ##DOS##windows\Makefile: windows\Makefile.in $(MKFDEP)
267 ##DOS## $(WCONFIG) config < $@.in > $@
268 ##DOS##windows\lib\Makefile: windows\lib\Makefile.in $(MKFDEP)
269 ##DOS## $(WCONFIG) config < $@.in > $@
270 ##DOS##windows\ms2mit\Makefile: windows\ms2mit\Makefile.in $(MKFDEP)
271 ##DOS## $(WCONFIG) config < $@.in > $@
272 ##DOS##windows\kfwlogon\Makefile: windows\kfwlogon\Makefile.in $(MKFDEP)
273 ##DOS## $(WCONFIG) config < $@.in > $@
274 ##DOS##windows\leashdll\Makefile: windows\leashdll\Makefile.in $(MKFDEP)
275 ##DOS## $(WCONFIG) config < $@.in > $@
276 ##DOS##windows\leash\Makefile: windows\leash\Makefile.in $(MKFDEP)
277 ##DOS## $(WCONFIG) config < $@.in > $@
278 ##DOS##windows\leash\htmlhelp\Makefile: windows\leash\htmlhelp\Makefile.in $(MKFDEP)
279 ##DOS## $(WCONFIG) config < $@.in > $@
280 ##DOS##plugins\preauth\spake\Makefile: plugins\preauth\spake\Makefile.in $(MKFDEP)
281 ##DOS## $(WCONFIG) config < $@.in > $@
282
283 clean-windows:: Makefile-windows
284
285 #
286 # Renames DOS 8.3 filenames back to their proper, longer names.
287 #
288 ren2long:
289         -sh config/ren2long
290
291 #
292 # Helper for the windows build
293 #
294 TOPLEVEL=dummy
295
296 #
297 # Building error tables requires awk.
298 #
299 AWK = awk
300 AH  = util/et/et_h.awk
301 AC  = util/et/et_c.awk
302 INC = include/
303 ET  = lib/krb5/error_tables/
304 GG  = lib/gssapi/generic/
305 GK  = lib/gssapi/krb5/
306 PR  = util/profile/
307 CE  = util/et/
308 CCL = ccapi/lib/
309
310 ETOUT = \
311         $(INC)asn1_err.h $(ET)asn1_err.c \
312         $(INC)kdb5_err.h $(ET)kdb5_err.c \
313         $(INC)krb5_err.h $(ET)krb5_err.c \
314         $(INC)k5e1_err.h $(ET)k5e1_err.c \
315         $(INC)kv5m_err.h $(ET)kv5m_err.c \
316         $(INC)krb524_err.h $(ET)krb524_err.c \
317         $(PR)prof_err.h $(PR)prof_err.c \
318         $(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.c \
319         $(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.c \
320         $(CCL)ccapi_err.h $(CCL)ccapi_err.c
321
322 HOUT =  $(INC)krb5/krb5.h $(GG)gssapi.h $(PR)profile.h
323
324 CLEANUP= Makefile $(ETOUT) $(HOUT) \
325         include/profile.h include/osconf.h
326
327
328 dos-Makefile:
329         cat config/win-pre.in Makefile.in config/win-post.in | \
330                 sed -e "s/^##DOS##//" -e "s/^##DOS//" > Makefile.tmp
331         mv Makefile.tmp Makefile
332
333 prep-windows: dos-Makefile awk-windows-mac
334
335
336 $(INC)asn1_err.h: $(AH) $(ET)asn1_err.et
337         $(AWK) -f $(AH) outfile=$@ $(ET)asn1_err.et
338 $(INC)kdb5_err.h: $(AH) $(ET)kdb5_err.et
339         $(AWK) -f $(AH) outfile=$@ $(ET)kdb5_err.et
340 $(INC)krb5_err.h: $(AH) $(ET)krb5_err.et
341         $(AWK) -f $(AH) outfile=$@ $(ET)krb5_err.et
342 $(INC)k5e1_err.h: $(AH) $(ET)k5e1_err.et
343         $(AWK) -f $(AH) outfile=$@ $(ET)k5e1_err.et
344 $(INC)kv5m_err.h: $(AH) $(ET)kv5m_err.et
345         $(AWK) -f $(AH) outfile=$@ $(ET)kv5m_err.et
346 $(INC)krb524_err.h: $(AH) $(ET)krb524_err.et
347         $(AWK) -f $(AH) outfile=$@ $(ET)krb524_err.et
348 $(PR)prof_err.h: $(AH) $(PR)prof_err.et
349         $(AWK) -f $(AH) outfile=$@ $(PR)prof_err.et
350 $(GG)gssapi_err_generic.h: $(AH) $(GG)gssapi_err_generic.et
351         $(AWK) -f $(AH) outfile=$@ $(GG)gssapi_err_generic.et
352 $(GK)gssapi_err_krb5.h: $(AH) $(GK)gssapi_err_krb5.et
353         $(AWK) -f $(AH) outfile=$@ $(GK)gssapi_err_krb5.et
354 $(CCL)ccapi_err.h: $(AH) $(CCL)ccapi_err.et
355         $(AWK) -f $(AH) outfile=$@ $(CCL)ccapi_err.et
356 $(CE)test1.h: $(AH) $(CE)test1.et
357         $(AWK) -f $(AH) outfile=$@ $(CE)test1.et
358 $(CE)test2.h: $(AH) $(CE)test2.et
359         $(AWK) -f $(AH) outfile=$@ $(CE)test2.et
360
361 $(ET)asn1_err.c: $(AC) $(ET)asn1_err.et
362         $(AWK) -f $(AC) outfile=$@ $(ET)asn1_err.et
363 $(ET)kdb5_err.c: $(AC) $(ET)kdb5_err.et
364         $(AWK) -f $(AC) outfile=$@ $(ET)kdb5_err.et
365 $(ET)krb5_err.c: $(AC) $(ET)krb5_err.et
366         $(AWK) -f $(AC) outfile=$@ $(ET)krb5_err.et
367 $(ET)k5e1_err.c: $(AC) $(ET)k5e1_err.et
368         $(AWK) -f $(AC) outfile=$@ $(ET)k5e1_err.et
369 $(ET)kv5m_err.c: $(AC) $(ET)kv5m_err.et
370         $(AWK) -f $(AC) outfile=$@ $(ET)kv5m_err.et
371 $(ET)krb524_err.c: $(AC) $(ET)krb524_err.et
372         $(AWK) -f $(AC) outfile=$@ $(ET)krb524_err.et
373 $(PR)prof_err.c: $(AC) $(PR)prof_err.et
374         $(AWK) -f $(AC) outfile=$@ $(PR)prof_err.et
375 $(GG)gssapi_err_generic.c: $(AC) $(GG)gssapi_err_generic.et
376         $(AWK) -f $(AC) outfile=$@ $(GG)gssapi_err_generic.et
377 $(GK)gssapi_err_krb5.c: $(AC) $(GK)gssapi_err_krb5.et
378         $(AWK) -f $(AC) outfile=$@ $(GK)gssapi_err_krb5.et
379 $(CCL)ccapi_err.c: $(AC) $(CCL)ccapi_err.et
380         $(AWK) -f $(AC) outfile=$@ $(CCL)ccapi_err.et
381 $(CE)test1.c: $(AC) $(CE)test1.et
382         $(AWK) -f $(AC) outfile=$@ $(CE)test1.et
383 $(CE)test2.c: $(AC) $(CE)test2.et
384         $(AWK) -f $(AC) outfile=$@ $(CE)test2.et
385
386 KRBHDEP = $(INC)krb5/krb5.hin $(INC)krb5_err.h $(INC)k5e1_err.h \
387         $(INC)kdb5_err.h $(INC)kv5m_err.h $(INC)krb524_err.h $(INC)asn1_err.h
388
389 $(INC)krb5/krb5.h: $(KRBHDEP)
390         rm -f $@
391         cat $(KRBHDEP) > $@
392 $(PR)profile.h: $(PR)profile.hin $(PR)prof_err.h
393         rm -f $@
394         cat $(PR)profile.hin $(PR)prof_err.h > $@
395 $(GG)gssapi.h: $(GG)gssapi.hin
396         rm -f $@
397         cat $(GG)gssapi.hin > $@
398
399 awk-windows-mac: $(ETOUT) $(HOUT)
400
401 #
402 # The maybe-awk target needs to happen after AWK is defined.
403 #
404
405 ##DOS##maybe-awk:
406 ##DOS##!ifdef WHICH_CMD
407 ##DOS##!if ![ $(WHICH_CMD) $(AWK) ]
408 ##DOS##maybe-awk: awk-windows-mac
409 ##DOS##!endif
410 ##DOS##!endif
411
412 clean-windows-mac:
413         rm -f $(CLEANUP)
414
415 distclean-windows:
416         config\rm.bat $(CLEANUP:^/=^\)
417         config\rm.bat $(WINMAKEFILES)
418         config\rm.bat $(KBINDIR)\*.dll $(KBINDIR)\*.exe
419         @if exist $(KBINDIR)\nul rmdir $(KBINDIR)
420
421 # Avoid using $(CP) here because the nul+ hack breaks implicit
422 # destination filenames.
423 install-windows:
424         @if "$(KRB_INSTALL_DIR)"=="" @echo KRB_INSTALL_DIR is not defined!  Please define it.
425         @if "$(KRB_INSTALL_DIR)"=="" @dir /b \nul\nul
426         @if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @echo The directory $(KRB_INSTALL_DIR) does not exist.  Please create it.
427         @if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @dir /b $(KRB_INSTALL_DIR)\nul
428         @if not exist "$(KRB_INSTALL_DIR)\include\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include"
429         @if not exist "$(KRB_INSTALL_DIR)\include\krb5\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\krb5"
430         @if not exist "$(KRB_INSTALL_DIR)\include\gssapi\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\gssapi"
431         @if not exist "$(KRB_INSTALL_DIR)\lib\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\lib"
432         @if not exist "$(KRB_INSTALL_DIR)\bin\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin"
433         @if not exist "$(KRB_INSTALL_DIR)\bin\plugins\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin\plugins"
434         @if not exist "$(KRB_INSTALL_DIR)\bin\plugins\preauth\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin\plugins\preauth"
435         copy include\krb5.h "$(KRB_INSTALL_DIR)\include\."
436         copy include\krb5\krb5.h "$(KRB_INSTALL_DIR)\include\krb5\."
437         copy include\win-mac.h "$(KRB_INSTALL_DIR)\include\."
438         copy include\profile.h "$(KRB_INSTALL_DIR)\include\."
439         copy include\com_err.h "$(KRB_INSTALL_DIR)\include\."
440         copy include\gssapi\gssapi.h "$(KRB_INSTALL_DIR)\include\gssapi\."
441         copy include\gssapi\gssapi_alloc.h "$(KRB_INSTALL_DIR)\include\gssapi\."
442         copy include\gssapi\gssapi_krb5.h "$(KRB_INSTALL_DIR)\include\gssapi\."
443         copy include\gssapi\gssapi_ext.h "$(KRB_INSTALL_DIR)\include\gssapi\."
444         copy lib\$(OUTPRE)*.lib "$(KRB_INSTALL_DIR)\lib\."
445         copy lib\$(OUTPRE)*.dll "$(KRB_INSTALL_DIR)\bin\."
446         $(INSTALLDBGSYMS) lib\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
447         copy appl\gss-sample\$(OUTPRE)gss-server.exe "$(KRB_INSTALL_DIR)\bin\."
448         $(INSTALLDBGSYMS) appl\gss-sample\$(OUTPRE)gss-server.pdb "$(KRB_INSTALL_DIR)\bin\."
449         copy appl\gss-sample\$(OUTPRE)gss-client.exe "$(KRB_INSTALL_DIR)\bin\."
450         $(INSTALLDBGSYMS) appl\gss-sample\$(OUTPRE)gss-client.pdb "$(KRB_INSTALL_DIR)\bin\."
451         copy windows\ms2mit\$(OUTPRE)*.exe "$(KRB_INSTALL_DIR)\bin\."
452         $(INSTALLDBGSYMS) windows\ms2mit\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
453         copy windows\leashdll\$(OUTPRE)*.lib "$(KRB_INSTALL_DIR)\lib\."
454         copy windows\leashdll\$(OUTPRE)*.dll "$(KRB_INSTALL_DIR)\bin\."
455         $(INSTALLDBGSYMS) windows\leashdll\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
456 ##DOS##!ifndef NO_LEASH
457         copy windows\leash\$(OUTPRE)*.exe "$(KRB_INSTALL_DIR)\bin\."
458         $(INSTALLDBGSYMS) windows\leash\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
459         copy windows\leash\$(OUTPRE)*.chm "$(KRB_INSTALL_DIR)\bin\."
460         copy windows\leash\htmlhelp\*.chm "$(KRB_INSTALL_DIR)\bin\."
461 ##DOS##!endif
462         copy windows\kfwlogon\$(OUTPRE)*.lib "$(KRB_INSTALL_DIR)\lib\."
463         copy windows\kfwlogon\$(OUTPRE)*.exe "$(KRB_INSTALL_DIR)\bin\."
464         copy windows\kfwlogon\$(OUTPRE)*.dll "$(KRB_INSTALL_DIR)\bin\."
465         $(INSTALLDBGSYMS) windows\kfwlogon\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
466         copy ccapi\lib\win\srctmp\$(OUTPRE)$(CCLIB).dll "$(KRB_INSTALL_DIR)\bin\."
467         $(INSTALLDBGSYMS) ccapi\lib\win\srctmp\$(OUTPRE)$(CCLIB).pdb "$(KRB_INSTALL_DIR)\bin\."
468         copy ccapi\lib\win\srctmp\$(CCLIB).lib "$(KRB_INSTALL_DIR)\lib\."
469         copy ccapi\server\win\srctmp\$(OUTPRE)ccapiserver.exe "$(KRB_INSTALL_DIR)\bin\."
470         copy clients\kvno\$(OUTPRE)kvno.exe "$(KRB_INSTALL_DIR)\bin\."
471         copy clients\klist\$(OUTPRE)klist.exe "$(KRB_INSTALL_DIR)\bin\."
472         copy clients\kinit\$(OUTPRE)kinit.exe "$(KRB_INSTALL_DIR)\bin\."
473         copy clients\kdestroy\$(OUTPRE)kdestroy.exe "$(KRB_INSTALL_DIR)\bin\."
474         copy clients\kcpytkt\$(OUTPRE)kcpytkt.exe "$(KRB_INSTALL_DIR)\bin\."
475         copy clients\kdeltkt\$(OUTPRE)kdeltkt.exe "$(KRB_INSTALL_DIR)\bin\."
476         copy clients\kpasswd\$(OUTPRE)kpasswd.exe "$(KRB_INSTALL_DIR)\bin\."
477         copy clients\kswitch\$(OUTPRE)kswitch.exe "$(KRB_INSTALL_DIR)\bin\."
478         $(INSTALLDBGSYMS) ccapi\server\win\srctmp\$(OUTPRE)ccapiserver.pdb "$(KRB_INSTALL_DIR)\bin\."
479         $(INSTALLDBGSYMS) clients\kvno\$(OUTPRE)kvno.pdb "$(KRB_INSTALL_DIR)\bin\."
480         $(INSTALLDBGSYMS) clients\klist\$(OUTPRE)klist.pdb "$(KRB_INSTALL_DIR)\bin\."
481         $(INSTALLDBGSYMS) clients\kinit\$(OUTPRE)kinit.pdb "$(KRB_INSTALL_DIR)\bin\."
482         $(INSTALLDBGSYMS) clients\kdestroy\$(OUTPRE)kdestroy.pdb "$(KRB_INSTALL_DIR)\bin\."
483         $(INSTALLDBGSYMS) clients\kcpytkt\$(OUTPRE)kcpytkt.pdb "$(KRB_INSTALL_DIR)\bin\."
484         $(INSTALLDBGSYMS) clients\kdeltkt\$(OUTPRE)kdeltkt.pdb "$(KRB_INSTALL_DIR)\bin\."
485         $(INSTALLDBGSYMS) clients\kpasswd\$(OUTPRE)kpasswd.pdb "$(KRB_INSTALL_DIR)\bin\."
486         $(INSTALLDBGSYMS) clients\kswitch\$(OUTPRE)kswitch.pdb "$(KRB_INSTALL_DIR)\bin\."
487         copy plugins\preauth\spake\$(OUTPRE)$(SPAKELIB).dll "$(KRB_INSTALL_DIR)\bin\plugins\preauth\."
488         $(INSTALLDBGSYMS) plugins\preauth\spake\$(OUTPRE)$(SPAKELIB).pdb "$(KRB_INSTALL_DIR)\bin\plugins\preauth\."
489
490 check-prerecurse: runenv.py
491         $(RM) $(SKIPTESTS)
492         touch $(SKIPTESTS)
493
494 check-unix: check-lmdb-$(HAVE_LMDB)
495         cat $(SKIPTESTS)
496
497 check-pytests-no: check-postrecurse
498         @echo 'Skipped python test scripts: python 2.5 or later required' >> \
499                 $(SKIPTESTS)
500
501 check-cmocka-no: check-postrecurse
502         @echo 'Skipped cmocka tests: cmocka library or header not found' >> \
503                 $(SKIPTESTS)
504
505 check-lmdb-yes:
506 check-lmdb-no:
507         @echo 'Skipped LMDB tests: LMDB KDB module not built' >> $(SKIPTESTS)
508
509 # Create a test realm and spawn a shell in an environment pointing to it.
510 # If CROSSNUM is set, create that many fully connected test realms and
511 # point the shell at the first one.
512 testrealm: runenv.py
513         PYTHONPATH=$(top_srcdir)/util $(PYTHON) $(srcdir)/util/testrealm.py \
514                 $(CROSSNUM)
515
516 # environment variable settings to propagate to Python-based tests
517
518 pyrunenv.vals: Makefile
519         $(RUN_SETUP); \
520         for i in $(RUN_VARS); do \
521                 eval echo 'env['\\\'$$i\\\''] = '\\\'\$$$$i\\\'; \
522         done > $@
523         echo "tls_impl = '$(TLS_IMPL)'" >> $@
524         echo "have_sasl = '$(HAVE_SASL)'" >> $@
525         echo "have_spake_openssl = '$(HAVE_SPAKE_OPENSSL)'" >> $@
526         echo "have_lmdb = '$(HAVE_LMDB)'" >> $@
527         echo "sizeof_time_t = $(SIZEOF_TIME_T)" >> $@
528
529 runenv.py: pyrunenv.vals
530         echo 'env = {}' > $@
531         cat pyrunenv.vals >> $@
532
533 clean-unix::
534         $(RM) runenv.py runenv.pyc pyrunenv.vals
535         $(RM) -r __pycache__
536
537 COV_BUILD=      cov-build
538 COV_ANALYZE=    cov-analyze
539 COV_COMMIT=     cov-commit-defects --product "$(COV_PRODUCT)" --user "$(COV_USER)" --target "$(COV_TARGET)" --description "$(COV_DESC)"
540 COV_MAKE_LIB=   cov-make-library
541
542 COV_PRODUCT=    krb5
543 COV_USER=       admin
544 COV_DATADIR=
545 COV_TARGET=     $(host)
546 COV_DESC=
547
548 # Set to, e.g., "--all" or "--security".
549 COV_ANALYSES=
550 # Temporary directory, might as well put it in the build tree.
551 COV_TEMPDIR=    cov-temp
552 # Sources modeling some functions or macros confusing Prevent.
553 COV_MODELS=\
554         $(top_srcdir)/util/coverity-models/threads.c
555
556 # Depend on Makefiles to ensure that (in maintainer mode) the configure
557 # scripts won't get rerun under cov-build.
558 coverity prevent cov: Makefiles
559         $(COV_BUILD) --dir $(COV_TEMPDIR) $(MAKE) all
560         $(COV_ANALYZE) $(COV_ANALYSES) --dir $(COV_TEMPDIR)
561         if test "$(COV_DATADIR)" != ""; then \
562                 $(COV_COMMIT) --dir $(COV_TEMPDIR) --datadir $(COV_DATADIR); \
563         else \
564                 echo "** Coverity Prevent analysis results not commit to Defect Manager"; \
565         fi
566
567 FIND = find
568 XARGS = xargs
569 EMACS = emacs
570 PYTHON = python
571
572 INDENTDIRS = \
573         appl \
574         clients \
575         include \
576         kadmin \
577         kdc \
578         lib/apputils \
579         lib/crypto \
580         lib/gssapi \
581         lib/kadm5 \
582         lib/kdb \
583         lib/krb5 \
584         plugins \
585         prototype \
586         kprop \
587         tests \
588         util
589
590 BSDFILES = \
591         kadmin/server/ipropd_svc.c \
592         kadmin/server/kadm_rpc_svc.c \
593         lib/apputils/daemon.c \
594         lib/kadm5/admin_xdr.h \
595         lib/kadm5/clnt/client_rpc.c \
596         lib/kadm5/kadm_rpc.h \
597         lib/kadm5/kadm_rpc_xdr.c \
598         lib/kadm5/srv/adb_xdr.c \
599         lib/krb5/krb/strptime.c \
600         kprop/kpropd_rpc.c \
601         util/support/getopt.c \
602         util/support/getopt_long.c \
603         util/support/mkstemp.c \
604         util/support/strlcpy.c
605
606 OTHEREXCLUDES = \
607         include/iprop.h \
608         include/k5-platform.h \
609         include/gssrpc \
610         lib/apputils/dummy.c \
611         lib/crypto/crypto_tests/camellia-test.c \
612         lib/crypto/builtin/aes \
613         lib/crypto/builtin/camellia \
614         lib/crypto/builtin/sha2 \
615         lib/gssapi/generic/gssapiP_generic.h \
616         lib/gssapi/generic/gssapi_ext.h \
617         lib/gssapi/krb5/gssapiP_krb5.h \
618         lib/gssapi/mechglue \
619         lib/gssapi/spnego \
620         lib/krb5/krb/deltat.c \
621         lib/krb5/unicode \
622         plugins/kdb/db2/libdb2 \
623         plugins/kdb/db2/pol_xdr.c \
624         plugins/preauth/pkinit/pkcs11.h \
625         plugins/preauth/pkinit/pkinit_accessor.h \
626         plugins/preauth/pkinit/pkinit_crypto.h \
627         plugins/preauth/pkinit/pkinit.h \
628         plugins/preauth/pkinit/pkinit_crypto_openssl.h \
629         tests/asn.1/ktest.h \
630         tests/asn.1/ktest_equal.h \
631         tests/asn.1/utility.h \
632         tests/gss-threads/gss-misc.c \
633         tests/gss-threads/gss-misc.h \
634         tests/hammer/kdc5_hammer.c \
635         util/et/com_err.h \
636         util/profile/prof_int.h \
637         util/profile/profile.hin \
638         util/profile/profile_tcl.c \
639         util/support/fnmatch.c \
640         util/verto \
641         util/k5ev
642
643 EXCLUDES = `for i in $(BSDFILES) $(OTHEREXCLUDES); do echo $$i; done | $(AWK) '{ print "-path", $$1, "-o" }'` -path /dev/null
644
645 FIND_REINDENT = cd $(top_srcdir) && \
646         $(FIND) $(INDENTDIRS) \( $(EXCLUDES) \) -prune -o \
647         \( -name '*.[ch]' -o -name '*.hin' -o -name '*.[ch].in' \)
648
649 show-reindentfiles:
650         ($(FIND_REINDENT) -print)
651
652 reindent:
653         ($(FIND_REINDENT) \
654         -print0 | $(XARGS) -0 $(EMACS) -q -batch \
655         -l util/krb5-c-style.el \
656         -l util/krb5-batch-reindent.el)
657
658 mark-cstyle: mark-cstyle-krb5 mark-cstyle-bsd
659
660 mark-cstyle-krb5:
661         (cd $(top_srcdir) && \
662         $(FIND) $(INDENTDIRS) \( $(EXCLUDES) \) -prune -o \
663         -name '*.[ch]' \
664         -print0 | $(XARGS) -0 $(PYTHON) util/krb5-mark-cstyle.py \
665         --cstyle=krb5)
666
667 mark-cstyle-bsd:
668         (cd $(top_srcdir) && $(FIND) $(BSDFILES) -print0 | $(XARGS) -0 \
669         $(PYTHON) util/krb5-mark-cstyle.py --cstyle=bsd)
670
671 check-copyright:
672         (cd $(top_srcdir) && \
673         $(FIND) . \( -name '*.[ch]' -o -name '*.hin' \) -print0 | \
674         $(XARGS) -0 python util/krb5-check-copyright.py)
675
676 tags: FORCE
677         (cd $(top_srcdir) && \
678         $(FIND) . \( -name '*.[ch]' -o -name '*.hin' \) -print | \
679         etags --lang=c - && \
680         $(FIND) . -name '*.cpp' -print | etags --lang=c++ --append - && \
681         $(FIND) . -name '*.y' -print | etags --lang=yacc --append -)
682 FORCE:
683 .PHONY: FORCE tags
684
685 distclean-unix:
686         $(RM) $(top_srcdir)/TAGS