xref: /freebsd/crypto/krb5/src/util/support/Makefile.in (revision f1c4c3daccbaf3820f0e2224de53df12fc952fcc)
1mydir=util$(S)support
2BUILDTOP=$(REL)..$(S)..
3RELDIR=../util/support
4
5##DOS##BUILDTOP = ..\..
6##DOS##LIBNAME=$(OUTPRE)k5sprt32.lib
7##DOS##WIN64LIBNAME=$(OUTPRE)k5sprt64.lib
8##DOS##XTRA=
9##DOS##OBJFILE=$(OUTPRE)k5sprt32.lst
10##DOS##WIN64OBJFILE=$(OUTPRE)k5sprt64.lst
11
12SED = sed
13
14LIBBASE=krb5support
15LIBMAJOR=@SUPPORTLIB_MAJOR@
16LIBMINOR=1
17
18LIBINITFUNC=krb5int_thread_support_init @SECURE_GETENV_INIT@
19LIBFINIFUNC=krb5int_thread_support_fini
20
21GETTIMEOFDAY_ST_OBJ= @GETTIMEOFDAY_ST_OBJ@
22GETTIMEOFDAY_OBJ= @GETTIMEOFDAY_OBJ@
23##DOS##GETTIMEOFDAY_ST_OBJ= gettimeofday.o
24##DOS##GETTIMEOFDAY_OBJ= $(OUTPRE)gettimeofday.$(OBJEXT)
25
26MKSTEMP_ST_OBJ= @MKSTEMP_ST_OBJ@
27MKSTEMP_OBJ= @MKSTEMP_OBJ@
28##DOS##MKSTEMP_ST_OBJ= mkstemp.o
29##DOS##MKSTEMP_OBJ= $(OUTPRE)mkstemp.$(OBJEXT)
30
31STRLCPY_ST_OBJ=@STRLCPY_ST_OBJ@
32STRLCPY_OBJ=@STRLCPY_OBJ@
33##DOS##STRLCPY_ST_OBJ= strlcpy.o
34##DOS##STRLCPY_OBJ= $(OUTPRE)strlcpy.$(OBJEXT)
35
36FNMATCH_ST_OBJ= @FNMATCH_ST_OBJ@
37FNMATCH_OBJ= @FNMATCH_OBJ@
38##DOS##FNMATCH_ST_OBJ= fnmatch.o
39##DOS##FNMATCH_OBJ= $(OUTPRE)fnmatch.$(OBJEXT)
40
41PRINTF_ST_OBJ= @PRINTF_ST_OBJ@
42PRINTF_OBJ= @PRINTF_OBJ@
43##DOS##PRINTF_ST_OBJ= printf.o
44##DOS##PRINTF_OBJ= $(OUTPRE)printf.$(OBJEXT)
45
46GETOPT_ST_OBJ= @GETOPT_ST_OBJ@
47GETOPT_OBJ= @GETOPT_OBJ@
48##DOS##GETOPT_ST_OBJ= getopt.o
49##DOS##GETOPT_OBJ= $(OUTPRE)getopt.$(OBJEXT)
50
51GETOPT_LONG_ST_OBJ= @GETOPT_LONG_ST_OBJ@
52GETOPT_LONG_OBJ= @GETOPT_LONG_OBJ@
53##DOS##GETOPT_LONG_ST_OBJ= getopt_long.o
54##DOS##GETOPT_LONG_OBJ= $(OUTPRE)getopt_long.$(OBJEXT)
55
56SECURE_GETENV_ST_OBJ= @SECURE_GETENV_ST_OBJ@
57SECURE_GETENV_OBJ= @SECURE_GETENV_OBJ@
58##DOS##SECURE_GETENV_ST_OBJ=
59##DOS##SECURE_GETENV_OBJ=
60
61K5_REGEX_ST_OBJ=
62K5_REGEX_OBJ=
63##DOS##K5_REGEX_ST_OBJ= regex.o
64##DOS##K5_REGEX_OBJ= $(OUTPRE)regex.$(OBJEXT)
65
66IPC_ST_OBJ=
67IPC_OBJ=
68##DOS##IPC_ST_OBJ= ipc_stream.o
69##DOS##IPC_OBJ= $(OUTPRE)ipc_stream.$(OBJEXT)
70IPC_SYMS= \
71	krb5int_ipc_stream_data krb5int_ipc_stream_new \
72	krb5int_ipc_stream_write krb5int_ipc_stream_read \
73	krb5int_ipc_stream_read_int32 krb5int_ipc_stream_write_int32 \
74	krb5int_ipc_stream_read_int64 krb5int_ipc_stream_write_int64 \
75	krb5int_ipc_stream_read_uint32 krb5int_ipc_stream_write_uint32 \
76	krb5int_ipc_stream_read_string krb5int_ipc_stream_write_string \
77	krb5int_ipc_stream_release krb5int_ipc_stream_size \
78	krb5int_ipc_stream_free_string
79
80STLIBOBJS= \
81	threads.o \
82	init-addrinfo.o \
83	plugins.o \
84	errors.o \
85	k5buf.o \
86	gmt_mktime.o \
87	fake-addrinfo.o \
88	utf8.o \
89	utf8_conv.o \
90	zap.o \
91	path.o \
92	base64.o \
93	json.o \
94	hex.o \
95	hashtab.o \
96	bcmp.o \
97	strerror_r.o \
98	dir_filenames.o \
99	$(GETTIMEOFDAY_ST_OBJ) \
100	$(IPC_ST_OBJ) \
101	$(STRLCPY_ST_OBJ) \
102	$(FNMATCH_ST_OBJ) \
103	$(PRINTF_ST_OBJ) \
104	$(MKSTEMP_ST_OBJ) \
105	$(GETOPT_ST_OBJ) \
106	$(GETOPT_LONG_ST_OBJ) \
107	$(SECURE_GETENV_OBJ) \
108	$(K5_REGEX_ST_OBJ)
109
110LIBOBJS= \
111	$(OUTPRE)threads.$(OBJEXT) \
112	$(OUTPRE)init-addrinfo.$(OBJEXT) \
113	$(OUTPRE)plugins.$(OBJEXT) \
114	$(OUTPRE)errors.$(OBJEXT) \
115	$(OUTPRE)k5buf.$(OBJEXT) \
116	$(OUTPRE)gmt_mktime.$(OBJEXT) \
117	$(OUTPRE)fake-addrinfo.$(OBJEXT) \
118	$(OUTPRE)utf8.$(OBJEXT) \
119	$(OUTPRE)utf8_conv.$(OBJEXT) \
120	$(OUTPRE)zap.$(OBJEXT) \
121	$(OUTPRE)path.$(OBJEXT) \
122	$(OUTPRE)base64.$(OBJEXT) \
123	$(OUTPRE)json.$(OBJEXT) \
124	$(OUTPRE)hex.$(OBJEXT) \
125	$(OUTPRE)hashtab.$(OBJEXT) \
126	$(OUTPRE)bcmp.$(OBJEXT) \
127	$(OUTPRE)strerror_r.$(OBJEXT) \
128	$(OUTPRE)dir_filenames.$(OBJEXT) \
129	$(GETTIMEOFDAY_OBJ) \
130	$(IPC_OBJ) \
131	$(STRLCPY_OBJ) \
132	$(FNMATCH_OBJ) \
133	$(PRINTF_OBJ) \
134	$(MKSTEMP_OBJ) \
135	$(GETOPT_OBJ) \
136	$(GETOPT_LONG_OBJ) \
137	$(SECURE_GETENV_OBJ) \
138	$(K5_REGEX_OBJ)
139
140SRCS=\
141	$(srcdir)/threads.c \
142	$(srcdir)/init-addrinfo.c \
143	$(srcdir)/plugins.c \
144	$(srcdir)/errors.c \
145	$(srcdir)/k5buf.c \
146	$(srcdir)/gmt_mktime.c \
147	$(srcdir)/fake-addrinfo.c \
148	$(srcdir)/utf8.c \
149	$(srcdir)/utf8_conv.c \
150	$(srcdir)/gettimeofday.c \
151	$(srcdir)/strlcpy.c \
152	$(srcdir)/fnmatch.c \
153	$(srcdir)/printf.c \
154	$(srcdir)/mkstemp.c \
155	$(srcdir)/t_k5buf.c \
156	$(srcdir)/t_unal.c \
157	$(srcdir)/t_path.c \
158	$(srcdir)/t_json.c \
159	$(srcdir)/t_hex.c \
160	$(srcdir)/t_hashtab.c \
161	$(srcdir)/zap.c \
162	$(srcdir)/path.c \
163	$(srcdir)/base64.c \
164	$(srcdir)/json.c \
165	$(srcdir)/hex.c \
166	$(srcdir)/hashtab.c \
167	$(srcdir)/bcmp.c \
168	$(srcdir)/strerror_r.c \
169	$(srcdir)/dir_filenames.c \
170	$(srcdir)/t_utf8.c \
171	$(srcdir)/t_utf16.c \
172	$(srcdir)/getopt.c \
173	$(srcdir)/getopt_long.c \
174	$(srcdir)/secure_getenv.c \
175	$(srcdir)/regex.cpp
176
177SHLIB_EXPDEPS =
178# Add -lm if dumping thread stats, for sqrt.
179SHLIB_EXPLIBS= $(LIBS) $(DL_LIB)
180
181DEPLIBS=
182
183#
184all-unix: all-liblinks
185
186install-unix: install-libs
187
188clean-unix:: clean-liblinks clean-libs clean-libobjs
189
190##DOS##!if 0
191$(BUILDTOP)/include/autoconf.h: $(top_srcdir)/include/autoconf.h.in
192	(cd $(BUILDTOP)/include; $(MAKE) autoconf.h)
193##DOS##!endif
194
195t_mktime: gmt_mktime.c
196	$(CC) $(ALL_CFLAGS) -DTEST_LEAP -o t_mktime $(srcdir)/gmt_mktime.c
197
198SHLIB_EXPORT_FILE=libkrb5support.exports
199##DOS##all-windows: libkrb5support.exports
200
201EXTRA_SUPPORT_SYMS= @EXTRA_SUPPORT_SYMS@
202##DOS##EXTRA_SUPPORT_SYMS= krb5int_mkstemp krb5int_strlcpy krb5int_strlcat \
203##DOS##		k5_getopt k5_getopt_long \
204##DOS##		krb5int_vasprintf krb5int_asprintf krb5int_gettimeofday $(IPC_SYMS) \
205##DOS##		k5_regcomp k5_regexec k5_regerror k5_regfree
206##DOS##DATA_SUPPORT_SYMS= k5_opterr k5_optind k5_optopt k5_optarg
207
208##DOS##!if 0
209libkrb5support.exports: $(srcdir)/libkrb5support-fixed.exports Makefile
210	cat $(srcdir)/libkrb5support-fixed.exports > new-exports
211	for i in $(EXTRA_SUPPORT_SYMS) .; do \
212	  if test "$$i" != .; then echo $$i >> new-exports; else :; fi ; \
213	done
214	$(MV) new-exports libkrb5support.exports
215##DOS##!endif
216##DOS##libkrb5support.exports: libkrb5support-fixed.exports Makefile
217##DOS##	$(CP) libkrb5support-fixed.exports new-exports
218##DOS##	for %%x in ($(EXTRA_SUPPORT_SYMS) .) do if not %%x==. echo %%x >> new-exports
219##DOS##	for %%x in ($(DATA_SUPPORT_SYMS) .) do if not %x==. echo %%x DATA >> new-exports
220##DOS##	$(RM) libkrb5support.exports
221##DOS##	$(MV) new-exports libkrb5support.exports
222
223T_K5BUF_OBJS= t_k5buf.o k5buf.o zap.o $(PRINTF_ST_OBJ)
224
225t_k5buf: $(T_K5BUF_OBJS)
226	$(CC_LINK) -o t_k5buf $(T_K5BUF_OBJS)
227
228t_path: t_path.o path.o $(PRINTF_ST_OBJ)
229	$(CC_LINK) -o $@ t_path.o path.o $(PRINTF_ST_OBJ)
230
231t_path_win: t_path_win.o path_win.o $(PRINTF_ST_OBJ)
232	$(CC_LINK) -o $@ t_path_win.o path_win.o $(PRINTF_ST_OBJ)
233
234t_path_win.o: $(srcdir)/t_path.c
235	$(CC) $(ALL_CFLAGS) -DWINDOWS_PATHS -c $(srcdir)/t_path.c -o $@
236
237path_win.o: $(srcdir)/path.c
238	$(CC) $(ALL_CFLAGS) -DWINDOWS_PATHS -c $(srcdir)/path.c -o $@
239
240t_base64: t_base64.o base64.o
241	$(CC_LINK) -o $@ t_base64.o base64.o
242
243T_JSON_OBJS= t_json.o json.o base64.o k5buf.o zap.o $(PRINTF_ST_OBJ)
244
245t_json: $(T_JSON_OBJS)
246	$(CC_LINK) -o $@ $(T_JSON_OBJS)
247
248t_hex: t_hex.o hex.o
249	$(CC_LINK) -o $@ t_hex.o hex.o
250
251t_hashtab: t_hashtab.o
252	$(CC_LINK) -o $@ t_hashtab.o
253
254t_unal: t_unal.o
255	$(CC_LINK) -o t_unal t_unal.o
256
257t_utf8: t_utf8.o utf8.o
258	$(CC_LINK) -o t_utf8 t_utf8.o utf8.o
259
260T_UTF16_OBJS= t_utf16.o utf8_conv.o utf8.o k5buf.o zap.o $(PRINTF_ST_OBJ)
261
262t_utf16: $(T_UTF16_OBJS)
263	$(CC_LINK) -o $@ $(T_UTF16_OBJS)
264
265TEST_PROGS= t_k5buf t_path t_path_win t_base64 t_json t_hex t_hashtab t_unal \
266	t_utf8 t_utf16
267
268check-unix: $(TEST_PROGS)
269	./t_k5buf
270	./t_path
271	./t_path_win
272	./t_base64
273	./t_json
274	./t_hex
275	./t_hashtab
276	./t_unal
277	./t_utf8
278	./t_utf16
279
280clean:
281	$(RM) t_k5buf.o t_k5buf t_unal.o t_unal path_win.o path_win
282	$(RM) t_path_win.o t_path_win t_path.o t_path t_base64.o t_base64
283	$(RM) t_json.o t_json t_hex.o t_hex t_hashtab.o t_hashtab
284	$(RM) t_utf8.o t_utf8 t_utf16.o t_utf16 libkrb5support.exports
285
286@lib_frag@
287@libobj_frag@
288
289