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