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