Build the list of files *after* building files using awk-windows-mac
[krb5.git] / src / Makefile.in
1 CFLAGS = $(CCOPTS) $(DEFS)
2
3 SRCS =  
4 HDRS = 
5
6 DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in
7
8 all-unix::
9
10 all-mac::
11
12 LIBCMD = lib
13 all-windows:: makefile-windows
14         @echo Making in include
15         cd include
16         -$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
17         @echo Making in util\et
18         cd ..\util\et
19         -$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
20         @echo Making in util\profile
21         cd ..\profile
22         -$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
23         @echo Making in lib
24         cd ..\..\lib
25         -$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
26         @echo Making in windows
27         cd ..\windows
28         -$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
29         cd ..
30
31 world::
32         date
33         make $(MFLAGS) all
34         date
35
36 INSTALLMKDIRS = $(KRB5ROOT) $(KRB5MANROOT) $(KRB5OTHERMKDIRS) \
37                 $(ADMIN_BINDIR) $(SERVER_BINDIR) $(CLIENT_BINDIR) \
38                 $(ADMIN_MANDIR) $(SERVER_MANDIR) $(CLIENT_MANDIR) \
39                 $(FILE_MANDIR) $(KRB5_LIBDIR) $(KRB5_INCDIR) \
40                 $(KRB5_INCSUBDIRS)
41
42 install-unix:: install-mkdirs
43
44 install-mkdirs:
45         @for i in $(INSTALLMKDIRS); do \
46                 if test -d $(DESTDIR)$$i; then :; else (set -x; mkdir -p $(DESTDIR)$$i); fi \
47         done
48
49 # install::
50 #       $(MAKE) $(MFLAGS) install.man
51
52 .c.o:
53         $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $<
54
55 TAGS: $(SRCS)
56         etags $(SRCS)
57
58 clean-:: clean-windows
59 clean-mac:: clean-unix
60 clean-unix::
61         $(RM) *.o core
62
63 mostlyclean: clean
64
65 distclean: clean
66         rm -f Makefile config.status
67
68 realclean: distclean
69         rm -f TAGS
70
71 dist: $(DISTFILES)
72         echo cpio-`sed -e '/version_string/!d' \
73         -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
74         rm -rf `cat .fname`
75         mkdir `cat .fname`
76         -ln $(DISTFILES) `cat .fname`
77         for file in $(DISTFILES); do \
78           test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \
79         done
80         tar chzf `cat .fname`.tar.gz `cat .fname`
81         rm -rf `cat .fname` .fname
82
83 # Macintosh build process...
84
85 # Build all things for the Mac build, which need to be built on
86 # Unix first.
87 unixmac:
88         (cd lib/krb5/error_tables; make -f Makefile.in unixmac)
89         (cd lib/gssapi/generic; make -f Makefile.in unixmac)
90
91
92 # Microsoft Windows build process...
93 #
94
95 config-windows:: makefile-windows
96         @echo Making in include
97         cd include
98         -$(MAKE) -$(MAKEFLAGS)
99         cd ..
100
101 makefile-windows:: wconfig.exe config\pre.in config\post.in \
102                 include\makefile.in include\krb5\makefile.in \
103                 lib\makefile.in lib\crypto\makefile.in \
104                 lib\crypto\crc32\makefile.in lib\crypto\des\makefile.in \
105                 lib\crypto\md4\makefile.in lib\crypto\md5\makefile.in \
106                 lib\crypto\os\makefile.in lib\des425\makefile.in \
107                 lib\gssapi\makefile.in lib\gssapi\generic\makefile.in \
108                 lib\gssapi\krb5\makefile.in lib\krb5\makefile.in \
109                 lib\krb5\asn.1\makefile.in lib\krb5\ccache\makefile.in \
110                 lib\krb5\ccache\file\makefile.in \
111                 lib\krb5\ccache\stdio\makefile.in \
112                 lib\krb5\error_ta\makefile.in \
113                 lib\krb5\free\makefile.in lib\krb5\keytab\makefile.in \
114                 lib\krb5\keytab\file\makefile.in lib\krb5\krb\makefile.in \
115                 lib\krb5\os\makefile.in lib\krb5\posix\makefile.in \
116                 lib\krb5\rcache\makefile.in \
117                 util\et\makefile.in util\profile\makefile.in
118         type makefile.in >makefile
119         .\wconfig config <include\makefile.in >include\makefile
120         .\wconfig config <include\krb5\makefile.in >include\krb5\makefile
121         .\wconfig config <lib\makefile.in >lib\makefile
122         .\wconfig config <lib\crypto\makefile.in >lib\crypto\makefile
123         .\wconfig config <lib\crypto\crc32\makefile.in >lib\crypto\crc32\makefile
124         .\wconfig config <lib\crypto\des\makefile.in >lib\crypto\des\makefile
125         .\wconfig config <lib\crypto\md4\makefile.in >lib\crypto\md4\makefile
126         .\wconfig config <lib\crypto\md5\makefile.in >lib\crypto\md5\makefile
127         .\wconfig config <lib\crypto\os\makefile.in >lib\crypto\os\makefile
128         .\wconfig config <lib\des425\makefile.in >lib\des425\makefile
129         .\wconfig config <lib\gssapi\makefile.in >lib\gssapi\makefile
130         .\wconfig config <lib\gssapi\generic\makefile.in >lib\gssapi\generic\makefile
131         .\wconfig config <lib\gssapi\krb5\makefile.in >lib\gssapi\krb5\makefile
132         .\wconfig config <lib\kadm\makefile.in >lib\kadm\makefile
133         .\wconfig config <lib\krb5\makefile.in >lib\krb5\makefile
134         .\wconfig config <lib\krb5\asn.1\makefile.in >lib\krb5\asn.1\makefile
135         .\wconfig config <lib\krb5\ccache\makefile.in >lib\krb5\ccache\makefile
136         .\wconfig config <lib\krb5\ccache\file\makefile.in >lib\krb5\ccache\file\makefile
137         .\wconfig config <lib\krb5\ccache\stdio\makefile.in >lib\krb5\ccache\stdio\makefile
138         .\wconfig config <lib\krb5\error_ta\makefile.in >lib\krb5\error_ta\makefile
139         .\wconfig config <lib\krb5\free\makefile.in >lib\krb5\free\makefile
140         .\wconfig config <lib\krb5\keytab\makefile.in >lib\krb5\keytab\makefile
141         .\wconfig config <lib\krb5\keytab\file\makefile.in >lib\krb5\keytab\file\makefile
142         .\wconfig config <lib\krb5\krb\makefile.in >lib\krb5\krb\makefile
143         .\wconfig config <lib\krb5\os\makefile.in >lib\krb5\os\makefile
144         .\wconfig config <lib\krb5\posix\makefile.in >lib\krb5\posix\makefile
145         .\wconfig config <lib\krb5\rcache\makefile.in >lib\krb5\rcache\makefile
146         .\wconfig config <util\et\makefile.in >util\et\makefile
147         .\wconfig config <util\profile\makefile.in >util\profile\makefile
148         config\rm.bat wconfig.obj msvc.pdb
149
150 wconfig.exe: wconfig.c
151         SET CL=/nologo
152         $(CC) /AL wconfig.c
153
154 clean-windows::
155         @echo Making clean in include
156         cd include
157         -$(MAKE) -$(MAKEFLAGS) clean
158         @echo Making clean in util\et
159         cd ..\util\et
160         -$(MAKE) -$(MAKEFLAGS) clean
161         @echo Making clean in util\profile
162         cd ..\profile
163         -$(MAKE) -$(MAKEFLAGS) clean
164         @echo Making clean in lib
165         cd ..\..\lib
166         -$(MAKE) -$(MAKEFLAGS) clean
167         @echo Making clean in windows
168         cd ..\windows
169         -$(MAKE) -$(MAKEFLAGS) clean
170         cd ..
171         @echo Making clean in root
172         config\rm.bat *.obj msvc.pdb *.err wconfig.obj wconfig.exe
173
174 #
175 # Renames DOS 8.3 filenames back to their proper, longer names.
176 #
177 ren2long:
178         -sh config/ren2long
179
180 #
181 # Builds the file that distributes Kerberos sources for DOS and 
182 # Macintosh sites from the source tree on Unix.
183 #
184 ZIP=zip
185 FILES= ./* \
186         config/* include/* include/krb5/* include/krb5/asn.1/* \
187         include/krb5/stock/* include/sys/* lib/* lib/crypto/* \
188         lib/crypto/crc32/* lib/crypto/des/* lib/crypto/md4/* \
189         lib/crypto/md5/* lib/crypto/os/* lib/des425/* lib/gssapi/* \
190         lib/gssapi/generic/* lib/gssapi/krb5/* lib/kadm/* lib/krb425/* \
191         lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \
192         lib/krb5/ccache/* lib/krb5/ccache/file/* \
193         lib/krb5/ccache/stdio/* lib/krb5/error_tables/* \
194         lib/krb5/free/* lib/krb5/keytab/* lib/krb5/keytab/file/* \
195         lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* util/et/* \
196         util/profile/*
197
198 WINFILES= windows/* windows/cns/* windows/wintel/* windows/gss/*
199
200 MACFILES= mac/* mac/kconfig/* mac/libraries/* mac/telnet-k5-auth/* \
201         mac/gss-sample/*
202
203 WINBINARYFILES=windows/cns/*.ico windows/wintel/*.ico windows/gss/*.ico
204
205 CLEANUP= util/profile/profile.h util/profile/prof_err.[ch] \
206         lib/krb5/error_tables/asn1_err.c lib/krb5/error_tables/kdb5_err.c \
207         lib/krb5/error_tables/krb5_err.c lib/krb5/error_tables/kv5m_err.c \
208         lib/krb5/error_tables/adm_err.c \
209         include/asn1_err.h include/kdb5_err.h \
210         include/krb5_err.h include/kv5m_err.h \
211         include/adm_err.h include/profile.h include/krb5.h \
212         include/krb5/osconf.h \
213         lib/gssapi/generic/gssapi_err_generic.[ch] \
214         lib/gssapi/krb5/gssapi_err_krb5.[ch] winfile.list macfile.list
215
216 kerbsrc.win: kerbsrc.zip
217
218 winfile.list:
219         echo $(FILES) $(WINFILES) | tr ' ' \\012 | \
220                 sed -f config/winexclude.sed > winfile.list
221
222 macfile.list:
223          find $(FILES) $(MACFILES) -prune -type f -print | \
224                 sed -f config/winexclude.sed > macfile.list
225
226 Makefile.sav:
227         rm -f Makefile.sav
228         mv Makefile Makefile.sav
229         cat config/windows.in Makefile.in > Makefile
230
231 kerbsrc.zip: Makefile.sav awk-windows-mac winfile.list
232         rm -f kerbsrc.zip
233         $(ZIP) -Dlk kerbsrc.zip `cat winfile.list`
234         $(ZIP) -Dk kerbsrc.zip $(WINBINARYFILES)
235         mv Makefile.sav Makefile
236         rm -f $(CLEANUP)
237
238 kerbsrc-nt.zip: Makefile.sav awk-windows-mac winfile.list
239         rm -f kerbsrc-nt.zip
240         $(ZIP) -Dl kerbsrc-nt.zip `cat winfile.list`
241         $(ZIP) -D kerbsrc-nt.zip $(WINBINARYFILES)
242         mv Makefile.sav Makefile
243         rm -f $(CLEANUP)
244
245 dos-zipfiles: Makefile.sav awk-windows-mac winfile.list
246         rm -f kerbsrc.zip
247         $(ZIP) -Dlk kerbsrc.zip `cat winfile.list`
248         $(ZIP) -Dk kerbsrc.zip $(WINBINARYFILES)
249         rm -f kerbsrc-nt.zip
250         $(ZIP) -Dl kerbsrc-nt.zip `cat winfile.list`
251         $(ZIP) -D kerbsrc-nt.zip $(WINBINARYFILES)
252         mv Makefile.sav Makefile
253         rm -f $(CLEANUP)
254
255 kerbsrc.mac: awk-windows-mac macfile.list 
256         cp mac/libraries/autoconf.h include/autoconf.h
257         tar cvf kerbsrc.tar include/autoconf.h `cat macfile.list`
258         rm -f $(CLEANUP)
259         rm -f include/autoconf.h
260
261 #
262 # Part of building the PC release has to be done on Unix. This includes
263 # anything the requires awk.
264 #
265 AH  = util/et/et_h.awk
266 AC  = util/et/et_c.awk
267 INC = include/
268 ET  = lib/krb5/error_tables/
269 GG  = lib/gssapi/generic/
270 GK  = lib/gssapi/krb5/
271 PR  = util/profile/
272
273 awk-windows-mac:
274         gawk -f $(AH) outfile=$(INC)asn1_err.h $(ET)asn1_err.et
275         gawk -f $(AH) outfile=$(INC)kdb5_err.h $(ET)kdb5_err.et
276         gawk -f $(AH) outfile=$(INC)krb5_err.h $(ET)krb5_err.et
277         gawk -f $(AH) outfile=$(INC)kv5m_err.h $(ET)kv5m_err.et
278         gawk -f $(AH) outfile=$(INC)adm_err.h $(ET)adm_err.et
279         cat $(INC)/krb5.hin $(INC)/krb5_err.h $(INC)/kdb5_err.h \
280                 $(INC)/kv5m_err.h $(INC)/asn1_err.h > $(INC)/krb5.h
281         gawk -f $(AC) outfile=$(ET)asn1_err.c $(ET)asn1_err.et
282         gawk -f $(AC) outfile=$(ET)kdb5_err.c $(ET)kdb5_err.et
283         gawk -f $(AC) outfile=$(ET)krb5_err.c $(ET)krb5_err.et
284         gawk -f $(AC) outfile=$(ET)kv5m_err.c $(ET)kv5m_err.et
285         gawk -f $(AC) outfile=$(ET)adm_err.c $(ET)adm_err.et
286         gawk -f $(AH) outfile=$(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.et
287         gawk -f $(AC) outfile=$(GG)gssapi_err_generic.c $(GG)gssapi_err_generic.et
288         gawk -f $(AH) outfile=$(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.et
289         gawk -f $(AC) outfile=$(GK)gssapi_err_krb5.c $(GK)gssapi_err_krb5.et
290         gawk -f $(AH) outfile=$(PR)prof_err.h $(PR)prof_err.et
291         gawk -f $(AC) outfile=$(PR)prof_err.c $(PR)prof_err.et
292         cat $(PR)/profile.hin $(PR)prof_err.h > $(PR)profile.h
293         cp $(PR)profile.h include/profile.h
294         cp $(INC)/krb5/stock/osconf.h $(INC)/krb5