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