xref: /netbsd-src/crypto/external/bsd/heimdal/dist/lib/krb5/NTMakefile (revision 288bb96063654ec504ca8732afc683d3ebc514b5)
1########################################################################
2#
3# Copyright (c) 2009, Secure Endpoints Inc.
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9#
10# - Redistributions of source code must retain the above copyright
11#   notice, this list of conditions and the following disclaimer.
12#
13# - Redistributions in binary form must reproduce the above copyright
14#   notice, this list of conditions and the following disclaimer in
15#   the documentation and/or other materials provided with the
16#   distribution.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30#
31
32RELDIR=lib\krb5
33
34!include ../../windows/NTMakefile.w32
35
36libkrb5_OBJS =			\
37	$(OBJ)\acache.obj		    \
38	$(OBJ)\acl.obj			    \
39	$(OBJ)\add_et_list.obj		    \
40	$(OBJ)\addr_families.obj	    \
41	$(OBJ)\aname_to_localname.obj	    \
42	$(OBJ)\appdefault.obj		    \
43	$(OBJ)\asn1_glue.obj		    \
44	$(OBJ)\auth_context.obj		    \
45	$(OBJ)\build_ap_req.obj		    \
46	$(OBJ)\build_auth.obj		    \
47	$(OBJ)\cache.obj		    \
48	$(OBJ)\changepw.obj		    \
49	$(OBJ)\codec.obj		    \
50	$(OBJ)\config_file.obj		    \
51	$(OBJ)\config_reg.obj		    \
52	$(OBJ)\constants.obj		    \
53	$(OBJ)\context.obj		    \
54	$(OBJ)\copy_host_realm.obj	    \
55	$(OBJ)\crc.obj			    \
56	$(OBJ)\creds.obj		    \
57	$(OBJ)\crypto.obj		    \
58	$(OBJ)\crypto-aes.obj		    \
59	$(OBJ)\crypto-algs.obj		    \
60	$(OBJ)\crypto-arcfour.obj	    \
61	$(OBJ)\crypto-des-common.obj	    \
62	$(OBJ)\crypto-des.obj		    \
63	$(OBJ)\crypto-des3.obj		    \
64	$(OBJ)\crypto-evp.obj		    \
65	$(OBJ)\crypto-null.obj		    \
66	$(OBJ)\crypto-pk.obj		    \
67	$(OBJ)\crypto-rand.obj		    \
68	$(OBJ)\data.obj			    \
69	$(OBJ)\deprecated.obj		    \
70	$(OBJ)\digest.obj		    \
71	$(OBJ)\dll.obj			    \
72	$(OBJ)\eai_to_heim_errno.obj	    \
73	$(OBJ)\error_string.obj		    \
74	$(OBJ)\expand_hostname.obj	    \
75	$(OBJ)\expand_path.obj	    	    \
76	$(OBJ)\fcache.obj		    \
77	$(OBJ)\free.obj			    \
78	$(OBJ)\free_host_realm.obj	    \
79	$(OBJ)\generate_seq_number.obj	    \
80	$(OBJ)\generate_subkey.obj	    \
81	$(OBJ)\get_addrs.obj		    \
82	$(OBJ)\get_cred.obj		    \
83	$(OBJ)\get_default_principal.obj    \
84	$(OBJ)\get_default_realm.obj	    \
85	$(OBJ)\get_for_creds.obj	    \
86	$(OBJ)\get_host_realm.obj	    \
87	$(OBJ)\get_in_tkt.obj		    \
88	$(OBJ)\get_port.obj		    \
89	$(OBJ)\init_creds.obj		    \
90	$(OBJ)\init_creds_pw.obj	    \
91	$(OBJ)\kcm.obj			    \
92	$(OBJ)\keyblock.obj		    \
93	$(OBJ)\keytab.obj		    \
94	$(OBJ)\keytab_any.obj		    \
95	$(OBJ)\keytab_file.obj		    \
96	$(OBJ)\keytab_keyfile.obj	    \
97	$(OBJ)\keytab_memory.obj	    \
98	$(OBJ)\krbhst.obj		    \
99	$(OBJ)\kuserok.obj		    \
100	$(OBJ)\log.obj			    \
101	$(OBJ)\mcache.obj		    \
102	$(OBJ)\misc.obj			    \
103	$(OBJ)\mit_glue.obj		    \
104	$(OBJ)\mk_error.obj		    \
105	$(OBJ)\mk_priv.obj		    \
106	$(OBJ)\mk_rep.obj		    \
107	$(OBJ)\mk_req.obj		    \
108	$(OBJ)\mk_req_ext.obj		    \
109	$(OBJ)\mk_safe.obj		    \
110	$(OBJ)\net_read.obj		    \
111	$(OBJ)\net_write.obj		    \
112	$(OBJ)\n-fold.obj		    \
113	$(OBJ)\pac.obj			    \
114	$(OBJ)\padata.obj		    \
115	$(OBJ)\pkinit.obj		    \
116	$(OBJ)\principal.obj		    \
117	$(OBJ)\prog_setup.obj		    \
118	$(OBJ)\prompter_posix.obj	    \
119	$(OBJ)\rd_cred.obj		    \
120	$(OBJ)\rd_error.obj		    \
121	$(OBJ)\rd_priv.obj		    \
122	$(OBJ)\rd_rep.obj		    \
123	$(OBJ)\rd_req.obj		    \
124	$(OBJ)\rd_safe.obj		    \
125	$(OBJ)\read_message.obj		    \
126	$(OBJ)\recvauth.obj		    \
127	$(OBJ)\replay.obj		    \
128	$(OBJ)\salt-aes.obj		    \
129	$(OBJ)\salt-arcfour.obj		    \
130	$(OBJ)\salt-des.obj		    \
131	$(OBJ)\salt-des3.obj		    \
132	$(OBJ)\salt.obj			    \
133	$(OBJ)\scache.obj		    \
134	$(OBJ)\send_to_kdc.obj		    \
135	$(OBJ)\sendauth.obj		    \
136	$(OBJ)\set_default_realm.obj	    \
137	$(OBJ)\sock_principal.obj	    \
138	$(OBJ)\store.obj		    \
139	$(OBJ)\store-int.obj		    \
140	$(OBJ)\store_emem.obj		    \
141	$(OBJ)\store_fd.obj		    \
142	$(OBJ)\store_mem.obj		    \
143	$(OBJ)\pcache.obj		    \
144	$(OBJ)\plugin.obj		    \
145	$(OBJ)\ticket.obj		    \
146	$(OBJ)\time.obj			    \
147	$(OBJ)\transited.obj		    \
148	$(OBJ)\verify_init.obj		    \
149	$(OBJ)\verify_user.obj		    \
150	$(OBJ)\version.obj		    \
151	$(OBJ)\warn.obj			    \
152	$(OBJ)\write_message.obj
153
154libkrb5_gen_OBJS=	    \
155	$(OBJ)\krb5_err.obj \
156	$(OBJ)\krb_err.obj  \
157	$(OBJ)\heim_err.obj \
158	$(OBJ)\k524_err.obj
159
160INCFILES=			\
161	$(INCDIR)\heim_err.h	\
162	$(INCDIR)\k524_err.h	\
163	$(INCDIR)\krb_err.h	\
164	$(INCDIR)\krb5.h	\
165	$(INCDIR)\krb5_ccapi.h	\
166	$(INCDIR)\krb5_err.h	\
167	$(INCDIR)\krb5_locl.h	\
168	$(INCDIR)\krb5-protos.h	\
169	$(INCDIR)\krb5-private.h	\
170	$(INCDIR)\krb5-v4compat.h	\
171	$(INCDIR)\crypto.h
172
173all:: $(INCFILES)
174
175clean::
176	-$(RM) $(INCFILES)
177
178dist_libkrb5_la_SOURCES =			\
179	acache.c				\
180	acl.c					\
181	add_et_list.c				\
182	addr_families.c				\
183	aname_to_localname.c			\
184	appdefault.c				\
185	asn1_glue.c				\
186	auth_context.c				\
187	build_ap_req.c				\
188	build_auth.c				\
189	cache.c					\
190	changepw.c				\
191	codec.c					\
192	config_file.c				\
193	config_reg.c				\
194	constants.c				\
195	context.c				\
196	copy_host_realm.c			\
197	crc.c					\
198	creds.c					\
199	crypto.c				\
200	crypto.h				\
201	crypto-aes.c				\
202	crypto-algs.c				\
203	crypto-arcfour.c			\
204	crypto-des.c				\
205	crypto-des-common.c			\
206	crypto-des3.c				\
207	crypto-evp.c				\
208	crypto-pk.c				\
209	crypto-rand.c				\
210	doxygen.c				\
211	data.c					\
212	deprecated.c				\
213	digest.c				\
214	eai_to_heim_errno.c			\
215	error_string.c				\
216	expand_hostname.c			\
217	expand_path.c				\
218	fcache.c				\
219	free.c					\
220	free_host_realm.c			\
221	generate_seq_number.c			\
222	generate_subkey.c			\
223	get_addrs.c				\
224	get_cred.c				\
225	get_default_principal.c			\
226	get_default_realm.c			\
227	get_for_creds.c				\
228	get_host_realm.c			\
229	get_in_tkt.c				\
230	get_port.c				\
231	init_creds.c				\
232	init_creds_pw.c				\
233	kcm.c					\
234	kcm.h					\
235	keyblock.c				\
236	keytab.c				\
237	keytab_any.c				\
238	keytab_file.c				\
239	keytab_keyfile.c			\
240	keytab_memory.c				\
241	krb5_locl.h				\
242	krb5-v4compat.h				\
243	krbhst.c				\
244	kuserok.c				\
245	log.c					\
246	mcache.c				\
247	misc.c					\
248	mk_error.c				\
249	mk_priv.c				\
250	mk_rep.c				\
251	mk_req.c				\
252	mk_req_ext.c				\
253	mk_safe.c				\
254	mit_glue.c				\
255	net_read.c				\
256	net_write.c				\
257	n-fold.c				\
258	pac.c					\
259	padata.c				\
260	pkinit.c				\
261	principal.c				\
262	prog_setup.c				\
263	prompter_posix.c			\
264	rd_cred.c				\
265	rd_error.c				\
266	rd_priv.c				\
267	rd_rep.c				\
268	rd_req.c				\
269	rd_safe.c				\
270	read_message.c				\
271	recvauth.c				\
272	replay.c				\
273	salt.c					\
274	salt-aes.c				\
275	salt-arcfour.c				\
276	salt-des.c				\
277	salt-des3.c				\
278	scache.c				\
279	send_to_kdc.c				\
280	sendauth.c				\
281	set_default_realm.c			\
282	sock_principal.c			\
283	store.c					\
284	store-int.c				\
285	store-int.h				\
286	store_emem.c				\
287	store_fd.c				\
288	store_mem.c				\
289	pcache.c				\
290	plugin.c				\
291	ticket.c				\
292	time.c					\
293	transited.c				\
294	verify_init.c				\
295	verify_user.c				\
296	version.c				\
297	warn.c					\
298	write_message.c
299
300$(OBJ)\krb5-protos.h: $(dist_libkrb5_la_SOURCES)
301	$(PERL) ..\..\cf\make-proto.pl -E KRB5_LIB -q -P remove -o $(OBJ)\krb5-protos.h $(dist_libkrb5_la_SOURCES) || $(RM) -f $(OBJ)\krb5-protos.h
302
303$(OBJ)\krb5-private.h: $(dist_libkrb5_la_SOURCES)
304	$(PERL) ..\..\cf\make-proto.pl -q -P remove -p $(OBJ)\krb5-private.h $(dist_libkrb5_la_SOURCES) || $(RM) -f $(OBJ)\krb5-private.h
305
306$(OBJ)\krb5_err.c $(OBJ)\krb5_err.h: krb5_err.et
307	cd $(OBJ)
308	$(BINDIR)\compile_et.exe $(SRCDIR)\krb5_err.et
309	cd $(SRCDIR)
310
311$(OBJ)\krb_err.c $(OBJ)\krb_err.h: krb_err.et
312	cd $(OBJ)
313	$(BINDIR)\compile_et.exe $(SRCDIR)\krb_err.et
314	cd $(SRCDIR)
315
316$(OBJ)\heim_err.c $(OBJ)\heim_err.h: heim_err.et
317	cd $(OBJ)
318	$(BINDIR)\compile_et.exe $(SRCDIR)\heim_err.et
319	cd $(SRCDIR)
320
321$(OBJ)\k524_err.c $(OBJ)\k524_err.h: k524_err.et
322	cd $(OBJ)
323	$(BINDIR)\compile_et.exe $(SRCDIR)\k524_err.et
324	cd $(SRCDIR)
325
326#----------------------------------------------------------------------
327# libkrb5
328
329$(LIBKRB5): $(libkrb5_OBJS) $(libkrb5_gen_OBJS)
330	$(LIBCON)
331
332all:: $(LIBKRB5)
333
334clean::
335	-$(RM) $(LIBKRB5)
336
337$(OBJ)\libkrb5-exports.def: libkrb5-exports.def.in $(INCDIR)\config.h
338	$(CPREPROCESSOUT) libkrb5-exports.def.in > $@ || $(RM) $@
339
340all:: $(OBJ)\libkrb5-exports.def
341
342clean::
343	-$(RM) $(OBJ)\libkrb5-exports.def
344
345#----------------------------------------------------------------------
346# librfc3961
347
348librfc3961_OBJS=\
349	$(OBJ)\crc.obj			\
350	$(OBJ)\crypto.obj		\
351	$(OBJ)\crypto-aes.obj		\
352	$(OBJ)\crypto-algs.obj		\
353	$(OBJ)\crypto-arcfour.obj	\
354	$(OBJ)\crypto-des.obj		\
355	$(OBJ)\crypto-des-common.obj	\
356	$(OBJ)\crypto-des3.obj		\
357	$(OBJ)\crypto-evp.obj		\
358	$(OBJ)\crypto-null.obj		\
359	$(OBJ)\crypto-pk.obj		\
360	$(OBJ)\crypto-rand.obj		\
361	$(OBJ)\crypto-stubs.obj		\
362	$(OBJ)\data.obj			\
363	$(OBJ)\error_string.obj		\
364	$(OBJ)\keyblock.obj		\
365	$(OBJ)\n-fold.obj		\
366	$(OBJ)\salt.obj			\
367	$(OBJ)\salt-aes.obj		\
368	$(OBJ)\salt-arcfour.obj		\
369	$(OBJ)\salt-des.obj		\
370	$(OBJ)\salt-des3.obj		\
371	$(OBJ)\store-int.obj		\
372	$(OBJ)\warn.obj
373
374$(LIBRFC3961): $(librfc3961_OBJS)
375	$(LIBCON)
376
377all:: $(LIBRFC3961)
378
379clean::
380	-$(RM) $(LIBRFC3961)
381
382#----------------------------------------------------------------------
383# Tools
384
385all-tools:: $(BINDIR)\verify_krb5_conf.exe
386
387clean::
388	-$(RM) $(BINDIR)\verify_krb5_conf.*
389
390$(BINDIR)\verify_krb5_conf.exe: $(OBJ)\verify_krb5_conf.obj $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS) $(OBJ)\verify_krb5_conf-version.res
391	$(EXECONLINK)
392	$(EXEPREP)
393
394{}.c{$(OBJ)}.obj::
395	$(C2OBJ_P) -DBUILD_KRB5_LIB -DASN1_LIB
396
397{$(OBJ)}.c{$(OBJ)}.obj::
398	$(C2OBJ_P) -DBUILD_KRB5_LIB -DASN1_LIB
399
400#----------------------------------------------------------------------
401# Tests
402
403test:: test-binaries test-files test-run
404
405test_binaries =				\
406	$(OBJ)\aes-test.exe		\
407	$(OBJ)\derived-key-test.exe	\
408	$(OBJ)\krbhst-test.exe		\
409	$(OBJ)\n-fold-test.exe		\
410	$(OBJ)\parse-name-test.exe	\
411	$(OBJ)\store-test.exe		\
412	$(OBJ)\string-to-key-test.exe	\
413	$(OBJ)\test_acl.exe		\
414	$(OBJ)\test_addr.exe		\
415	$(OBJ)\test_alname.exe		\
416	$(OBJ)\test_cc.exe		\
417	$(OBJ)\test_config.exe		\
418	$(OBJ)\test_crypto.exe		\
419	$(OBJ)\test_crypto_wrapping.exe	\
420	$(OBJ)\test_forward.exe		\
421	$(OBJ)\test_get_addrs.exe	\
422	$(OBJ)\test_hostname.exe	\
423	$(OBJ)\test_keytab.exe		\
424	$(OBJ)\test_kuserok.exe		\
425	$(OBJ)\test_mem.exe		\
426	$(OBJ)\test_pac.exe		\
427	$(OBJ)\test_pkinit_dh2key.exe	\
428	$(OBJ)\test_pknistkdf.exe	\
429	$(OBJ)\test_plugin.exe		\
430	$(OBJ)\test_prf.exe		\
431	$(OBJ)\test_princ.exe		\
432	$(OBJ)\test_renew.exe		\
433	$(OBJ)\test_rfc3961.exe		\
434	$(OBJ)\test_store.exe		\
435	$(OBJ)\test_time.exe		\
436
437test-binaries: $(test_binaries)
438
439test-files: $(OBJ)\test_config_strings.out
440
441$(OBJ)\test_config_strings.out: test_config_strings.cfg
442	$(CP) $** $@
443
444test-run:
445	cd $(OBJ)
446	aes-test.exe
447	derived-key-test.exe
448	n-fold-test.exe
449	parse-name-test.exe
450	store-test.exe
451	string-to-key-test.exe
452	test_acl.exe
453	test_addr.exe
454	test_cc.exe
455	test_config.exe
456	test_prf.exe
457	test_store.exe
458	test_crypto.exe
459	test_crypto_wrapping.exe
460	test_keytab.exe
461	test_mem.exe
462	test_pac.exe
463	test_plugin.exe
464	test_princ.exe
465	test_pkinit_dh2key.exe
466	test_pknistkdf.exe
467	test_time.exe
468	cd $(SRCDIR)
469
470$(test_binaries): $$(@R).obj $(LIBHEIMDAL) $(LIBVERS) $(LIBROKEN)
471	$(EXECONLINK)
472	$(EXEPREP_NODIST)
473
474$(OBJ)\test_rfc3961.exe: $(OBJ)\test_rfc3961.obj $(LIBRFC3961) $(LIBHEIMDAL) $(LIBVERS) $(LIBROKEN)
475	$(EXECONLINK)
476	$(EXEPREP_NODIST)
477
478$(test_binaries:.exe=.obj): $$(@B).c
479	$(C2OBJ_C) -Fo$@ -Fd$(@D)\ $** -DBlah
480
481test-exports:
482	$(PERL) ..\..\cf\w32-check-exported-symbols.pl --vs version-script.map --def libkrb5-exports.def.in
483
484test:: test-exports
485