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