Fixed up zipping up PC source for uncleaned source trees
[krb5.git] / src / Makefile.in
1 CFLAGS = $(CCOPTS) $(DEFS)
2 LDFLAGS = -g
3
4 ##DOSBUILDTOP = .
5 ##DOS!include $(BUILDTOP)\config\windows.in
6
7 prefix = /usr/local
8 exec_prefix = $(prefix)
9 binprefix =
10 manprefix =
11
12 bindir = $(exec_prefix)/bin
13 libdir = $(exec_prefix)/lib
14 mandir = $(prefix)/man/man1
15 manext = 1
16
17 SHELL = /bin/sh
18
19 SRCS =  
20
21 DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in
22
23 all:: all-$(WHAT)
24
25 all-unix::
26
27 all-: all-windows
28
29 all-windows:: makefile-windows
30         @echo Making in include
31         cd include
32         -$(MAKE) -$(MAKEFLAGS)
33         @echo Making in util\et
34         cd ..\util\et
35         -$(MAKE) -$(MAKEFLAGS)
36         @echo Making in lib
37         cd ..\..\lib
38         -$(MAKE) -$(MAKEFLAGS)
39         @echo Making in windows
40         cd ..\windows
41         -$(MAKE) -$(MAKEFLAGS)
42         cd ..
43
44 world::
45         date
46         make $(MFLAGS) mastermakefiles
47         make $(MFLAGS) depend
48         make $(MFLAGS) all
49         date
50
51 INSTALLMKDIRS = $(KRB5ROOT) $(KRB5MANROOT) $(KRB5OTHERMKDIRS) \
52                 $(ADMIN_BINDIR) $(SERVER_BINDIR) $(CLIENT_BINDIR) \
53                 $(ADMIN_MANDIR) $(SERVER_MANDIR) $(CLIENT_MANDIR) \
54                 $(FILE_MANDIR) $(KRB5_LIBDIR) $(KRB5_INCDIR) \
55                 $(KRB5_INCSUBDIRS)
56
57 install:: install-mkdirs
58
59 depend:: includes
60
61
62 install-mkdirs:
63         @for i in $(INSTALLMKDIRS); do \
64                 if test -d $(DESTDIR)$$i; then :; else (set -x; mkdir $(DESTDIR)$$i); fi \
65         done
66
67 # install::
68 #       $(MAKE) $(MFLAGS) install.man
69
70 # rebuild the Makefiles in the master source tree
71 mastermakefiles::
72         -$(MV) Makefile Makefile.bak
73         $(MAKE) -f Makefile.bak Makefile
74         $(MAKE) Makefiles
75
76 .c.o:
77         $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $<
78
79 TAGS: $(SRCS)
80         etags $(SRCS)
81
82 clean:: clean-$(WHAT)
83
84 clean-:: clean-unix
85
86 clean-unix::
87         rm -f  *.o core
88
89 clean-mac::
90         rm -f *.o core
91
92 mostlyclean: clean
93
94 distclean: clean
95         rm -f Makefile config.status
96
97 realclean: distclean
98         rm -f TAGS
99
100 dist: $(DISTFILES)
101         echo cpio-`sed -e '/version_string/!d' \
102         -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
103         rm -rf `cat .fname`
104         mkdir `cat .fname`
105         -ln $(DISTFILES) `cat .fname`
106         for file in $(DISTFILES); do \
107           test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \
108         done
109         tar chzf `cat .fname`.tar.gz `cat .fname`
110         rm -rf `cat .fname` .fname
111 #
112 # Windows configuration
113 #
114 makefile-windows:: wconfig.c config\pre.in config\post.in makefile.in \
115                 include\makefile.in include\krb5\makefile.in \
116                 lib\makefile.in lib\crypto\makefile.in \
117                 lib\crypto\crc32\makefile.in lib\crypto\des\makefile.in \
118                 lib\crypto\md4\makefile.in lib\crypto\md5\makefile.in \
119                 lib\crypto\os\makefile.in lib\des425\makefile.in \
120                 lib\gssapi\makefile.in lib\gssapi\generic\makefile.in \
121                 lib\gssapi\krb5\makefile.in lib\krb5\makefile.in \
122                 lib\krb5\asn.1\makefile.in lib\krb5\ccache\makefile.in \
123                 lib\krb5\ccache\file\makefile.in \
124                 lib\krb5\ccache\stdio\makefile.in \
125                 lib\krb5\error_ta\makefile.in \
126                 lib\krb5\free\makefile.in lib\krb5\keytab\makefile.in \
127                 lib\krb5\keytab\file\makefile.in lib\krb5\krb\makefile.in \
128                 lib\krb5\os\makefile.in lib\krb5\posix\makefile.in \
129                 lib\krb5\rcache\makefile.in \
130                 util\et\makefile.in
131         SET CL=/nologo
132         $(CC) /AL wconfig.c
133         copy Makefile Makefile.bak
134         .\wconfig config <makefile.in >makefile
135         .\wconfig config <include\makefile.in >include\makefile
136         .\wconfig config <include\krb5\makefile.in >include\krb5\makefile
137         .\wconfig config <lib\makefile.in >lib\makefile
138         .\wconfig config <lib\crypto\makefile.in >lib\crypto\makefile
139         .\wconfig config <lib\crypto\crc32\makefile.in >lib\crypto\crc32\makefile
140         .\wconfig config <lib\crypto\des\makefile.in >lib\crypto\des\makefile
141         .\wconfig config <lib\crypto\md4\makefile.in >lib\crypto\md4\makefile
142         .\wconfig config <lib\crypto\md5\makefile.in >lib\crypto\md5\makefile
143         .\wconfig config <lib\crypto\os\makefile.in >lib\crypto\os\makefile
144         .\wconfig config <lib\des425\makefile.in >lib\des425\makefile
145         .\wconfig config <lib\gssapi\makefile.in >lib\gssapi\makefile
146         .\wconfig config <lib\gssapi\generic\makefile.in >lib\gssapi\generic\makefile
147         .\wconfig config <lib\gssapi\krb5\makefile.in >lib\gssapi\krb5\makefile
148         .\wconfig config <lib\krb5\makefile.in >lib\krb5\makefile
149         .\wconfig config <lib\krb5\asn.1\makefile.in >lib\krb5\asn.1\makefile
150         .\wconfig config <lib\krb5\ccache\makefile.in >lib\krb5\ccache\makefile
151         .\wconfig config <lib\krb5\ccache\file\makefile.in >lib\krb5\ccache\file\makefile
152         .\wconfig config <lib\krb5\ccache\stdio\makefile.in >lib\krb5\ccache\stdio\makefile
153         .\wconfig config <lib\krb5\error_ta\makefile.in >lib\krb5\error_ta\makefile
154         .\wconfig config <lib\krb5\free\makefile.in >lib\krb5\free\makefile
155         .\wconfig config <lib\krb5\keytab\makefile.in >lib\krb5\keytab\makefile
156         .\wconfig config <lib\krb5\keytab\file\makefile.in >lib\krb5\keytab\file\makefile
157         .\wconfig config <lib\krb5\krb\makefile.in >lib\krb5\krb\makefile
158         .\wconfig config <lib\krb5\os\makefile.in >lib\krb5\os\makefile
159         .\wconfig config <lib\krb5\posix\makefile.in >lib\krb5\posix\makefile
160         .\wconfig config <lib\krb5\rcache\makefile.in >lib\krb5\rcache\makefile
161         .\wconfig config <util\et\makefile.in >util\et\makefile
162         config\rm.bat wconfig.obj wconfig.exe
163
164 clean-windows::
165         @echo Making clean in include
166         cd include
167         -$(MAKE) -$(MAKEFLAGS) clean
168         @echo Making clean in util\et
169         cd ..\util\et
170         -$(MAKE) -$(MAKEFLAGS) clean
171         @echo Making clean in lib
172         cd ..\..\lib
173         -$(MAKE) -$(MAKEFLAGS) clean
174         @echo Making clean in windows
175         cd ..\windows
176         -$(MAKE) -$(MAKEFLAGS) clean
177         cd ..
178         @echo Making clean locally
179         config\rm.bat *.obj msvc.pdb *.err wconfig.obj wconfig.exe
180
181 #
182 # Builds the zip file that distributes Kerberos sources for DOS sites
183 # from the source tree on Unix. Note, it doesn't handle binary files 
184 # well, so you MUST do a make clean before hand. 
185 #
186 ZIPFILES= ./* \
187         config/* include/* include/krb5/* include/krb5/asn.1/* \
188         include/krb5/stock/* include/sys/* lib/* lib/crypto/* \
189         lib/crypto/crc32/* lib/crypto/des/* lib/crypto/md4/* \
190         lib/crypto/md5/* lib/crypto/os/* lib/des425/* lib/gssapi/* \
191         lib/gssapi/generic/* lib/gssapi/krb5/* lib/krb425/* \
192         lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \
193         lib/krb5/ccache/* lib/krb5/ccache/file/* \
194         lib/krb5/ccache/stdio/* lib/krb5/error_tables/* \
195         lib/krb5/free/* lib/krb5/keytab/* lib/krb5/keytab/file/* \
196         lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* util/et/* \
197         windows/* windows/cns/*
198
199 ZIPBINARYFILES=windows/cns/*.ico
200
201 ZIPEXCLUDE= LIB/KRB5.SAB \
202         INCLUDE/KRB5/AUTOCONF.H \
203         LIB/CRYPTO/MD4/T_MDDRIV LIB/CRYPTO/MD5/T_MDDRIV \
204         WINDOWS/CNS/*.ICO *.O *.A
205
206 zip-windows: awk-windows
207         rm -f kerbsrc.zip
208         zip -Dlk kerbsrc.zip $(ZIPFILES) -x $(ZIPEXCLUDE)
209         zip -Dk kerbsrc.zip $(ZIPBINARYFILES)
210 #
211 # Part of building the PC release has to be done on Unix. This includes
212 # anything the requires awk.
213 #
214 AH  = util/et/et_h.awk
215 AC  = util/et/et_c.awk
216 INC = include/krb5/
217 ET  = lib/krb5/error_tables/
218 GG  = lib/gssapi/generic/
219 GK  = lib/gssapi/krb5/
220
221 awk-windows:
222         gawk -f $(AH) outfile=$(INC)asn1_err.h $(ET)asn1_err.et
223         gawk -f $(AH) outfile=$(INC)kdb5_err.h $(ET)kdb5_err.et
224         gawk -f $(AH) outfile=$(INC)krb5_err.h $(ET)krb5_err.et
225         gawk -f $(AH) outfile=$(INC)kv5m_err.h $(ET)kv5m_err.et
226         gawk -f $(AH) outfile=$(INC)adm_err.h $(ET)adm_err.et
227         gawk -f $(AC) outfile=$(ET)asn1_err.c $(ET)asn1_err.et
228         gawk -f $(AC) outfile=$(ET)kdb5_err.c $(ET)kdb5_err.et
229         gawk -f $(AC) outfile=$(ET)krb5_err.c $(ET)krb5_err.et
230         gawk -f $(AC) outfile=$(ET)kv5m_err.c $(ET)kv5m_err.et
231         gawk -f $(AC) outfile=$(ET)adm_err.c $(ET)adm_err.et
232         gawk -f $(AH) outfile=$(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.et
233         gawk -f $(AC) outfile=$(GG)gssapi_err_generic.c $(GG)gssapi_err_generic.et
234         gawk -f $(AH) outfile=$(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.et
235         gawk -f $(AC) outfile=$(GK)gssapi_err_krb5.c $(GK)gssapi_err_krb5.et
236