summaryrefslogtreecommitdiffstats
path: root/src/Makefile.in
blob: 10349f398b7b40bfa34b71ffd13a9bb247614321 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
CFLAGS = $(CCOPTS) $(DEFS)

prefix = /usr/local
exec_prefix = $(prefix)
binprefix =
manprefix =

bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
mandir = $(prefix)/man/man1
manext = 1

SRCS =  
HDRS = 

DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in

all:: all-$(WHAT)

all-unix::

all-mac::

all-: all-windows

LIBCMD = lib
all-windows:: makefile-windows
	@echo Making in include
	cd include
	-$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
	@echo Making in util\et
	cd ..\util\et
	-$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
	@echo Making in util\profile
	cd ..\profile
	-$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
	@echo Making in lib
	cd ..\..\lib
	-$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
	@echo Making in windows
	cd ..\windows
	-$(MAKE) -$(MAKEFLAGS) LIBCMD=$(LIBCMD)
	cd ..

world::
	date
	make $(MFLAGS) mastermakefiles
	make $(MFLAGS) depend
	make $(MFLAGS) all
	date

INSTALLMKDIRS = $(KRB5ROOT) $(KRB5MANROOT) $(KRB5OTHERMKDIRS) \
		$(ADMIN_BINDIR) $(SERVER_BINDIR) $(CLIENT_BINDIR) \
		$(ADMIN_MANDIR) $(SERVER_MANDIR) $(CLIENT_MANDIR) \
		$(FILE_MANDIR) $(KRB5_LIBDIR) $(KRB5_INCDIR) \
		$(KRB5_INCSUBDIRS)

install:: install-mkdirs

depend:: includes


install-mkdirs:
	@for i in $(INSTALLMKDIRS); do \
		if test -d $(DESTDIR)$$i; then :; else (set -x; mkdir $(DESTDIR)$$i); fi \
	done

# install::
#	$(MAKE) $(MFLAGS) install.man

# rebuild the Makefiles in the master source tree
mastermakefiles::
	-$(MV) Makefile Makefile.bak
	$(MAKE) -f Makefile.bak Makefile
	$(MAKE) Makefiles

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $<

TAGS: $(SRCS)
	etags $(SRCS)

clean:: clean-$(WHAT)

clean-:: clean-windows
clean-mac:: clean-unix
clean-unix::
	$(RM) *.o core

mostlyclean: clean

distclean: clean
	rm -f Makefile config.status

realclean: distclean
	rm -f TAGS

dist: $(DISTFILES)
	echo cpio-`sed -e '/version_string/!d' \
	-e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
	rm -rf `cat .fname`
	mkdir `cat .fname`
	-ln $(DISTFILES) `cat .fname`
	for file in $(DISTFILES); do \
	  test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \
	done
	tar chzf `cat .fname`.tar.gz `cat .fname`
	rm -rf `cat .fname` .fname

# Macintosh build process...

# Build all things for the Mac build, which need to be built on
# Unix first.
unixmac:
	(cd lib/krb5/error_tables; make -f Makefile.in unixmac)
	(cd lib/gssapi/generic; make -f Makefile.in unixmac)


# Microsoft Windows build process...
#

config-windows:: makefile-windows
	@echo Making in include
	cd include
	-$(MAKE) -$(MAKEFLAGS)
	cd ..

makefile-windows:: wconfig.exe config\pre.in config\post.in \
		include\makefile.in include\krb5\makefile.in \
		lib\makefile.in lib\crypto\makefile.in \
		lib\crypto\crc32\makefile.in lib\crypto\des\makefile.in \
		lib\crypto\md4\makefile.in lib\crypto\md5\makefile.in \
		lib\crypto\os\makefile.in lib\des425\makefile.in \
		lib\gssapi\makefile.in lib\gssapi\generic\makefile.in \
		lib\gssapi\krb5\makefile.in lib\krb5\makefile.in \
		lib\krb5\asn.1\makefile.in lib\krb5\ccache\makefile.in \
		lib\krb5\ccache\file\makefile.in \
		lib\krb5\ccache\stdio\makefile.in \
		lib\krb5\error_ta\makefile.in \
		lib\krb5\free\makefile.in lib\krb5\keytab\makefile.in \
		lib\krb5\keytab\file\makefile.in lib\krb5\krb\makefile.in \
		lib\krb5\os\makefile.in lib\krb5\posix\makefile.in \
		lib\krb5\rcache\makefile.in \
		util\et\makefile.in util\profile\makefile.in
	type makefile.in >makefile
	.\wconfig config <include\makefile.in >include\makefile
	.\wconfig config <include\krb5\makefile.in >include\krb5\makefile
	.\wconfig config <lib\makefile.in >lib\makefile
	.\wconfig config <lib\crypto\makefile.in >lib\crypto\makefile
	.\wconfig config <lib\crypto\crc32\makefile.in >lib\crypto\crc32\makefile
	.\wconfig config <lib\crypto\des\makefile.in >lib\crypto\des\makefile
	.\wconfig config <lib\crypto\md4\makefile.in >lib\crypto\md4\makefile
	.\wconfig config <lib\crypto\md5\makefile.in >lib\crypto\md5\makefile
	.\wconfig config <lib\crypto\os\makefile.in >lib\crypto\os\makefile
	.\wconfig config <lib\des425\makefile.in >lib\des425\makefile
	.\wconfig config <lib\gssapi\makefile.in >lib\gssapi\makefile
	.\wconfig config <lib\gssapi\generic\makefile.in >lib\gssapi\generic\makefile
	.\wconfig config <lib\gssapi\krb5\makefile.in >lib\gssapi\krb5\makefile
	.\wconfig config <lib\krb5\makefile.in >lib\krb5\makefile
	.\wconfig config <lib\krb5\asn.1\makefile.in >lib\krb5\asn.1\makefile
	.\wconfig config <lib\krb5\ccache\makefile.in >lib\krb5\ccache\makefile
	.\wconfig config <lib\krb5\ccache\file\makefile.in >lib\krb5\ccache\file\makefile
	.\wconfig config <lib\krb5\ccache\stdio\makefile.in >lib\krb5\ccache\stdio\makefile
	.\wconfig config <lib\krb5\error_ta\makefile.in >lib\krb5\error_ta\makefile
	.\wconfig config <lib\krb5\free\makefile.in >lib\krb5\free\makefile
	.\wconfig config <lib\krb5\keytab\makefile.in >lib\krb5\keytab\makefile
	.\wconfig config <lib\krb5\keytab\file\makefile.in >lib\krb5\keytab\file\makefile
	.\wconfig config <lib\krb5\krb\makefile.in >lib\krb5\krb\makefile
	.\wconfig config <lib\krb5\os\makefile.in >lib\krb5\os\makefile
	.\wconfig config <lib\krb5\posix\makefile.in >lib\krb5\posix\makefile
	.\wconfig config <lib\krb5\rcache\makefile.in >lib\krb5\rcache\makefile
	.\wconfig config <util\et\makefile.in >util\et\makefile
	.\wconfig config <util\profile\makefile.in >util\profile\makefile
	config\rm.bat wconfig.obj msvc.pdb

wconfig.exe: wconfig.c
	SET CL=/nologo
	$(CC) /AL wconfig.c

clean-windows::
	@echo Making clean in include
	cd include
	-$(MAKE) -$(MAKEFLAGS) clean
	@echo Making clean in util\et
	cd ..\util\et
	-$(MAKE) -$(MAKEFLAGS) clean
	@echo Making clean in util\profile
	cd ..\profile
	-$(MAKE) -$(MAKEFLAGS) clean
	@echo Making clean in lib
	cd ..\..\lib
	-$(MAKE) -$(MAKEFLAGS) clean
	@echo Making clean in windows
	cd ..\windows
	-$(MAKE) -$(MAKEFLAGS) clean
	cd ..
	@echo Making clean in root
	config\rm.bat *.obj msvc.pdb *.err wconfig.obj wconfig.exe
 
#
# Renames DOS 8.3 filenames back to their proper, longer names.
#
ren2long:
	-sh config/ren2long

#
# Builds the zip file that distributes Kerberos sources for DOS sites
# from the source tree on Unix.
#
ZIPFILES= ./* \
	config/* include/* include/krb5/* include/krb5/asn.1/* \
	include/krb5/stock/* include/sys/* lib/* lib/crypto/* \
	lib/crypto/crc32/* lib/crypto/des/* lib/crypto/md4/* \
	lib/crypto/md5/* lib/crypto/os/* lib/des425/* lib/gssapi/* \
	lib/gssapi/generic/* lib/gssapi/krb5/* lib/krb425/* \
	lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \
	lib/krb5/ccache/* lib/krb5/ccache/file/* \
	lib/krb5/ccache/stdio/* lib/krb5/error_tables/* \
	lib/krb5/free/* lib/krb5/keytab/* lib/krb5/keytab/file/* \
	lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* util/et/* \
	util/profile/* windows/* windows/cns/* windows/wintel/* \
	windows/gss/*

ZIPBINARYFILES=windows/cns/*.ico windows/wintel/*.ico windows/gss/*.ico

ZIPEXCLUDE= LIB/KRB5.SAB \
	INCLUDE/KRB5/AUTOCONF.H \
	LIB/CRYPTO/MD4/T_MDDRIV LIB/CRYPTO/MD5/T_MDDRIV \
	UTIL/PROFILE/TEST_PAR UTIL/PROFILE/TEST_PRO \
	WINDOWS/CNS/*.ICO WINDOWS/WINTEL/*.ICO WINDOWS/GSS/*.ICO \
	*.O *.A *.ZIP

kerbsrc.zip: awk-windows
	rm -f Makefile.bak
	mv Makefile Makefile.bak
	cp Makefile.in Makefile
	rm -f kerbsrc.zip
	zip -Dlk kerbsrc.zip $(ZIPFILES) -x $(ZIPEXCLUDE)
	zip -Dk kerbsrc.zip $(ZIPBINARYFILES)
	cp Makefile.bak Makefile
	rm -f util/profile/profile.h util/profile/prof_err.[ch]

#
# Part of building the PC release has to be done on Unix. This includes
# anything the requires awk.
#
AH  = util/et/et_h.awk
AC  = util/et/et_c.awk
INC = include/krb5/
ET  = lib/krb5/error_tables/
GG  = lib/gssapi/generic/
GK  = lib/gssapi/krb5/
PR  = util/profile/

awk-windows:
	gawk -f $(AH) outfile=$(INC)asn1_err.h $(ET)asn1_err.et
	gawk -f $(AH) outfile=$(INC)kdb5_err.h $(ET)kdb5_err.et
	gawk -f $(AH) outfile=$(INC)krb5_err.h $(ET)krb5_err.et
	gawk -f $(AH) outfile=$(INC)kv5m_err.h $(ET)kv5m_err.et
	gawk -f $(AH) outfile=$(INC)adm_err.h $(ET)adm_err.et
	gawk -f $(AC) outfile=$(ET)asn1_err.c $(ET)asn1_err.et
	gawk -f $(AC) outfile=$(ET)kdb5_err.c $(ET)kdb5_err.et
	gawk -f $(AC) outfile=$(ET)krb5_err.c $(ET)krb5_err.et
	gawk -f $(AC) outfile=$(ET)kv5m_err.c $(ET)kv5m_err.et
	gawk -f $(AC) outfile=$(ET)adm_err.c $(ET)adm_err.et
	gawk -f $(AH) outfile=$(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.et
	gawk -f $(AC) outfile=$(GG)gssapi_err_generic.c $(GG)gssapi_err_generic.et
	gawk -f $(AH) outfile=$(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.et
	gawk -f $(AC) outfile=$(GK)gssapi_err_krb5.c $(GK)gssapi_err_krb5.et
	gawk -f $(AH) outfile=$(PR)prof_err.h $(PR)prof_err.et
	gawk -f $(AC) outfile=$(PR)prof_err.c $(PR)prof_err.et
	cat $(PR)/profile.hin $(PR)prof_err.h > $(PR)profile.h
	cp $(PR)profile.h include/profile.h