Remove util/profile/profile.h after building kerbsrc.zip; this file
[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.exe 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         .\wconfig config <include\makefile.in >include\makefile
147         .\wconfig config <include\krb5\makefile.in >include\krb5\makefile
148         .\wconfig config <lib\makefile.in >lib\makefile
149         .\wconfig config <lib\crypto\makefile.in >lib\crypto\makefile
150         .\wconfig config <lib\crypto\crc32\makefile.in >lib\crypto\crc32\makefile
151         .\wconfig config <lib\crypto\des\makefile.in >lib\crypto\des\makefile
152         .\wconfig config <lib\crypto\md4\makefile.in >lib\crypto\md4\makefile
153         .\wconfig config <lib\crypto\md5\makefile.in >lib\crypto\md5\makefile
154         .\wconfig config <lib\crypto\os\makefile.in >lib\crypto\os\makefile
155         .\wconfig config <lib\des425\makefile.in >lib\des425\makefile
156         .\wconfig config <lib\gssapi\makefile.in >lib\gssapi\makefile
157         .\wconfig config <lib\gssapi\generic\makefile.in >lib\gssapi\generic\makefile
158         .\wconfig config <lib\gssapi\krb5\makefile.in >lib\gssapi\krb5\makefile
159         .\wconfig config <lib\krb5\makefile.in >lib\krb5\makefile
160         .\wconfig config <lib\krb5\asn.1\makefile.in >lib\krb5\asn.1\makefile
161         .\wconfig config <lib\krb5\ccache\makefile.in >lib\krb5\ccache\makefile
162         .\wconfig config <lib\krb5\ccache\file\makefile.in >lib\krb5\ccache\file\makefile
163         .\wconfig config <lib\krb5\ccache\stdio\makefile.in >lib\krb5\ccache\stdio\makefile
164         .\wconfig config <lib\krb5\error_ta\makefile.in >lib\krb5\error_ta\makefile
165         .\wconfig config <lib\krb5\free\makefile.in >lib\krb5\free\makefile
166         .\wconfig config <lib\krb5\keytab\makefile.in >lib\krb5\keytab\makefile
167         .\wconfig config <lib\krb5\keytab\file\makefile.in >lib\krb5\keytab\file\makefile
168         .\wconfig config <lib\krb5\krb\makefile.in >lib\krb5\krb\makefile
169         .\wconfig config <lib\krb5\os\makefile.in >lib\krb5\os\makefile
170         .\wconfig config <lib\krb5\posix\makefile.in >lib\krb5\posix\makefile
171         .\wconfig config <lib\krb5\rcache\makefile.in >lib\krb5\rcache\makefile
172         .\wconfig config <util\et\makefile.in >util\et\makefile
173         .\wconfig config <util\profile\makefile.in >util\profile\makefile
174         config\rm.bat wconfig.obj msvc.pdb
175
176 wconfig.exe: wconfig.c
177         SET CL=/nologo
178         $(CC) /AL wconfig.c
179
180 clean-windows::
181         @echo Making clean in include
182         cd include
183         -$(MAKE) -$(MAKEFLAGS) clean
184         @echo Making clean in util\et
185         cd ..\util\et
186         -$(MAKE) -$(MAKEFLAGS) clean
187         @echo Making clean in util\profile
188         cd ..\profile
189         -$(MAKE) -$(MAKEFLAGS) clean
190         @echo Making clean in lib
191         cd ..\..\lib
192         -$(MAKE) -$(MAKEFLAGS) clean
193         @echo Making clean in windows
194         cd ..\windows
195         -$(MAKE) -$(MAKEFLAGS) clean
196         cd ..
197         @echo Making clean in root
198         config\rm.bat *.obj msvc.pdb *.err wconfig.obj wconfig.exe
199  
200 #
201 # Renames DOS 8.3 filenames back to their proper, longer names.
202 #
203 ren2long:
204         -sh config/ren2long
205
206 #
207 # Builds the zip file that distributes Kerberos sources for DOS sites
208 # from the source tree on Unix.
209 #
210 ZIPFILES= ./* \
211         config/* include/* include/krb5/* include/krb5/asn.1/* \
212         include/krb5/stock/* include/sys/* lib/* lib/crypto/* \
213         lib/crypto/crc32/* lib/crypto/des/* lib/crypto/md4/* \
214         lib/crypto/md5/* lib/crypto/os/* lib/des425/* lib/gssapi/* \
215         lib/gssapi/generic/* lib/gssapi/krb5/* lib/krb425/* \
216         lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \
217         lib/krb5/ccache/* lib/krb5/ccache/file/* \
218         lib/krb5/ccache/stdio/* lib/krb5/error_tables/* \
219         lib/krb5/free/* lib/krb5/keytab/* lib/krb5/keytab/file/* \
220         lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* util/et/* \
221         util/profile/* windows/* windows/cns/* windows/wintel/*
222
223 ZIPBINARYFILES=windows/cns/*.ico windows/wintel/*.ico
224
225 ZIPEXCLUDE= LIB/KRB5.SAB \
226         INCLUDE/KRB5/AUTOCONF.H \
227         LIB/CRYPTO/MD4/T_MDDRIV LIB/CRYPTO/MD5/T_MDDRIV \
228         UTIL/PROFILE/TEST_PAR UTIL/PROFILE/TEST_PRO \
229         WINDOWS/CNS/*.ICO WINDOWS/WINTEL/*.ICO \
230         *.O *.A
231
232 kerbsrc.zip: awk-windows
233         rm -f Makefile.bak
234         mv Makefile Makefile.bak
235         cp Makefile.in Makefile
236         rm -f kerbsrc.zip
237         zip -Dlk kerbsrc.zip $(ZIPFILES) -x $(ZIPEXCLUDE)
238         zip -Dk kerbsrc.zip $(ZIPBINARYFILES)
239         cp Makefile.bak Makefile
240         rm -f util/profile/profile.h
241
242 #
243 # Part of building the PC release has to be done on Unix. This includes
244 # anything the requires awk.
245 #
246 AH  = util/et/et_h.awk
247 AC  = util/et/et_c.awk
248 INC = include/krb5/
249 ET  = lib/krb5/error_tables/
250 GG  = lib/gssapi/generic/
251 GK  = lib/gssapi/krb5/
252 PR  = util/profile/
253
254 awk-windows:
255         gawk -f $(AH) outfile=$(INC)asn1_err.h $(ET)asn1_err.et
256         gawk -f $(AH) outfile=$(INC)kdb5_err.h $(ET)kdb5_err.et
257         gawk -f $(AH) outfile=$(INC)krb5_err.h $(ET)krb5_err.et
258         gawk -f $(AH) outfile=$(INC)kv5m_err.h $(ET)kv5m_err.et
259         gawk -f $(AH) outfile=$(INC)adm_err.h $(ET)adm_err.et
260         gawk -f $(AC) outfile=$(ET)asn1_err.c $(ET)asn1_err.et
261         gawk -f $(AC) outfile=$(ET)kdb5_err.c $(ET)kdb5_err.et
262         gawk -f $(AC) outfile=$(ET)krb5_err.c $(ET)krb5_err.et
263         gawk -f $(AC) outfile=$(ET)kv5m_err.c $(ET)kv5m_err.et
264         gawk -f $(AC) outfile=$(ET)adm_err.c $(ET)adm_err.et
265         gawk -f $(AH) outfile=$(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.et
266         gawk -f $(AC) outfile=$(GG)gssapi_err_generic.c $(GG)gssapi_err_generic.et
267         gawk -f $(AH) outfile=$(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.et
268         gawk -f $(AC) outfile=$(GK)gssapi_err_krb5.c $(GK)gssapi_err_krb5.et
269         gawk -f $(AH) outfile=$(PR)prof_err.h $(PR)prof_err.et
270         gawk -f $(AC) outfile=$(PR)prof_err.c $(PR)prof_err.et
271         cat $(PR)/profile.hin $(PR)prof_err.h > $(PR)profile.h
272         cp $(PR)profile.h include/profile.h