Only store master mey list in DAL handle
[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 #       plugins/authdata/greet
10 SUBDIRS=util include lib \
11         @sam2_plugin@ \
12         plugins/kadm5_hook/test \
13         plugins/kdb/db2 \
14         @ldap_plugin_dir@ \
15         plugins/preauth/pkinit \
16         kdc kadmin slave clients appl tests \
17         config-files gen-manpages man @po@
18 WINSUBDIRS=include util lib ccapi windows clients appl
19 BUILDTOP=$(REL).
20 LOCALINCLUDES = -I$(srcdir) 
21 PROG_LIBPATH=-L$(TOPLIBD)
22 PROG_RPATH=$(KRB5_LIBDIR)
23
24 SRCS =  
25 HDRS = 
26
27 # Why aren't these flags showing up in Windows builds?
28 ##DOS##CPPFLAGS=$(CPPFLAGS) -D_X86_=1  -DWIN32 -D_WIN32 -W3 -D_WINNT
29
30 DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in
31
32 all-unix:: krb5-config
33
34 # Lots of things will start to depend on the thread support, which
35 # needs autoconf.h, but building "all" in include requires that util/et
36 # have been built first.  Until we can untangle this, let's just check
37 # that autoconf.h is up to date before going into any of the subdirectories.
38 all-prerecurse generate-files-mac-prerecurse: update-autoconf-h
39 update-autoconf-h:
40         (cd include && $(MAKE) autoconf.h osconf.h)
41
42 ##DOS##!if 0
43 # This makefile doesn't use lib.in, but we still need shlib.conf here.
44 config.status: $(top_srcdir)/config/shlib.conf
45 ##DOS##!endif
46
47 all-windows:: maybe-awk Makefile-windows
48
49 world::
50         date
51         make $(MFLAGS) all
52         date
53
54 INSTALLMKDIRS = $(KRB5ROOT) $(KRB5MANROOT) $(KRB5OTHERMKDIRS) \
55                 $(ADMIN_BINDIR) $(SERVER_BINDIR) $(CLIENT_BINDIR) \
56                 $(ADMIN_MANDIR) $(SERVER_MANDIR) $(CLIENT_MANDIR) \
57                 $(FILE_MANDIR) \
58                 $(ADMIN_CATDIR) $(SERVER_CATDIR) $(CLIENT_CATDIR) \
59                 $(FILE_CATDIR) \
60                 $(KRB5_LIBDIR) $(KRB5_INCDIR) \
61                 $(KRB5_DB_MODULE_DIR) $(KRB5_PA_MODULE_DIR) \
62                 $(KRB5_AD_MODULE_DIR) \
63                 $(KRB5_LIBKRB5_MODULE_DIR) \
64                 @localstatedir@ @localstatedir@/krb5kdc \
65                 $(KRB5_INCSUBDIRS) $(datadir) $(EXAMPLEDIR)
66
67 install-strip:
68         $(MAKE) install INSTALL_STRIP=-s
69
70 install-recurse: install-mkdirs
71
72 install-mkdirs:
73         @for i in $(INSTALLMKDIRS); do \
74                 $(srcdir)/config/mkinstalldirs $(DESTDIR)$$i; \
75         done
76
77 install-headers-mkdirs:
78         $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)
79         $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/gssapi
80         $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/gssrpc
81 install-headers-prerecurse: install-headers-mkdirs
82
83 # install::
84 #       $(MAKE) $(MFLAGS) install.man
85
86 TAGS: $(SRCS)
87         etags $(SRCS)
88
89 clean-:: clean-windows
90 clean-unix::
91         $(RM) *.o core krb5-config
92
93 mostlyclean: clean
94
95 # This doesn't work; if you think you need it, you should use a
96 # separate build directory.
97
98 # distclean: clean
99 #       rm -f Makefile config.status
100
101 # realclean: distclean
102 #       rm -f TAGS
103
104 dist: $(DISTFILES)
105         echo cpio-`sed -e '/version_string/!d' \
106         -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
107         rm -rf `cat .fname`
108         mkdir `cat .fname`
109         -ln $(DISTFILES) `cat .fname`
110         for file in $(DISTFILES); do \
111           test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \
112         done
113         tar chzf `cat .fname`.tar.gz `cat .fname`
114         rm -rf `cat .fname` .fname
115
116 GZIPPROG= gzip -9v
117 PKGDIR=`pwd`/pkgdir
118 pkgdir:
119         if test ! -d $(PKGDIR); then mkdir $(PKGDIR); else true; fi
120 tgz-bin: pkgdir
121         rm -rf $(PKGDIR)/install cns5-bin.tgz
122         mkdir $(PKGDIR)/install
123         $(MAKE) install DESTDIR=$(PKGDIR)/install
124         (cd $(PKGDIR)/install && tar cf - usr/cygnus) | $(GZIPPROG) > cns5-bin.tgz
125         rm -rf $(PKGDIR)/install
126
127 # Microsoft Windows build process...
128 #
129
130 config-windows:: Makefile-windows
131 #       @echo Making in include
132 #       cd include
133 #       $(MAKE) -$(MFLAGS)
134 #       cd ..
135
136 #
137 # We need outpre-dir explicitly in here because we may
138 # try to build wconfig on a config-windows.
139 #
140 ##DOS##$(WCONFIG_EXE): outpre-dir wconfig.c
141 ##DOS## $(CC) -Fe$@ -Fo$*.obj wconfig.c $(CCLINKOPTION)
142 ##DOS## $(_VC_MANIFEST_EMBED_EXE)
143
144 ##DOS##MKFDEP=$(WCONFIG_EXE) config\win-pre.in config\win-post.in
145
146 WINMAKEFILES=Makefile \
147         appl\Makefile appl\gss-sample\Makefile \
148         ccapi\Makefile \
149         ccapi\lib\win\Makefile \
150         ccapi\server\win\Makefile \
151         ccapi\test\Makefile \
152         clients\Makefile clients\kdestroy\Makefile \
153         clients\kinit\Makefile clients\klist\Makefile \
154         clients\kpasswd\Makefile clients\kvno\Makefile \
155         clients\kcpytkt\Makefile clients\kdeltkt\Makefile \
156         clients\kswitch\Makefile \
157         include\Makefile \
158         lib\Makefile lib\crypto\Makefile lib\crypto\krb\Makefile \
159         lib\crypto\builtin\Makefile lib\crypto\builtin\aes\Makefile \
160         lib\crypto\builtin\enc_provider\Makefile \
161         lib\crypto\builtin\des\Makefile lib\crypto\builtin\md5\Makefile \
162         lib\crypto\builtin\camellia\Makefile lib\crypto\builtin\md4\Makefile \
163         lib\crypto\builtin\hash_provider\Makefile \
164         lib\crypto\builtin\sha2\Makefile lib\crypto\builtin\sha1\Makefile \
165         lib\crypto\crypto_tests\Makefile \
166         lib\gssapi\Makefile lib\gssapi\generic\Makefile \
167         lib\gssapi\krb5\Makefile lib\gssapi\mechglue\Makefile \
168         lib\gssapi\spnego\Makefile \
169         lib\krb5\Makefile \
170         lib\krb5\asn.1\Makefile lib\krb5\ccache\Makefile \
171         lib\krb5\ccache\ccapi\Makefile \
172         lib\krb5\error_tables\Makefile \
173         lib\krb5\keytab\Makefile \
174         lib\krb5\krb\Makefile \
175         lib\krb5\os\Makefile lib\krb5\posix\Makefile \
176         lib\krb5\rcache\Makefile \
177         lib\krb5\unicode\Makefile \
178         util\Makefile \
179         util\et\Makefile util\profile\Makefile util\profile\testmod\Makefile \
180         util\support\Makefile \
181         util\windows\Makefile \
182         util\wshelper\Makefile \
183         windows\Makefile windows\lib\Makefile \
184         windows\cns\Makefile windows\gina\Makefile \
185         windows\ms2mit\Makefile \
186         windows\wintel\Makefile windows\kfwlogon\Makefile \
187         windows\leashdll\Makefile windows\leash\Makefile \
188         windows\leash\htmlhelp\Makefile
189
190 ##DOS##Makefile-windows:: $(MKFDEP) $(WINMAKEFILES)
191
192 ##DOS##Makefile: Makefile.in $(MKFDEP)
193 ##DOS## $(WCONFIG) config < $@.in > $@
194 ##DOS##appl\Makefile: appl\Makefile.in $(MKFDEP)
195 ##DOS## $(WCONFIG) config < $@.in > $@
196 ##DOS##appl\gss-sample\Makefile: appl\gss-sample\Makefile.in $(MKFDEP)
197 ##DOS## $(WCONFIG) config < $@.in > $@
198 ##DOS##ccapi\Makefile: ccapi\Makefile.in $(MKFDEP)
199 ##DOS## $(WCONFIG) config < $@.in > $@
200 ##DOS##ccapi\lib\win\Makefile: ccapi\lib\win\Makefile.in $(MKFDEP)
201 ##DOS## $(WCONFIG) config < $@.in > $@
202 ##DOS##ccapi\server\win\Makefile: ccapi\server\win\Makefile.in $(MKFDEP)
203 ##DOS## $(WCONFIG) config < $@.in > $@
204 ##DOS##ccapi\test\Makefile: ccapi\test\Makefile.in $(MKFDEP)
205 ##DOS## $(WCONFIG) config < $@.in > $@
206 ##DOS##clients\Makefile: clients\Makefile.in $(MKFDEP)
207 ##DOS## $(WCONFIG) config < $@.in > $@
208 ##DOS##clients\kdestroy\Makefile: clients\kdestroy\Makefile.in $(MKFDEP)
209 ##DOS## $(WCONFIG) config < $@.in > $@
210 ##DOS##clients\kinit\Makefile: clients\kinit\Makefile.in $(MKFDEP)
211 ##DOS## $(WCONFIG) config < $@.in > $@
212 ##DOS##clients\klist\Makefile: clients\klist\Makefile.in $(MKFDEP)
213 ##DOS## $(WCONFIG) config < $@.in > $@
214 ##DOS##clients\kpasswd\Makefile: clients\kpasswd\Makefile.in $(MKFDEP)
215 ##DOS## $(WCONFIG) config < $@.in > $@
216 ##DOS##clients\kswitch\Makefile: clients\kswitch\Makefile.in $(MKFDEP)
217 ##DOS## $(WCONFIG) config < $@.in > $@
218 ##DOS##clients\kvno\Makefile: clients\kvno\Makefile.in $(MKFDEP)
219 ##DOS## $(WCONFIG) config < $@.in > $@
220 ##DOS##clients\kcpytkt\Makefile: clients\kcpytkt\Makefile.in $(MKFDEP)
221 ##DOS## $(WCONFIG) config < $@.in > $@
222 ##DOS##clients\kdeltkt\Makefile: clients\kdeltkt\Makefile.in $(MKFDEP)
223 ##DOS## $(WCONFIG) config < $@.in > $@
224 ##DOS##include\Makefile: include\Makefile.in $(MKFDEP)
225 ##DOS## $(WCONFIG) config < $@.in > $@
226 ##DOS##lib\Makefile: lib\Makefile.in $(MKFDEP)
227 ##DOS## $(WCONFIG) config < $@.in > $@
228 ##DOS##lib\crypto\Makefile: lib\crypto\Makefile.in $(MKFDEP)
229 ##DOS## $(WCONFIG) config < $@.in > $@
230 ##DOS##lib\crypto\krb\Makefile: lib\crypto\krb\Makefile.in $(MKFDEP)
231 ##DOS## $(WCONFIG) config < $@.in > $@
232 ##DOS##lib\crypto\builtin\aes\Makefile: lib\crypto\builtin\aes\Makefile.in $(MKFDEP)
233 ##DOS## $(WCONFIG) config < $@.in > $@
234 ##DOS##lib\crypto\builtin\enc_provider\Makefile: lib\crypto\builtin\enc_provider\Makefile.in $(MKFDEP)
235 ##DOS## $(WCONFIG) config < $@.in > $@
236 ##DOS##lib\crypto\builtin\des\Makefile: lib\crypto\builtin\des\Makefile.in $(MKFDEP)
237 ##DOS## $(WCONFIG) config < $@.in > $@
238 ##DOS##lib\crypto\builtin\md5\Makefile: lib\crypto\builtin\md5\Makefile.in $(MKFDEP)
239 ##DOS## $(WCONFIG) config < $@.in > $@
240 ##DOS##lib\crypto\builtin\camellia\Makefile: lib\crypto\builtin\camellia\Makefile.in $(MKFDEP)
241 ##DOS## $(WCONFIG) config < $@.in > $@
242 ##DOS##lib\crypto\builtin\md4\Makefile: lib\crypto\builtin\md4\Makefile.in $(MKFDEP)
243 ##DOS## $(WCONFIG) config < $@.in > $@
244 ##DOS##lib\crypto\builtin\hash_provider\Makefile: lib\crypto\builtin\hash_provider\Makefile.in $(MKFDEP)
245 ##DOS## $(WCONFIG) config < $@.in > $@
246 ##DOS##lib\crypto\builtin\sha2\Makefile: lib\crypto\builtin\sha2\Makefile.in $(MKFDEP)
247 ##DOS## $(WCONFIG) config < $@.in > $@
248 ##DOS##lib\crypto\builtin\sha1\Makefile: lib\crypto\builtin\sha1\Makefile.in $(MKFDEP)
249 ##DOS## $(WCONFIG) config < $@.in > $@
250 ##DOS##lib\crypto\builtin\Makefile: lib\crypto\builtin\Makefile.in $(MKFDEP)
251 ##DOS## $(WCONFIG) config < $@.in > $@
252 ##DOS##lib\crypto\crypto_tests\Makefile: lib\crypto\crypto_tests\Makefile.in $(MKFDEP)
253 ##DOS## $(WCONFIG) config < $@.in > $@
254 ##DOS##lib\gssapi\Makefile: lib\gssapi\Makefile.in $(MKFDEP)
255 ##DOS## $(WCONFIG) config < $@.in > $@
256 ##DOS##lib\gssapi\generic\Makefile: lib\gssapi\generic\Makefile.in $(MKFDEP)
257 ##DOS## $(WCONFIG) config < $@.in > $@
258 ##DOS##lib\gssapi\mechglue\Makefile: lib\gssapi\mechglue\Makefile.in $(MKFDEP)
259 ##DOS## $(WCONFIG) config < $@.in > $@
260 ##DOS##lib\gssapi\spnego\Makefile: lib\gssapi\spnego\Makefile.in $(MKFDEP)
261 ##DOS## $(WCONFIG) config < $@.in > $@
262 ##DOS##lib\gssapi\krb5\Makefile: lib\gssapi\krb5\Makefile.in $(MKFDEP)
263 ##DOS## $(WCONFIG) config < $@.in > $@
264 ##DOS##lib\krb5\Makefile: lib\krb5\Makefile.in $(MKFDEP)
265 ##DOS## $(WCONFIG) config < $@.in > $@
266 ##DOS##lib\krb5\asn.1\Makefile: lib\krb5\asn.1\Makefile.in $(MKFDEP)
267 ##DOS## $(WCONFIG) config < $@.in > $@
268 ##DOS##lib\krb5\ccache\Makefile: lib\krb5\ccache\Makefile.in $(MKFDEP)
269 ##DOS## $(WCONFIG) config < $@.in > $@
270 ##DOS##lib\krb5\ccache\ccapi\Makefile: lib\krb5\ccache\ccapi\Makefile.in $(MKFDEP)
271 ##DOS## $(WCONFIG) config < $@.in > $@
272 ##DOS##lib\krb5\error_tables\Makefile: lib\krb5\error_tables\Makefile.in $(MKFDEP)
273 ##DOS## $(WCONFIG) config < $@.in > $@
274 ##DOS##lib\krb5\keytab\Makefile: $$@.in $(MKFDEP)
275 ##DOS## $(WCONFIG) config < $@.in > $@
276 ##DOS##lib\krb5\krb\Makefile: lib\krb5\krb\Makefile.in $(MKFDEP)
277 ##DOS## $(WCONFIG) config < $@.in > $@
278 ##DOS##lib\krb5\os\Makefile: lib\krb5\os\Makefile.in $(MKFDEP)
279 ##DOS## $(WCONFIG) config < $@.in > $@
280 ##DOS##lib\krb5\posix\Makefile: lib\krb5\posix\Makefile.in $(MKFDEP)
281 ##DOS## $(WCONFIG) config < $@.in > $@
282 ##DOS##lib\krb5\rcache\Makefile: lib\krb5\rcache\Makefile.in $(MKFDEP)
283 ##DOS## $(WCONFIG) config < $@.in > $@
284 ##DOS##lib\krb5\unicode\Makefile: lib\krb5\unicode\Makefile.in $(MKFDEP)
285 ##DOS## $(WCONFIG) config < $@.in > $@
286 ##DOS##util\Makefile: util\Makefile.in $(MKFDEP)
287 ##DOS## $(WCONFIG) config < $@.in > $@
288 ##DOS##util\et\Makefile: util\et\Makefile.in $(MKFDEP)
289 ##DOS## $(WCONFIG) config < $@.in > $@
290 ##DOS##util\profile\Makefile: util\profile\Makefile.in $(MKFDEP)
291 ##DOS## $(WCONFIG) config < $@.in > $@
292 ##DOS##util\profile\testmod\Makefile: util\profile\testmod\Makefile.in $(MKFDEP)
293 ##DOS## $(WCONFIG) config < $@.in > $@
294 ##DOS##util\support\Makefile: util\support\Makefile.in $(MKFDEP)
295 ##DOS## $(WCONFIG) config < $@.in > $@
296 ##DOS##util\windows\Makefile: util\windows\Makefile.in $(MKFDEP)
297 ##DOS## $(WCONFIG) config < $@.in > $@
298 ##DOS##util\wshelper\Makefile: util\wshelper\Makefile.in $(MKFDEP)
299 ##DOS## $(WCONFIG) config < $@.in > $@
300 ##DOS##windows\Makefile: windows\Makefile.in $(MKFDEP)
301 ##DOS## $(WCONFIG) config < $@.in > $@
302 ##DOS##windows\lib\Makefile: windows\lib\Makefile.in $(MKFDEP)
303 ##DOS## $(WCONFIG) config < $@.in > $@
304 ##DOS##windows\cns\Makefile: windows\cns\Makefile.in $(MKFDEP)
305 ##DOS## $(WCONFIG) config < $@.in > $@
306 ##DOS##windows\gina\Makefile: windows\gina\Makefile.in $(MKFDEP)
307 ##DOS## $(WCONFIG) config < $@.in > $@
308 ##DOS##windows\ms2mit\Makefile: windows\ms2mit\Makefile.in $(MKFDEP)
309 ##DOS## $(WCONFIG) config < $@.in > $@
310 ##DOS##windows\wintel\Makefile: windows\wintel\Makefile.in $(MKFDEP)
311 ##DOS## $(WCONFIG) config < $@.in > $@
312 ##DOS##windows\kfwlogon\Makefile: windows\kfwlogon\Makefile.in $(MKFDEP)
313 ##DOS## $(WCONFIG) config < $@.in > $@
314 ##DOS##windows\leashdll\Makefile: windows\leashdll\Makefile.in $(MKFDEP)
315 ##DOS## $(WCONFIG) config < $@.in > $@
316 ##DOS##windows\leash\Makefile: windows\leash\Makefile.in $(MKFDEP)
317 ##DOS## $(WCONFIG) config < $@.in > $@
318 ##DOS##windows\leash\htmlhelp\Makefile: windows\leash\htmlhelp\Makefile.in $(MKFDEP)
319 ##DOS## $(WCONFIG) config < $@.in > $@
320
321 clean-windows:: Makefile-windows
322
323 #
324 # Renames DOS 8.3 filenames back to their proper, longer names.
325 #
326 ren2long:
327         -sh config/ren2long
328
329 #
330 # Builds the file that distributes Kerberos sources for DOS and 
331 # Macintosh sites from the source tree on Unix.
332 #
333 ZIP=zip
334 FILES= ./* appl/* appl/gss-sample/* \
335         clients/* clients/kdestroy/* clients/kinit/* clients/klist/* \
336         clients/kpasswd/* clients/kvno/* clients/kcpytkt/* clients/kdeltkt/* \
337         config/* include/* \
338         include/krb5/* lib/* lib/crypto/* lib/crypto/krb/* \
339         lib/crypto/krb/prf/* lib/crypto/krb/checksum/* lib/crypto/krb/old/* \
340         lib/crypto/krb/raw/* lib/crypto/krb/arcfour/* lib/crypto/krb/dk/* \
341         lib/crypto/builtin/aes/* lib/crypto/builtin/enc_provider/* \
342         lib/crypto/builtin/des/* lib/crypto/builtin/md5/* \
343         lib/crypto/builtin/camellia/* lib/crypto/builtin/md4/* \
344         lib/crypto/builtin/hash_provider/* lib/crypto/builtin/sha2/* \
345         lib/crypto/builtin/sha1/* lib/crypto/builtin/* \
346         lib/crypto/crypto_tests/* \
347         lib/gssapi/* lib/gssapi/generic/* lib/gssapi/krb5/* \
348         lib/gssapi/mechglue/* lib/gssapi/spnego/* \
349         lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \
350         lib/krb5/ccache/* lib/krb5/ccache/ccapi/* \
351         lib/krb5/error_tables/* \
352         lib/krb5/keytab/* lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* \
353         lib/krb5/unicode/* lib/krb5/unicode/utbm/* lib/krb5/unicode/ure/* \
354         lib/krb5/unicode/ucdata/* \
355         util/* util/et/* util/profile/* util/support/*
356
357 WINFILES= \
358         ccapi/* ccapi/common/* ccapi/common/win/* ccapi/common/win/OldCC/* \
359         ccapi/lib/* ccapi/lib/win/* ccapi/lib/win/OldCC/* \
360         ccapi/server/* ccapi/server/win/* \
361         ccapi/test/* \
362         util/windows/* windows/* windows/wshelper/* windows/lib/* windows/cns/* \
363         windows/wintel/* windows/gina/* windows/ms2mit/* \
364         windows/kfwlogon/* windows/leashdll/* windows/leash/*
365
366 WINBINARYFILES= windows/*/*.ico windows/*/*.doc windows/*/*.hlp \
367         windows/*/*.hpj
368
369 #
370 # Part of building the PC release has to be done on Unix. This includes
371 # anything the requires awk.
372 #
373 AWK = awk
374 AH  = util/et/et_h.awk
375 AC  = util/et/et_c.awk
376 INC = include/
377 ET  = lib/krb5/error_tables/
378 GG  = lib/gssapi/generic/
379 GK  = lib/gssapi/krb5/
380 PR  = util/profile/
381 CE  = util/et/
382 CCL = ccapi/lib/
383
384 ETOUT = \
385         $(INC)asn1_err.h $(ET)asn1_err.c \
386         $(INC)kdb5_err.h $(ET)kdb5_err.c \
387         $(INC)krb5_err.h $(ET)krb5_err.c \
388         $(INC)k5e1_err.h $(ET)k5e1_err.c \
389         $(INC)kv5m_err.h $(ET)kv5m_err.c \
390         $(INC)krb524_err.h $(ET)krb524_err.c \
391         $(PR)prof_err.h $(PR)prof_err.c \
392         $(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.c \
393         $(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.c \
394         $(CCL)ccapi_err.h $(CCL)ccapi_err.c
395
396 HOUT =  $(INC)krb5/krb5.h $(GG)gssapi.h $(PR)profile.h
397
398 CLEANUP= Makefile $(ETOUT) $(HOUT) \
399         include/profile.h include/osconf.h \
400         winfile.list
401
402
403 kerbsrc.win: kerbsrc.zip
404
405 winfile.list:
406         echo $(FILES) $(WINFILES) | tr ' ' \\012 | \
407                 sed -f config/winexclude.sed > winfile.list
408
409 dos-Makefile:
410         cat config/win-pre.in Makefile.in config/win-post.in | \
411                 sed -e "s/^##DOS##//" -e "s/^##DOS//" > Makefile.tmp
412         mv Makefile.tmp Makefile
413
414 prep-windows: dos-Makefile awk-windows-mac
415
416 krbsrc83.zip: krbsrc83-is-obsolete
417
418 krbsrc83-is-obsolete:
419         @echo "Win16 and krbsrc83.zip are no longer supported."
420         @echo "We don't support building under 8.3 restricted filesystems"
421         @echo "anymore.  You can still build for Win32 on filesystems"
422         @echo "without 8.3 restrictions using kerbsrc.zip"
423         @echo " "
424
425 kerbsrc.zip: dos-Makefile awk-windows-mac winfile.list
426         rm -f kerbsrc.zip
427         $(ZIP) -@Dl kerbsrc.zip < winfile.list
428         $(ZIP) -D kerbsrc.zip $(WINBINARYFILES)
429         rm -f $(CLEANUP)
430
431 kerbsrc-nt.zip: kerbsrc-nt-is-obsolete
432
433 kerbsrc-nt-is-obsolete:
434         @echo "kerbsrc-nt.zip is now obsolete.  Just use and build kerbsrc.zip"
435         @echo "We don't support building under 8.3 restricted filesystems"
436         @echo "anymore, so what was kerbsrc-nt.zip is now kerbsrc.zip."
437         @echo " "
438
439 $(INC)asn1_err.h: $(AH) $(ET)asn1_err.et
440         $(AWK) -f $(AH) outfile=$@ $(ET)asn1_err.et
441 $(INC)kdb5_err.h: $(AH) $(ET)kdb5_err.et
442         $(AWK) -f $(AH) outfile=$@ $(ET)kdb5_err.et
443 $(INC)krb5_err.h: $(AH) $(ET)krb5_err.et
444         $(AWK) -f $(AH) outfile=$@ $(ET)krb5_err.et
445 $(INC)k5e1_err.h: $(AH) $(ET)k5e1_err.et
446         $(AWK) -f $(AH) outfile=$@ $(ET)k5e1_err.et
447 $(INC)kv5m_err.h: $(AH) $(ET)kv5m_err.et
448         $(AWK) -f $(AH) outfile=$@ $(ET)kv5m_err.et
449 $(INC)krb524_err.h: $(AH) $(ET)krb524_err.et
450         $(AWK) -f $(AH) outfile=$@ $(ET)krb524_err.et
451 $(PR)prof_err.h: $(AH) $(PR)prof_err.et
452         $(AWK) -f $(AH) outfile=$@ $(PR)prof_err.et
453 $(GG)gssapi_err_generic.h: $(AH) $(GG)gssapi_err_generic.et
454         $(AWK) -f $(AH) outfile=$@ $(GG)gssapi_err_generic.et
455 $(GK)gssapi_err_krb5.h: $(AH) $(GK)gssapi_err_krb5.et
456         $(AWK) -f $(AH) outfile=$@ $(GK)gssapi_err_krb5.et
457 $(CCL)ccapi_err.h: $(AH) $(CCL)ccapi_err.et
458         $(AWK) -f $(AH) outfile=$@ $(CCL)ccapi_err.et
459 $(CE)test1.h: $(AH) $(CE)test1.et
460         $(AWK) -f $(AH) outfile=$@ $(CE)test1.et
461 $(CE)test2.h: $(AH) $(CE)test2.et
462         $(AWK) -f $(AH) outfile=$@ $(CE)test2.et
463
464 $(ET)asn1_err.c: $(AC) $(ET)asn1_err.et
465         $(AWK) -f $(AC) outfile=$@ $(ET)asn1_err.et
466 $(ET)kdb5_err.c: $(AC) $(ET)kdb5_err.et
467         $(AWK) -f $(AC) outfile=$@ $(ET)kdb5_err.et
468 $(ET)krb5_err.c: $(AC) $(ET)krb5_err.et
469         $(AWK) -f $(AC) outfile=$@ $(ET)krb5_err.et
470 $(ET)k5e1_err.c: $(AC) $(ET)k5e1_err.et
471         $(AWK) -f $(AC) outfile=$@ $(ET)k5e1_err.et
472 $(ET)kv5m_err.c: $(AC) $(ET)kv5m_err.et
473         $(AWK) -f $(AC) outfile=$@ $(ET)kv5m_err.et
474 $(ET)krb524_err.c: $(AC) $(ET)krb524_err.et
475         $(AWK) -f $(AC) outfile=$@ $(ET)krb524_err.et
476 $(PR)prof_err.c: $(AC) $(PR)prof_err.et
477         $(AWK) -f $(AC) outfile=$@ $(PR)prof_err.et
478 $(GG)gssapi_err_generic.c: $(AC) $(GG)gssapi_err_generic.et
479         $(AWK) -f $(AC) outfile=$@ $(GG)gssapi_err_generic.et
480 $(GK)gssapi_err_krb5.c: $(AC) $(GK)gssapi_err_krb5.et
481         $(AWK) -f $(AC) outfile=$@ $(GK)gssapi_err_krb5.et
482 $(CCL)ccapi_err.c: $(AC) $(CCL)ccapi_err.et
483         $(AWK) -f $(AC) outfile=$@ $(CCL)ccapi_err.et
484 $(CE)test1.c: $(AC) $(CE)test1.et
485         $(AWK) -f $(AC) outfile=$@ $(CE)test1.et
486 $(CE)test2.c: $(AC) $(CE)test2.et
487         $(AWK) -f $(AC) outfile=$@ $(CE)test2.et
488
489 KRBHDEP = $(INC)krb5/krb5.hin $(INC)krb5_err.h $(INC)k5e1_err.h \
490         $(INC)kdb5_err.h $(INC)kv5m_err.h $(INC)krb524_err.h $(INC)asn1_err.h
491
492 $(INC)krb5/krb5.h: $(KRBHDEP)
493         rm -f $@
494         cat $(KRBHDEP) > $@
495 $(PR)profile.h: $(PR)profile.hin $(PR)prof_err.h
496         rm -f $@
497         cat $(PR)profile.hin $(PR)prof_err.h > $@
498 $(GG)gssapi.h: $(GG)gssapi.hin
499         rm -f $@
500         cat $(GG)gssapi.hin > $@
501
502 awk-windows-mac: $(ETOUT) $(HOUT)
503
504 #
505 # The maybe-awk target needs to happen after AWK is defined.
506 #
507
508 ##DOS##maybe-awk::
509 ##DOS##!ifdef WHICH_CMD
510 ##DOS##!if ![ $(WHICH_CMD) $(AWK) ]
511 ##DOS##maybe-awk:: awk-windows-mac
512 ##DOS##!endif
513 ##DOS##!endif
514
515 clean-windows-mac:
516         rm -f $(CLEANUP)
517
518 distclean-windows:
519         config\rm.bat $(CLEANUP:^/=^\)
520         config\rm.bat $(WINMAKEFILES)
521         config\rm.bat $(KBINDIR)\*.dll $(KBINDIR)\*.exe
522         @if exist $(KBINDIR)\nul rmdir $(KBINDIR)
523
524 # Avoid using $(CP) here because the nul+ hack breaks implicit
525 # destination filenames.
526 install-windows::
527         @if "$(KRB_INSTALL_DIR)"=="" @echo KRB_INSTALL_DIR is not defined!  Please define it.
528         @if "$(KRB_INSTALL_DIR)"=="" @dir /b \nul\nul
529         @if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @echo The directory $(KRB_INSTALL_DIR) does not exist.  Please create it.
530         @if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @dir /b $(KRB_INSTALL_DIR)\nul
531         @if not exist "$(KRB_INSTALL_DIR)\include\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include"
532         @if not exist "$(KRB_INSTALL_DIR)\include\krb5\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\krb5"
533         @if not exist "$(KRB_INSTALL_DIR)\include\gssapi\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\gssapi"
534         @if not exist "$(KRB_INSTALL_DIR)\lib\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\lib"
535         @if not exist "$(KRB_INSTALL_DIR)\bin\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin"
536         copy include\krb5.h "$(KRB_INSTALL_DIR)\include\."
537         copy include\krb5\krb5.h "$(KRB_INSTALL_DIR)\include\krb5\."
538         copy include\win-mac.h "$(KRB_INSTALL_DIR)\include\."
539         copy include\profile.h "$(KRB_INSTALL_DIR)\include\."
540         copy include\com_err.h "$(KRB_INSTALL_DIR)\include\."
541         copy include\gssapi\gssapi.h "$(KRB_INSTALL_DIR)\include\gssapi\."
542         copy include\gssapi\gssapi_alloc.h "$(KRB_INSTALL_DIR)\include\gssapi\."
543         copy include\gssapi\gssapi_krb5.h "$(KRB_INSTALL_DIR)\include\gssapi\."
544         copy include\gssapi\gssapi_ext.h "$(KRB_INSTALL_DIR)\include\gssapi\."
545         copy lib\$(OUTPRE)*.lib "$(KRB_INSTALL_DIR)\lib\."
546         copy lib\$(OUTPRE)*.dll "$(KRB_INSTALL_DIR)\bin\."
547         copy lib\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
548         copy windows\cns\$(OUTPRE)krb5.exe "$(KRB_INSTALL_DIR)\bin\."
549         copy windows\cns\$(OUTPRE)krb5.pdb "$(KRB_INSTALL_DIR)\bin\."
550         copy appl\gss-sample\$(OUTPRE)gss-server.exe "$(KRB_INSTALL_DIR)\bin\."
551         copy appl\gss-sample\$(OUTPRE)gss-server.pdb "$(KRB_INSTALL_DIR)\bin\."
552         copy appl\gss-sample\$(OUTPRE)gss-client.exe "$(KRB_INSTALL_DIR)\bin\."
553         copy appl\gss-sample\$(OUTPRE)gss-client.pdb "$(KRB_INSTALL_DIR)\bin\."
554         copy windows\ms2mit\$(OUTPRE)*.exe "$(KRB_INSTALL_DIR)\bin\."
555         copy windows\ms2mit\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
556         copy windows\leashdll\$(OUTPRE)*.lib "$(KRB_INSTALL_DIR)\lib\."
557         copy windows\leashdll\$(OUTPRE)*.dll "$(KRB_INSTALL_DIR)\bin\."
558         copy windows\leashdll\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
559         copy windows\leash\$(OUTPRE)*.exe "$(KRB_INSTALL_DIR)\bin\."
560         copy windows\leash\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
561         copy windows\kfwlogon\$(OUTPRE)*.lib "$(KRB_INSTALL_DIR)\lib\."
562         copy windows\kfwlogon\$(OUTPRE)*.exe "$(KRB_INSTALL_DIR)\bin\."
563         copy windows\kfwlogon\$(OUTPRE)*.dll "$(KRB_INSTALL_DIR)\bin\."
564         copy windows\kfwlogon\$(OUTPRE)*.pdb "$(KRB_INSTALL_DIR)\bin\."
565         copy util\windows\$(OUTPRE)*.lib $(KRB_INSTALL_DIR)\lib\."
566         copy util\wshelper\$(OUTPRE)$(DLIB).lib "$(KRB_INSTALL_DIR)\lib\."
567         copy util\wshelper\$(OUTPRE)$(DLIB).dll "$(KRB_INSTALL_DIR)\bin\."
568         copy util\wshelper\$(OUTPRE)$(DLIB).pdb "$(KRB_INSTALL_DIR)\bin\."
569         copy ccapi\lib\win\srctmp\$(OUTPRE)$(CCLIB).dll "$(KRB_INSTALL_DIR)\bin\."
570         copy ccapi\lib\win\srctmp\$(OUTPRE)$(CCLIB).pdb "$(KRB_INSTALL_DIR)\bin\."
571         copy ccapi\lib\win\srctmp\$(CCLIB).lib "$(KRB_INSTALL_DIR)\lib\."
572         copy ccapi\server\win\srctmp\$(OUTPRE)ccapiserver.exe "$(KRB_INSTALL_DIR)\bin\."
573         copy clients\kvno\$(OUTPRE)kvno.exe "$(KRB_INSTALL_DIR)\bin\."
574         copy clients\klist\$(OUTPRE)klist.exe "$(KRB_INSTALL_DIR)\bin\."
575         copy clients\kinit\$(OUTPRE)kinit.exe "$(KRB_INSTALL_DIR)\bin\."
576         copy clients\kdestroy\$(OUTPRE)kdestroy.exe "$(KRB_INSTALL_DIR)\bin\."
577         copy clients\kcpytkt\$(OUTPRE)kcpytkt.exe "$(KRB_INSTALL_DIR)\bin\."
578         copy clients\kdeltkt\$(OUTPRE)kdeltkt.exe "$(KRB_INSTALL_DIR)\bin\."
579         copy clients\kpasswd\$(OUTPRE)kpasswd.exe "$(KRB_INSTALL_DIR)\bin\."
580         copy clients\kswitch\$(OUTPRE)kswitch.exe "$(KRB_INSTALL_DIR)\bin\."
581         copy ccapi\server\win\srctmp\$(OUTPRE)ccapiserver.pdb "$(KRB_INSTALL_DIR)\bin\."
582         copy clients\kvno\$(OUTPRE)kvno.pdb "$(KRB_INSTALL_DIR)\bin\."
583         copy clients\klist\$(OUTPRE)klist.pdb "$(KRB_INSTALL_DIR)\bin\."
584         copy clients\kinit\$(OUTPRE)kinit.pdb "$(KRB_INSTALL_DIR)\bin\."
585         copy clients\kdestroy\$(OUTPRE)kdestroy.pdb "$(KRB_INSTALL_DIR)\bin\."
586         copy clients\kcpytkt\$(OUTPRE)kcpytkt.pdb "$(KRB_INSTALL_DIR)\bin\."
587         copy clients\kdeltkt\$(OUTPRE)kdeltkt.pdb "$(KRB_INSTALL_DIR)\bin\."
588         copy clients\kpasswd\$(OUTPRE)kpasswd.pdb "$(KRB_INSTALL_DIR)\bin\."
589         copy clients\kswitch\$(OUTPRE)kswitch.pdb "$(KRB_INSTALL_DIR)\bin\."
590         copy windows\leash\htmlhelp\*.chm "$(KRB_INSTALL_DIR)\bin\."
591
592 install-unix:: 
593         $(INSTALL_SCRIPT) krb5-config \
594                 $(DESTDIR)$(CLIENT_BINDIR)/krb5-config
595         $(INSTALL_DATA) $(srcdir)/krb5-config.M $(DESTDIR)$(CLIENT_MANDIR)/krb5-config.1
596
597 krb5-config: $(srcdir)/krb5-config.in config.status
598         $(SHELL) config.status krb5-config
599
600 # Test to ensure that krb5-config does not spit out things like
601 # $(PURE) or $(LDFLAGS) in case someone changes config/shlib.conf
602 check-unix:: krb5-config
603         $(SHELL) $(srcdir)/t_krbconf
604 check-prerecurse: runenv.py
605
606 # Create a test realm and spawn a shell in an environment pointing to it.
607 # If CROSSNUM is set, create that many fully connected test realms and
608 # point the shell at the first one.
609 testrealm: runenv.py
610         PYTHONPATH=$(top_srcdir)/util $(PYTHON) $(srcdir)/util/testrealm.py \
611                 $(CROSSNUM)
612
613 # environment variable settings to propagate to Python-based tests
614
615 pyrunenv.vals: Makefile
616         $(KRB5_RUN_ENV) \
617         for i in $(KRB5_RUN_VARS); do \
618                 eval echo 'env['\\\'$$i\\\''] = '\\\'\$$$$i\\\'; \
619         done > $@
620
621 runenv.py: pyrunenv.vals
622         echo 'env = {}' > $@
623         cat pyrunenv.vals >> $@
624
625 clean-unix::
626         $(RM) runenv.py runenv.pyc pyrunenv.vals
627
628 COV_BUILD=      cov-build
629 COV_ANALYZE=    cov-analyze
630 COV_COMMIT=     cov-commit-defects --product "$(COV_PRODUCT)" --user "$(COV_USER)" --target "$(COV_TARGET)" --description "$(COV_DESC)"
631 COV_MAKE_LIB=   cov-make-library
632
633 COV_PRODUCT=    krb5
634 COV_USER=       admin
635 COV_DATADIR=
636 COV_TARGET=     $(host)
637 COV_DESC=
638
639 # Set to, e.g., "--all" or "--security".
640 COV_ANALYSES=
641 # Temporary directory, might as well put it in the build tree.
642 COV_TEMPDIR=    cov-temp
643 # Sources modeling some functions or macros confusing Prevent.
644 COV_MODELS=\
645         $(top_srcdir)/util/coverity-models/threads.c
646
647 # Depend on Makefiles to ensure that (in maintainer mode) the configure
648 # scripts won't get rerun under cov-build.
649 coverity prevent cov: Makefiles
650         $(COV_BUILD) --dir $(COV_TEMPDIR) $(MAKE) all
651         $(COV_ANALYZE) $(COV_ANALYSES) --dir $(COV_TEMPDIR)
652         if test "$(COV_DATADIR)" != ""; then \
653                 $(COV_COMMIT) --dir $(COV_TEMPDIR) --datadir $(COV_DATADIR); \
654         else \
655                 echo "** Coverity Prevent analysis results not commit to Defect Manager"; \
656         fi
657
658 FIND = find
659 XARGS = xargs
660 EMACS = emacs
661 PYTHON = python
662
663 INDENTDIRS = \
664         appl \
665         clients \
666         include \
667         kadmin \
668         kdc \
669         lib/apputils \
670         lib/crypto \
671         lib/gssapi \
672         lib/kadm5 \
673         lib/kdb \
674         lib/krb5 \
675         plugins \
676         prototype \
677         slave \
678         tests \
679         util
680
681 BSDFILES = \
682         kadmin/cli/strftime.c \
683         kadmin/server/ipropd_svc.c \
684         kadmin/server/kadm_rpc_svc.c \
685         lib/apputils/daemon.c \
686         lib/kadm5/admin_xdr.h \
687         lib/kadm5/clnt/client_rpc.c \
688         lib/kadm5/kadm_rpc.h \
689         lib/kadm5/kadm_rpc_xdr.c \
690         lib/kadm5/srv/adb_xdr.c \
691         lib/krb5/krb/strftime.c \
692         lib/krb5/krb/strptime.c \
693         slave/kpropd_rpc.c \
694         util/support/mkstemp.c \
695         util/support/strlcpy.c \
696         util/windows/getopt.c \
697         util/windows/getopt.h \
698         util/windows/getopt_long.c
699
700 OTHEREXCLUDES = \
701         include/iprop.h \
702         include/k5-platform.h \
703         include/gssrpc \
704         lib/apputils/dummy.c \
705         lib/crypto/crypto_tests/camellia-test.c \
706         lib/crypto/builtin/aes \
707         lib/crypto/builtin/camellia \
708         lib/crypto/builtin/sha2 \
709         lib/gssapi/generic/gssapiP_generic.h \
710         lib/gssapi/generic/gssapi_ext.h \
711         lib/gssapi/krb5/gssapiP_krb5.h \
712         lib/gssapi/mechglue \
713         lib/gssapi/spnego \
714         lib/krb5/krb/deltat.c \
715         lib/krb5/unicode \
716         plugins/kdb/db2/libdb2 \
717         plugins/kdb/db2/pol_xdr.c \
718         plugins/kdb/hdb/hdb.h \
719         plugins/kdb/hdb/hdb_asn1.h \
720         plugins/kdb/hdb/hdb_err.h \
721         plugins/kdb/hdb/windc_plugin.h \
722         plugins/kdb/ldap/libkdb_ldap/princ_xdr.c \
723         plugins/kdb/ldap/libkdb_ldap/princ_xdr.h \
724         plugins/preauth/pkinit/pkcs11.h \
725         plugins/preauth/pkinit/pkinit_accessor.h \
726         plugins/preauth/pkinit/pkinit_crypto.h \
727         plugins/preauth/pkinit/pkinit.h \
728         plugins/preauth/pkinit/pkinit_crypto_openssl.h \
729         tests/asn.1/ktest.h \
730         tests/asn.1/ktest_equal.h \
731         tests/asn.1/utility.h \
732         tests/gss-threads/gss-misc.c \
733         tests/gss-threads/gss-misc.h \
734         tests/hammer/kdc5_hammer.c \
735         util/et/com_err.h \
736         util/profile/prof_int.h \
737         util/profile/profile.hin \
738         util/profile/profile_tcl.c \
739         util/support/fnmatch.c \
740         util/verto \
741         util/k5ev \
742         util/wshelper
743
744 EXCLUDES = `for i in $(BSDFILES) $(OTHEREXCLUDES); do echo $$i; done | $(AWK) '{ print "-path", $$1, "-o" }'` -path /dev/null
745
746 FIND_REINDENT = cd $(top_srcdir) && \
747         $(FIND) $(INDENTDIRS) \( $(EXCLUDES) \) -prune -o \
748         \( -name '*.[ch]' -o -name '*.hin' -o -name '*.[ch].in' \)
749
750 show-reindentfiles::
751         ($(FIND_REINDENT) -print)
752
753 reindent::
754         ($(FIND_REINDENT) \
755         -print0 | $(XARGS) -0 $(EMACS) -q -batch \
756         -l util/krb5-c-style.el \
757         -l util/krb5-batch-reindent.el)
758
759 mark-cstyle:: mark-cstyle-krb5 mark-cstyle-bsd
760
761 mark-cstyle-krb5::
762         (cd $(top_srcdir) && \
763         $(FIND) $(INDENTDIRS) \( $(EXCLUDES) \) -prune -o \
764         -name '*.[ch]' \
765         -print0 | $(XARGS) -0 $(PYTHON) util/krb5-mark-cstyle.py \
766         --cstyle=krb5)
767
768 mark-cstyle-bsd::
769         (cd $(top_srcdir) && $(FIND) $(BSDFILES) -print0 | $(XARGS) -0 \
770         $(PYTHON) util/krb5-mark-cstyle.py --cstyle=bsd)
771
772 check-copyright:
773         (cd $(top_srcdir) && \
774         $(FIND) . \( -name '*.[ch]' -o -name '*.hin' \) -print0 | \
775         $(XARGS) -0 python util/krb5-check-copyright.py)
776
777 doxygen::
778         if test "which doxygen" != ""; then \
779                 doxygen; \
780         else \
781                 echo "Doxygen is not installed or incorrect PATH"; \
782         fi