* Makefile.in (check-unix): Invoke t_krbconf instead of struggling
[krb5.git] / src / Makefile.in
1 datadir=@datadir@
2
3 thisconfigdir=.
4 myfulldir=.
5 mydir=.
6 MY_SUBDIRS=util include lib @krb524@ kdc kadmin slave clients appl tests \
7         config-files gen-manpages
8 BUILDTOP=$(REL)$(C)
9 LOCALINCLUDES = -I$(srcdir) 
10
11 SRCS =  
12 HDRS = 
13
14 DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in
15
16 all-unix:: krb5-config
17
18 all-mac::
19
20 all-windows:: maybe-awk Makefile-windows
21         @echo Making in util
22         cd util
23         $(MAKE) -$(MFLAGS)
24         @echo Making in include
25         cd ..\include
26         $(MAKE) -$(MFLAGS) 
27         @echo Making in lib
28         cd ..\lib
29         $(MAKE) -$(MFLAGS) 
30         @echo Making in windows
31         cd ..\windows
32         $(MAKE) -$(MFLAGS) 
33         @echo Making in clients
34         cd ..\clients
35         $(MAKE) -$(MFLAGS)
36         @echo Making in appl\gss-sample
37         cd ..\appl\gss-sample
38         $(MAKE) -$(MFLAGS)
39         @echo Making in appl\gssftp\ftp
40         cd ..\..\appl\gssftp\ftp
41         $(MAKE) -$(MFLAGS)
42         cd ..\..\..
43
44 world::
45         date
46         make $(MFLAGS) all
47         date
48
49 INSTALLMKDIRS = $(KRB5ROOT) $(KRB5MANROOT) $(KRB5OTHERMKDIRS) \
50                 $(ADMIN_BINDIR) $(SERVER_BINDIR) $(CLIENT_BINDIR) \
51                 $(ADMIN_MANDIR) $(SERVER_MANDIR) $(CLIENT_MANDIR) \
52                 $(FILE_MANDIR) $(KRB5_LIBDIR) $(KRB5_INCDIR) \
53                 $(KRB5_INCSUBDIRS) $(datadir)
54
55 install-strip:
56         $(MAKE) install INSTALL_STRIP=-s
57
58 install-recurse: install-mkdirs
59
60 install-mkdirs:
61         @for i in $(INSTALLMKDIRS); do \
62                 $(srcdir)/config/mkinstalldirs $(DESTDIR)$$i; \
63         done
64
65 install-headers-mkdirs:
66         $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)
67         $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/gssapi
68         $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/kerberosIV
69 install-headers-prerecurse: install-headers-mkdirs
70
71 # install::
72 #       $(MAKE) $(MFLAGS) install.man
73
74 TAGS: $(SRCS)
75         etags $(SRCS)
76
77 clean-:: clean-windows
78 clean-mac:: clean-unix
79 clean-unix::
80         $(RM) *.o core krb5-config
81
82 mostlyclean: clean
83
84 # This doesn't work; if you think you need it, you should use a
85 # separate build directory.
86
87 # distclean: clean
88 #       rm -f Makefile config.status
89
90 # realclean: distclean
91 #       rm -f TAGS
92
93 dist: $(DISTFILES)
94         echo cpio-`sed -e '/version_string/!d' \
95         -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
96         rm -rf `cat .fname`
97         mkdir `cat .fname`
98         -ln $(DISTFILES) `cat .fname`
99         for file in $(DISTFILES); do \
100           test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \
101         done
102         tar chzf `cat .fname`.tar.gz `cat .fname`
103         rm -rf `cat .fname` .fname
104
105 GZIPPROG= gzip -9v
106 PKGDIR=`pwd`/pkgdir
107 pkgdir:
108         if test ! -d $(PKGDIR); then mkdir $(PKGDIR); else true; fi
109 tgz-bin: pkgdir
110         rm -rf $(PKGDIR)/install cns5-bin.tgz
111         mkdir $(PKGDIR)/install
112         $(MAKE) install DESTDIR=$(PKGDIR)/install
113         (cd $(PKGDIR)/install && tar cf - usr/cygnus) | $(GZIPPROG) > cns5-bin.tgz
114         rm -rf $(PKGDIR)/install
115
116 # Microsoft Windows build process...
117 #
118
119 config-windows:: Makefile-windows
120 #       @echo Making in include
121 #       cd include
122 #       $(MAKE) -$(MFLAGS)
123 #       cd ..
124
125 #
126 # We need outpre-dir explicitly in here because we may
127 # try to build wconfig on a config-windows.
128 #
129 ##DOS##$(WCONFIG_EXE): outpre-dir wconfig.c
130 ##DOS## $(CC) -Fe$@ -Fo$*.obj wconfig.c
131
132 ##DOS##MKFDEP=$(WCONFIG_EXE) config\win-pre.in config\win-post.in
133
134 WINMAKEFILES=Makefile \
135         appl\gss-sample\Makefile \
136         appl\gssftp\ftp\Makefile \
137         clients\Makefile clients\kdestroy\Makefile \
138         clients\kinit\Makefile clients\klist\Makefile \
139         clients\kpasswd\Makefile clients\kvno\Makefile \
140         include\Makefile include\krb5\Makefile \
141         krb524\Makefile \
142         lib\Makefile lib\crypto\Makefile \
143         lib\crypto\crc32\Makefile lib\crypto\des\Makefile \
144         lib\crypto\dk\Makefile lib\crypto\enc_provider\Makefile \
145         lib\crypto\hash_provider\Makefile \
146         lib\crypto\keyhash_provider\Makefile \
147         lib\crypto\raw\Makefile lib\crypto\old\Makefile \
148         lib\crypto\sha1\Makefile lib\crypto\arcfour\Makefile \
149         lib\crypto\md4\Makefile lib\crypto\md5\Makefile \
150         lib\crypto\yarrow\Makefile \
151         lib\des425\Makefile \
152         lib\gssapi\Makefile lib\gssapi\generic\Makefile \
153         lib\gssapi\krb5\Makefile lib\gssapi\mechglue\Makefile \
154         lib\krb4\Makefile lib\krb5\Makefile \
155         lib\krb5\asn.1\Makefile lib\krb5\ccache\Makefile \
156         lib\krb5\ccache\ccapi\Makefile \
157         lib\krb5\error_tables\Makefile \
158         lib\krb5\keytab\Makefile \
159         lib\krb5\krb\Makefile \
160         lib\krb5\os\Makefile lib\krb5\posix\Makefile \
161         lib\krb5\rcache\Makefile \
162         util\Makefile \
163         util\et\Makefile util\profile\Makefile \
164         util\windows\Makefile \
165         windows\Makefile windows\lib\Makefile \
166         windows\cns\Makefile windows\gina\Makefile \
167         windows\gss\Makefile windows\ms2mit\Makefile \
168         windows\wintel\Makefile
169
170 ##DOS##Makefile-windows:: $(MKFDEP) $(WINMAKEFILES)
171
172 ##DOS##Makefile: Makefile.in $(MKFDEP)
173 ##DOS## $(WCONFIG) config < $@.in > $@
174 ##DOS##appl\gss-sample\Makefile: appl\gss-sample\Makefile.in $(MKFDEP)
175 ##DOS## $(WCONFIG) config < $@.in > $@
176 ##DOS##appl\gssftp\ftp\Makefile: appl\gssftp\ftp\Makefile.in $(MKFDEP)
177 ##DOS## $(WCONFIG) config < $@.in > $@
178 ##DOS##clients\Makefile: clients\Makefile.in $(MKFDEP)
179 ##DOS## $(WCONFIG) config < $@.in > $@
180 ##DOS##clients\kdestroy\Makefile: clients\kdestroy\Makefile.in $(MKFDEP)
181 ##DOS## $(WCONFIG) config < $@.in > $@
182 ##DOS##clients\kinit\Makefile: clients\kinit\Makefile.in $(MKFDEP)
183 ##DOS## $(WCONFIG) config < $@.in > $@
184 ##DOS##clients\klist\Makefile: clients\klist\Makefile.in $(MKFDEP)
185 ##DOS## $(WCONFIG) config < $@.in > $@
186 ##DOS##clients\kpasswd\Makefile: clients\kpasswd\Makefile.in $(MKFDEP)
187 ##DOS## $(WCONFIG) config < $@.in > $@
188 ##DOS##clients\kvno\Makefile: clients\kvno\Makefile.in $(MKFDEP)
189 ##DOS## $(WCONFIG) config < $@.in > $@
190 ##DOS##include\Makefile: include\Makefile.in $(MKFDEP)
191 ##DOS## $(WCONFIG) config < $@.in > $@
192 ##DOS##include\krb5\Makefile: include\krb5\Makefile.in $(MKFDEP)
193 ##DOS## $(WCONFIG) config < $@.in > $@
194 ##DOS##krb524\Makefile: krb524\Makefile.in $(MKFDEP)
195 ##DOS## $(WCONFIG) config < $@.in > $@
196 ##DOS##lib\Makefile: lib\Makefile.in $(MKFDEP)
197 ##DOS## $(WCONFIG) config < $@.in > $@
198 ##DOS##lib\crypto\Makefile: lib\crypto\Makefile.in $(MKFDEP)
199 ##DOS## $(WCONFIG) config < $@.in > $@
200 ##DOS##lib\crypto\crc32\Makefile: lib\crypto\crc32\Makefile.in $(MKFDEP)
201 ##DOS## $(WCONFIG) config < $@.in > $@
202 ##DOS##lib\crypto\des\Makefile: lib\crypto\des\Makefile.in $(MKFDEP)
203 ##DOS## $(WCONFIG) config < $@.in > $@
204 ##DOS##lib\crypto\dk\Makefile: lib\crypto\dk\Makefile.in $(MKFDEP)
205 ##DOS## $(WCONFIG) config < $@.in > $@
206 ##DOS##lib\crypto\enc_provider\Makefile: lib\crypto\enc_provider\Makefile.in $(MKFDEP)
207 ##DOS## $(WCONFIG) config < $@.in > $@
208 ##DOS##lib\crypto\hash_provider\Makefile: lib\crypto\hash_provider\Makefile.in $(MKFDEP)
209 ##DOS## $(WCONFIG) config < $@.in > $@
210 ##DOS##lib\crypto\keyhash_provider\Makefile: lib\crypto\keyhash_provider\Makefile.in $(MKFDEP)
211 ##DOS## $(WCONFIG) config < $@.in > $@
212 ##DOS##lib\crypto\sha1\Makefile: lib\crypto\sha1\Makefile.in $(MKFDEP)
213 ##DOS## $(WCONFIG) config < $@.in > $@
214 ##DOS##lib\crypto\arcfour\Makefile: lib\crypto\arcfour\Makefile.in $(MKFDEP)
215 ##DOS## $(WCONFIG) config < $@.in > $@
216 ##DOS##lib\crypto\md4\Makefile: lib\crypto\md4\Makefile.in $(MKFDEP)
217 ##DOS## $(WCONFIG) config < $@.in > $@
218 ##DOS##lib\crypto\md5\Makefile: lib\crypto\md5\Makefile.in $(MKFDEP)
219 ##DOS## $(WCONFIG) config < $@.in > $@
220 ##DOS##lib\crypto\yarrow\Makefile: lib\crypto\yarrow\Makefile.in $(MKFDEP)
221 ##DOS## $(WCONFIG) config < $@.in > $@
222 ##DOS##lib\crypto\old\Makefile: lib\crypto\old\Makefile.in $(MKFDEP)
223 ##DOS## $(WCONFIG) config < $@.in > $@
224 ##DOS##lib\crypto\raw\Makefile: lib\crypto\raw\Makefile.in $(MKFDEP)
225 ##DOS## $(WCONFIG) config < $@.in > $@
226 ##DOS##lib\des425\Makefile: lib\des425\Makefile.in $(MKFDEP)
227 ##DOS## $(WCONFIG) config < $@.in > $@
228 ##DOS##lib\gssapi\Makefile: lib\gssapi\Makefile.in $(MKFDEP)
229 ##DOS## $(WCONFIG) config < $@.in > $@
230 ##DOS##lib\gssapi\generic\Makefile: lib\gssapi\generic\Makefile.in $(MKFDEP)
231 ##DOS## $(WCONFIG) config < $@.in > $@
232 ##DOS##lib\gssapi\mechglue\Makefile: lib\gssapi\mechglue\Makefile.in $(MKFDEP)
233 ##DOS## $(WCONFIG) config < $@.in > $@
234 ##DOS##lib\gssapi\krb5\Makefile: lib\gssapi\krb5\Makefile.in $(MKFDEP)
235 ##DOS## $(WCONFIG) config < $@.in > $@
236 ##DOS##lib\krb4\Makefile: lib\krb4\Makefile.in $(MKFDEP)
237 ##DOS## $(WCONFIG) config < $@.in > $@
238 ##DOS##lib\krb5\Makefile: lib\krb5\Makefile.in $(MKFDEP)
239 ##DOS## $(WCONFIG) config < $@.in > $@
240 ##DOS##lib\krb5\asn.1\Makefile: lib\krb5\asn.1\Makefile.in $(MKFDEP)
241 ##DOS## $(WCONFIG) config < $@.in > $@
242 ##DOS##lib\krb5\ccache\Makefile: lib\krb5\ccache\Makefile.in $(MKFDEP)
243 ##DOS## $(WCONFIG) config < $@.in > $@
244 ##DOS##lib\krb5\ccache\ccapi\Makefile: lib\krb5\ccache\ccapi\Makefile.in $(MKFDEP)
245 ##DOS## $(WCONFIG) config < $@.in > $@
246 ##DOS##lib\krb5\error_tables\Makefile: lib\krb5\error_tables\Makefile.in $(MKFDEP)
247 ##DOS## $(WCONFIG) config < $@.in > $@
248 ##DOS##lib\krb5\keytab\Makefile: $$@.in $(MKFDEP)
249 ##DOS## $(WCONFIG) config < $@.in > $@
250 ##DOS##lib\krb5\krb\Makefile: lib\krb5\krb\Makefile.in $(MKFDEP)
251 ##DOS## $(WCONFIG) config < $@.in > $@
252 ##DOS##lib\krb5\os\Makefile: lib\krb5\os\Makefile.in $(MKFDEP)
253 ##DOS## $(WCONFIG) config < $@.in > $@
254 ##DOS##lib\krb5\posix\Makefile: lib\krb5\posix\Makefile.in $(MKFDEP)
255 ##DOS## $(WCONFIG) config < $@.in > $@
256 ##DOS##lib\krb5\rcache\Makefile: lib\krb5\rcache\Makefile.in $(MKFDEP)
257 ##DOS## $(WCONFIG) config < $@.in > $@
258 ##DOS##util\Makefile: util\Makefile.in $(MKFDEP)
259 ##DOS## $(WCONFIG) config < $@.in > $@
260 ##DOS##util\et\Makefile: util\et\Makefile.in $(MKFDEP)
261 ##DOS## $(WCONFIG) config < $@.in > $@
262 ##DOS##util\profile\Makefile: util\profile\Makefile.in $(MKFDEP)
263 ##DOS## $(WCONFIG) config < $@.in > $@
264 ##DOS##util\windows\Makefile: util\windows\Makefile.in $(MKFDEP)
265 ##DOS## $(WCONFIG) config < $@.in > $@
266 ##DOS##windows\Makefile: windows\Makefile.in $(MKFDEP)
267 ##DOS## $(WCONFIG) config < $@.in > $@
268 ##DOS##windows\lib\Makefile: windows\lib\Makefile.in $(MKFDEP)
269 ##DOS## $(WCONFIG) config < $@.in > $@
270 ##DOS##windows\cns\Makefile: windows\cns\Makefile.in $(MKFDEP)
271 ##DOS## $(WCONFIG) config < $@.in > $@
272 ##DOS##windows\gina\Makefile: windows\gina\Makefile.in $(MKFDEP)
273 ##DOS## $(WCONFIG) config < $@.in > $@
274 ##DOS##windows\gss\Makefile: windows\gss\Makefile.in $(MKFDEP)
275 ##DOS## $(WCONFIG) config < $@.in > $@
276 ##DOS##windows\ms2mit\Makefile: windows\ms2mit\Makefile.in $(MKFDEP)
277 ##DOS## $(WCONFIG) config < $@.in > $@
278 ##DOS##windows\wintel\Makefile: windows\wintel\Makefile.in $(MKFDEP)
279 ##DOS## $(WCONFIG) config < $@.in > $@
280
281 clean-windows:: Makefile-windows
282         @echo Making clean in util
283         cd util
284         $(MAKE) -$(MFLAGS) clean
285         @echo Making clean in include
286         cd ..\include
287         $(MAKE) -$(MFLAGS) clean
288         @echo Making clean in lib
289         cd ..\lib
290         $(MAKE) -$(MFLAGS) clean
291         @echo Making clean in windows
292         cd ..\windows
293         $(MAKE) -$(MFLAGS) clean
294         @echo Making clean in clients
295         cd ..\clients
296         $(MAKE) -$(MFLAGS) clean
297         @echo Making in appl\gss-sample
298         cd ..\appl\gss-sample
299         $(MAKE) -$(MFLAGS) clean
300         @echo Making in appl\gssftp\ftp
301         cd ..\..\appl\gssftp\ftp
302         $(MAKE) -$(MFLAGS) clean
303         cd ..\..\..
304         @echo Making clean in root
305
306 #
307 # Renames DOS 8.3 filenames back to their proper, longer names.
308 #
309 ren2long:
310         -sh config/ren2long
311
312 #
313 # Builds the file that distributes Kerberos sources for DOS and 
314 # Macintosh sites from the source tree on Unix.
315 #
316 ZIP=zip
317 FILES= ./* \
318         clients/* clients/kdestroy/* clients/kinit/* clients/klist/* \
319         clients/kpasswd/* \
320         config/* include/* include/kerberosIV/* \
321         include/krb5/* include/krb5/stock/* include/sys/* krb524/* lib/* \
322         lib/crypto/* lib/crypto/crc32/* lib/crypto/des/* lib/crypto/dk/* \
323         lib/crypto/enc_provider/* lib/crypto/hash_provider/* \
324         lib/crypto/keyhash_provider/* lib/crypto/old/* lib/crypto/raw/* \
325         lib/crypto/sha1/* lib/crypto/arcfour/* lib/crypto/md4/* \
326         lib/crypto/md5/* lib/crypto/yarrow/* \
327         lib/des425/* lib/gssapi/* lib/gssapi/generic/* lib/gssapi/krb5/* \
328         lib/gssapi/mechglue/* lib/krb4/* \
329         lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \
330         lib/krb5/ccache/* lib/krb5/ccache/ccapi/* \
331         lib/krb5/error_tables/* \
332         lib/krb5/keytab/* lib/krb5/keytab/file/* lib/krb5/keytab/srvtab/* \
333         lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* \
334         util/* util/et/* util/profile/*
335
336 WINFILES= util/windows/* windows/* windows/lib/* windows/cns/* \
337         windows/wintel/* windows/gss/* windows/gina/* windows/ms2mit/*
338
339 MACFILES= mac/* mac/libraries/* config/* include/* \
340         include/krb5/* include/krb5/stock/* include/sys/* \
341         ./patchlevel.h
342
343 WINBINARYFILES= windows/*/*.ico windows/*/*.doc windows/*/*.hlp \
344         windows/*/*.hpj windows/lib/*.lib
345
346 #
347 # Part of building the PC release has to be done on Unix. This includes
348 # anything the requires awk.
349 #
350 AWK = gawk
351 AH  = util/et/et_h.awk
352 AC  = util/et/et_c.awk
353 INC = include/
354 ET  = lib/krb5/error_tables/
355 GG  = lib/gssapi/generic/
356 GK  = lib/gssapi/krb5/
357 PR  = util/profile/
358
359 ETOUT = \
360         krb524\krb524_err.h krb524\krb524_err.c \
361         $(INC)asn1_err.h $(ET)asn1_err.c \
362         $(INC)kdb5_err.h $(ET)kdb5_err.c \
363         $(INC)krb5_err.h $(ET)krb5_err.c \
364         $(INC)kv5m_err.h $(ET)kv5m_err.c \
365         $(INC)/kerberosIV/kadm_err.h lib/krb4/kadm_err.c \
366         $(INC)/kerberosIV/krb_err.h lib/krb4/krb_err.c \
367         $(PR)prof_err.h $(PR)prof_err.c \
368         $(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.c \
369         $(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.c
370
371 HOUT =  $(INC)krb5.h $(GG)gssapi.h $(PR)profile.h
372
373 CLEANUP= Makefile $(ETOUT) $(HOUT) \
374         include/profile.h include/krb5/osconf.h \
375         winfile.list macfile.list
376
377
378 kerbsrc.win: kerbsrc.zip
379
380 winfile.list:
381         echo $(FILES) $(WINFILES) | tr ' ' \\012 | \
382                 sed -f config/winexclude.sed > winfile.list
383
384 MAC_SUBDIRS = lib util
385 macfile.list:
386         /bin/sh mac/macfiles.sh $(MAC_SUBDIRS) > macfile.list
387         find $(MACFILES) -prune -type f -print | \
388                 sed -f config/winexclude.sed >> macfile.list
389
390 dos-Makefile:
391         cat config/win-pre.in Makefile.in config/win-post.in | \
392                 sed -e "s/^##DOS##//" -e "s/^##DOS//" > Makefile.tmp
393         mv Makefile.tmp Makefile
394
395 prep-windows: dos-Makefile awk-windows-mac
396
397 krbsrc83.zip: krbsrc83-is-obsolete
398
399 krbsrc83-is-obsolete:
400         @echo "Win16 and krbsrc83.zip are no longer supported."
401         @echo "We don't support building under 8.3 restricted filesystems"
402         @echo "anymore.  You can still build for Win32 on filesystems"
403         @echo "without 8.3 restrictions using kerbsrc.zip"
404         @echo " "
405
406 kerbsrc.zip: dos-Makefile awk-windows-mac winfile.list
407         rm -f kerbsrc.zip
408         $(ZIP) -@Dl kerbsrc.zip < winfile.list
409         $(ZIP) -D kerbsrc.zip $(WINBINARYFILES)
410         rm -f $(CLEANUP)
411
412 kerbsrc-nt.zip: kerbsrc-nt-is-obsolete
413
414 kerbsrc-nt-is-obsolete:
415         @echo "kerbsrc-nt.zip is now obsolete.  Just use and build kerbsrc.zip"
416         @echo "We don't support building under 8.3 restricted filesystems"
417         @echo "anymore, so what was kerbsrc-nt.zip is now kerbsrc.zip."
418         @echo " "
419
420 Macfile: macfile.list 
421         rm -f Macfile
422         sed -e 's|/|:|g' -e 's/^/:/' -e '/:.:/d' -e '/:mac:/d' macfile.list > macfile.maclist
423         grep '\.c$$' macfile.maclist > macsrcsgss
424         grep -v ':gssapi:' macsrcsgss > macsrcsk5
425         echo SRCS = `cat macsrcsgss` >> Macfile
426         echo SRCDIRS = `sed -n -e 's/\(.*:\)[^:]*\.c$$/ \1/p' macfile.maclist | sort -u` >> Macfile
427         echo GSSOBJS68K = `sed -e 's/$$/.68K.o/' -e 's/.*://' \
428                 -e 's/^/:bin:68K:/' macsrcsgss` >> Macfile
429         echo GSSOBJS68KCFM = `sed -e 's/$$/.CFM68.o/' -e 's/.*://' \
430                 -e 's/^/:bin:CFM-68K:/' macsrcsgss` >> Macfile
431         echo GSSOBJSPPC = `sed -e 's/$$/.PPC.o/' -e 's/.*://' \
432                 -e 's/^/:bin:PPC:/' macsrcsgss` >> Macfile
433         echo K5OBJS68K = `sed -e 's/$$/.68K.o/' -e 's/.*://' \
434                 -e 's/^/:bin:68K:/' macsrcsk5` >> Macfile
435         echo K5OBJS68KCFM = `sed -e 's/$$/.CFM68.o/' -e 's/.*://' \
436                 -e 's/^/:bin:CFM-68K:/' macsrcsk5` >> Macfile
437         echo K5OBJSPPC = `sed -e 's/$$/.PPC.o/' -e 's/.*://' \
438                 -e 's/^/:bin:PPC:/' macsrcsk5` >> Macfile
439         echo INCLUDES = `sed -n -e 's/\(.*:\)[^:]*\.h$$/-i \1/p' macfile.maclist | sort -u` >> Macfile
440         echo "" >> Macfile
441         tr '@/:\\' '\245:\304\266'< mac/Makefile.tmpl >> Macfile
442
443 mac-bin-dirs:
444         rm -rf bin
445         mkdir bin bin/68K bin/CFM-68K bin/PPC
446         sh mac/mkbindirs.sh bin/68K $(MAC_SUBDIRS)
447         sh mac/mkbindirs.sh bin/CFM-68K $(MAC_SUBDIRS)
448         sh mac/mkbindirs.sh bin/PPC $(MAC_SUBDIRS)
449
450 kerbsrc.mac.tar: awk-windows-mac macfile.list mac-bin-dirs Macfile
451         cp mac/libraries/autoconf.h include/autoconf.h
452         mv Macfile Makefile
453         tar cvf kerbsrc.mac.tar Makefile include/autoconf.h bin \
454                 `cat macfile.list`
455         rm -f $(CLEANUP)
456         rm -rf bin
457         rm -f include/autoconf.h Makefile macsrc* macfile.maclist
458
459 krb524/krb524_err.h: $(AH) krb524/krb524_err.et
460         $(AWK) -f $(AH) outfile=$@ krb524/krb524_err.et
461 krb524/krb524_err.c: $(AC) krb524/krb524_err.et
462         $(AWK) -f $(AC) outfile=$@ krb524/krb524_err.et
463
464 $(INC)asn1_err.h: $(AH) $(ET)asn1_err.et
465         $(AWK) -f $(AH) outfile=$@ $(ET)asn1_err.et
466 $(INC)kdb5_err.h: $(AH) $(ET)kdb5_err.et
467         $(AWK) -f $(AH) outfile=$@ $(ET)kdb5_err.et
468 $(INC)krb5_err.h: $(AH) $(ET)krb5_err.et
469         $(AWK) -f $(AH) outfile=$@ $(ET)krb5_err.et
470 $(INC)kv5m_err.h: $(AH) $(ET)kv5m_err.et
471         $(AWK) -f $(AH) outfile=$@ $(ET)kv5m_err.et
472 $(INC)/kerberosIV/kadm_err.h: $(AH) lib/krb4/kadm_err.et
473         $(AWK) -f $(AH) outfile=$@ lib/krb4/kadm_err.et
474 $(INC)/kerberosIV/krb_err.h: $(AH) lib/krb4/krb_err.et
475         $(AWK) -f $(AH) outfile=$@ lib/krb4/krb_err.et
476 $(PR)prof_err.h: $(AH) $(PR)prof_err.et
477         $(AWK) -f $(AH) outfile=$@ $(PR)prof_err.et
478 $(GG)gssapi_err_generic.h: $(AH) $(GG)gssapi_err_generic.et
479         $(AWK) -f $(AH) outfile=$@ $(GG)gssapi_err_generic.et
480 $(GK)gssapi_err_krb5.h: $(AH) $(GK)gssapi_err_krb5.et
481         $(AWK) -f $(AH) outfile=$@ $(GK)gssapi_err_krb5.et
482
483 $(ET)asn1_err.c: $(AC) $(ET)asn1_err.et
484         $(AWK) -f $(AC) outfile=$@ $(ET)asn1_err.et
485 $(ET)kdb5_err.c: $(AC) $(ET)kdb5_err.et
486         $(AWK) -f $(AC) outfile=$@ $(ET)kdb5_err.et
487 $(ET)krb5_err.c: $(AC) $(ET)krb5_err.et
488         $(AWK) -f $(AC) outfile=$@ $(ET)krb5_err.et
489 $(ET)kv5m_err.c: $(AC) $(ET)kv5m_err.et
490         $(AWK) -f $(AC) outfile=$@ $(ET)kv5m_err.et
491 lib/krb4/kadm_err.c: $(AC) lib/krb4/kadm_err.et
492         $(AWK) -f $(AC) outfile=$@ lib/krb4/kadm_err.et
493 lib/krb4/krb_err.c: $(AC) lib/krb4/krb_err.et
494         $(AWK) -f $(AC) outfile=$@ lib/krb4/krb_err.et
495 $(PR)prof_err.c: $(AC) $(PR)prof_err.et
496         $(AWK) -f $(AC) outfile=$@ $(PR)prof_err.et
497 $(GG)gssapi_err_generic.c: $(AC) $(GG)gssapi_err_generic.et
498         $(AWK) -f $(AC) outfile=$@ $(GG)gssapi_err_generic.et
499 $(GK)gssapi_err_krb5.c: $(AC) $(GK)gssapi_err_krb5.et
500         $(AWK) -f $(AC) outfile=$@ $(GK)gssapi_err_krb5.et
501
502 KRBHDEP = $(INC)krb5.hin $(INC)krb5_err.h $(INC)kdb5_err.h \
503         $(INC)kv5m_err.h $(INC)asn1_err.h
504
505 $(INC)krb5.h: $(KRBHDEP)
506         rm -f $@
507         cat $(KRBHDEP) > $@
508 $(PR)profile.h: $(PR)profile.hin $(PR)prof_err.h
509         rm -f $@
510         cat $(PR)profile.hin $(PR)prof_err.h > $@
511 $(GG)gssapi.h: $(GG)gssapi.hin
512         rm -f $@
513         cat $(GG)gssapi.hin > $@
514
515 awk-windows-mac: $(ETOUT) $(HOUT)
516
517 #
518 # The maybe-awk target needs to happen after AWK is defined.
519 #
520
521 ##DOS##maybe-awk::
522 ##DOS##!ifdef WHICH_CMD
523 ##DOS##!if ![ $(WHICH_CMD) $(AWK) ]
524 ##DOS##maybe-awk:: awk-windows-mac
525 ##DOS##!endif
526 ##DOS##!endif
527
528 clean-windows-mac:
529         rm -f $(CLEANUP)
530
531 distclean-windows:
532         config\rm.bat $(CLEANUP:^/=^\)
533         config\rm.bat $(WINMAKEFILES)
534         config\rm.bat $(KBINDIR)\*.dll $(KBINDIR)\*.exe
535         @if exist $(KBINDIR)\nul rmdir $(KBINDIR)
536
537 install-windows::
538         @if "$(KRB_INSTALL_DIR)"=="" @echo KRB_INSTALL_DIR is not defined!  Please define it.
539         @if "$(KRB_INSTALL_DIR)"=="" @dir /b \nul\nul
540         @if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @echo The directory $(KRB_INSTALL_DIR) does not exist.  Please create it.
541         @if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @dir /b $(KRB_INSTALL_DIR)\nul
542         @if not exist "$(KRB_INSTALL_DIR)\include\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include"
543         @if not exist "$(KRB_INSTALL_DIR)\include\gssapi\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\gssapi"
544         @if not exist "$(KRB_INSTALL_DIR)\lib\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\lib"
545         @if not exist "$(KRB_INSTALL_DIR)\bin\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin"
546         $(CP) include\krb5.h "$(KRB_INSTALL_DIR)\include\."
547         $(CP) include\win-mac.h "$(KRB_INSTALL_DIR)\include\."
548         $(CP) include\profile.h "$(KRB_INSTALL_DIR)\include\."
549         $(CP) include\com_err.h "$(KRB_INSTALL_DIR)\include\."
550         $(CP) include\gssapi\gssapi.h "$(KRB_INSTALL_DIR)\include\gssapi\."
551         $(CP) include\gssapi\gssapi_krb5.h "$(KRB_INSTALL_DIR)\include\gssapi\."
552         $(CP) lib\$(OUTPRE)*.lib "$(KRB_INSTALL_DIR)\lib\."
553         $(CP) lib\$(OUTPRE)*.dll "$(KRB_INSTALL_DIR)\bin\."
554         $(CP) windows\cns\$(OUTPRE)krb5.exe "$(KRB_INSTALL_DIR)\bin\."
555         $(CP) windows\wintel\$(OUTPRE)telnet.exe "$(KRB_INSTALL_DIR)\bin\."
556         $(CP) windows\gss\$(OUTPRE)gss.exe "$(KRB_INSTALL_DIR)\bin\."
557         $(CP) clients\klist\$(OUTPRE)klist.exe "$(KRB_INSTALL_DIR)\bin\."
558         $(CP) clients\kinit\$(OUTPRE)kinit.exe "$(KRB_INSTALL_DIR)\bin\."
559         $(CP) clients\kdestroy\$(OUTPRE)kdestroy.exe "$(KRB_INSTALL_DIR)\bin\."
560         $(CP) clients\kpasswd\$(OUTPRE)kpasswd.exe "$(KRB_INSTALL_DIR)\bin\."
561         @if exist "$(KRB_INSTALL_DIR)\bin\krb4_32.dll" del "$(KRB_INSTALL_DIR)\bin\krb4_32.dll"
562         @if exist "$(KRB_INSTALL_DIR)\lib\krb4_32.lib" del "$(KRB_INSTALL_DIR)\lib\krb4_32.lib"
563
564 install-unix:: 
565         $(INSTALL) krb5-config \
566                 $(DESTDIR)$(CLIENT_BINDIR)/krb5-config
567
568 krb5-config: $(srcdir)/krb5-config.in $(thisconfigdir)/config.status
569         cd $(thisconfigdir) && $(SHELL) config.status krb5-config
570
571 # Test to ensure that krb5-config does not spit out things like
572 # $(PURE) or $(LDFLAGS) in case someone changes config/shlib.conf
573 check-unix:: krb5-config
574         $(SHELL) $(srcdir)/t_krbconf