xref: /freebsd/crypto/krb5/src/util/support/Makefile.in (revision 4757b351ea9d59d71d4a38b82506d2d16fcd560d)
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
61IPC_ST_OBJ=
62IPC_OBJ=
63##DOS##IPC_ST_OBJ= ipc_stream.o
64##DOS##IPC_OBJ= $(OUTPRE)ipc_stream.$(OBJEXT)
65IPC_SYMS= \
66	krb5int_ipc_stream_data krb5int_ipc_stream_new \
67	krb5int_ipc_stream_write krb5int_ipc_stream_read \
68	krb5int_ipc_stream_read_int32 krb5int_ipc_stream_write_int32 \
69	krb5int_ipc_stream_read_int64 krb5int_ipc_stream_write_int64 \
70	krb5int_ipc_stream_read_uint32 krb5int_ipc_stream_write_uint32 \
71	krb5int_ipc_stream_read_string krb5int_ipc_stream_write_string \
72	krb5int_ipc_stream_release krb5int_ipc_stream_size \
73	krb5int_ipc_stream_free_string
74
75STLIBOBJS= \
76	threads.o \
77	init-addrinfo.o \
78	plugins.o \
79	errors.o \
80	k5buf.o \
81	gmt_mktime.o \
82	fake-addrinfo.o \
83	utf8.o \
84	utf8_conv.o \
85	zap.o \
86	path.o \
87	base64.o \
88	json.o \
89	hex.o \
90	hashtab.o \
91	bcmp.o \
92	strerror_r.o \
93	dir_filenames.o \
94	$(GETTIMEOFDAY_ST_OBJ) \
95	$(IPC_ST_OBJ) \
96	$(STRLCPY_ST_OBJ) \
97	$(FNMATCH_ST_OBJ) \
98	$(PRINTF_ST_OBJ) \
99	$(MKSTEMP_ST_OBJ) \
100	$(GETOPT_ST_OBJ) \
101	$(GETOPT_LONG_ST_OBJ) \
102	$(SECURE_GETENV_OBJ)
103
104LIBOBJS= \
105	$(OUTPRE)threads.$(OBJEXT) \
106	$(OUTPRE)init-addrinfo.$(OBJEXT) \
107	$(OUTPRE)plugins.$(OBJEXT) \
108	$(OUTPRE)errors.$(OBJEXT) \
109	$(OUTPRE)k5buf.$(OBJEXT) \
110	$(OUTPRE)gmt_mktime.$(OBJEXT) \
111	$(OUTPRE)fake-addrinfo.$(OBJEXT) \
112	$(OUTPRE)utf8.$(OBJEXT) \
113	$(OUTPRE)utf8_conv.$(OBJEXT) \
114	$(OUTPRE)zap.$(OBJEXT) \
115	$(OUTPRE)path.$(OBJEXT) \
116	$(OUTPRE)base64.$(OBJEXT) \
117	$(OUTPRE)json.$(OBJEXT) \
118	$(OUTPRE)hex.$(OBJEXT) \
119	$(OUTPRE)hashtab.$(OBJEXT) \
120	$(OUTPRE)bcmp.$(OBJEXT) \
121	$(OUTPRE)strerror_r.$(OBJEXT) \
122	$(OUTPRE)dir_filenames.$(OBJEXT) \
123	$(GETTIMEOFDAY_OBJ) \
124	$(IPC_OBJ) \
125	$(STRLCPY_OBJ) \
126	$(FNMATCH_OBJ) \
127	$(PRINTF_OBJ) \
128	$(MKSTEMP_OBJ) \
129	$(GETOPT_OBJ) \
130	$(GETOPT_LONG_OBJ) \
131	$(SECURE_GETENV_OBJ)
132
133SRCS=\
134	$(srcdir)/threads.c \
135	$(srcdir)/init-addrinfo.c \
136	$(srcdir)/plugins.c \
137	$(srcdir)/errors.c \
138	$(srcdir)/k5buf.c \
139	$(srcdir)/gmt_mktime.c \
140	$(srcdir)/fake-addrinfo.c \
141	$(srcdir)/utf8.c \
142	$(srcdir)/utf8_conv.c \
143	$(srcdir)/gettimeofday.c \
144	$(srcdir)/strlcpy.c \
145	$(srcdir)/fnmatch.c \
146	$(srcdir)/printf.c \
147	$(srcdir)/mkstemp.c \
148	$(srcdir)/t_k5buf.c \
149	$(srcdir)/t_unal.c \
150	$(srcdir)/t_path.c \
151	$(srcdir)/t_json.c \
152	$(srcdir)/t_hex.c \
153	$(srcdir)/t_hashtab.c \
154	$(srcdir)/zap.c \
155	$(srcdir)/path.c \
156	$(srcdir)/base64.c \
157	$(srcdir)/json.c \
158	$(srcdir)/hex.c \
159	$(srcdir)/hashtab.c \
160	$(srcdir)/bcmp.c \
161	$(srcdir)/strerror_r.c \
162	$(srcdir)/dir_filenames.c \
163	$(srcdir)/t_utf8.c \
164	$(srcdir)/t_utf16.c \
165	$(srcdir)/getopt.c \
166	$(srcdir)/getopt_long.c \
167	$(srcdir)/secure_getenv.c
168
169SHLIB_EXPDEPS =
170# Add -lm if dumping thread stats, for sqrt.
171SHLIB_EXPLIBS= $(LIBS) $(DL_LIB)
172
173DEPLIBS=
174
175#
176all-unix: all-liblinks
177
178install-unix: install-libs
179
180clean-unix:: clean-liblinks clean-libs clean-libobjs
181
182##DOS##!if 0
183$(BUILDTOP)/include/autoconf.h: $(top_srcdir)/include/autoconf.h.in
184	(cd $(BUILDTOP)/include; $(MAKE) autoconf.h)
185##DOS##!endif
186
187t_mktime: gmt_mktime.c
188	$(CC) $(ALL_CFLAGS) -DTEST_LEAP -o t_mktime $(srcdir)/gmt_mktime.c
189
190SHLIB_EXPORT_FILE=libkrb5support.exports
191##DOS##all-windows: libkrb5support.exports
192
193EXTRA_SUPPORT_SYMS= @EXTRA_SUPPORT_SYMS@
194##DOS##EXTRA_SUPPORT_SYMS= krb5int_mkstemp krb5int_strlcpy krb5int_strlcat \
195##DOS##		k5_getopt k5_getopt_long \
196##DOS##		krb5int_vasprintf krb5int_asprintf krb5int_gettimeofday $(IPC_SYMS)
197##DOS##DATA_SUPPORT_SYMS= k5_opterr k5_optind k5_optopt k5_optarg
198
199##DOS##!if 0
200libkrb5support.exports: $(srcdir)/libkrb5support-fixed.exports Makefile
201	cat $(srcdir)/libkrb5support-fixed.exports > new-exports
202	for i in $(EXTRA_SUPPORT_SYMS) .; do \
203	  if test "$$i" != .; then echo $$i >> new-exports; else :; fi ; \
204	done
205	$(MV) new-exports libkrb5support.exports
206##DOS##!endif
207##DOS##libkrb5support.exports: libkrb5support-fixed.exports Makefile
208##DOS##	$(CP) libkrb5support-fixed.exports new-exports
209##DOS##	for %%x in ($(EXTRA_SUPPORT_SYMS) .) do if not %%x==. echo %%x >> new-exports
210##DOS##	for %%x in ($(DATA_SUPPORT_SYMS) .) do if not %x==. echo %%x DATA >> new-exports
211##DOS##	$(RM) libkrb5support.exports
212##DOS##	$(MV) new-exports libkrb5support.exports
213
214T_K5BUF_OBJS= t_k5buf.o k5buf.o zap.o $(PRINTF_ST_OBJ)
215
216t_k5buf: $(T_K5BUF_OBJS)
217	$(CC_LINK) -o t_k5buf $(T_K5BUF_OBJS)
218
219t_path: t_path.o path.o $(PRINTF_ST_OBJ)
220	$(CC_LINK) -o $@ t_path.o path.o $(PRINTF_ST_OBJ)
221
222t_path_win: t_path_win.o path_win.o $(PRINTF_ST_OBJ)
223	$(CC_LINK) -o $@ t_path_win.o path_win.o $(PRINTF_ST_OBJ)
224
225t_path_win.o: $(srcdir)/t_path.c
226	$(CC) $(ALL_CFLAGS) -DWINDOWS_PATHS -c $(srcdir)/t_path.c -o $@
227
228path_win.o: $(srcdir)/path.c
229	$(CC) $(ALL_CFLAGS) -DWINDOWS_PATHS -c $(srcdir)/path.c -o $@
230
231t_base64: t_base64.o base64.o
232	$(CC_LINK) -o $@ t_base64.o base64.o
233
234T_JSON_OBJS= t_json.o json.o base64.o k5buf.o zap.o $(PRINTF_ST_OBJ)
235
236t_json: $(T_JSON_OBJS)
237	$(CC_LINK) -o $@ $(T_JSON_OBJS)
238
239t_hex: t_hex.o hex.o
240	$(CC_LINK) -o $@ t_hex.o hex.o
241
242t_hashtab: t_hashtab.o
243	$(CC_LINK) -o $@ t_hashtab.o
244
245t_unal: t_unal.o
246	$(CC_LINK) -o t_unal t_unal.o
247
248t_utf8: t_utf8.o utf8.o
249	$(CC_LINK) -o t_utf8 t_utf8.o utf8.o
250
251T_UTF16_OBJS= t_utf16.o utf8_conv.o utf8.o k5buf.o zap.o $(PRINTF_ST_OBJ)
252
253t_utf16: $(T_UTF16_OBJS)
254	$(CC_LINK) -o $@ $(T_UTF16_OBJS)
255
256TEST_PROGS= t_k5buf t_path t_path_win t_base64 t_json t_hex t_hashtab t_unal \
257	t_utf8 t_utf16
258
259check-unix: $(TEST_PROGS)
260	./t_k5buf
261	./t_path
262	./t_path_win
263	./t_base64
264	./t_json
265	./t_hex
266	./t_hashtab
267	./t_unal
268	./t_utf8
269	./t_utf16
270
271clean:
272	$(RM) t_k5buf.o t_k5buf t_unal.o t_unal path_win.o path_win
273	$(RM) t_path_win.o t_path_win t_path.o t_path t_base64.o t_base64
274	$(RM) t_json.o t_json t_hex.o t_hex t_hashtab.o t_hashtab
275	$(RM) t_utf8.o t_utf8 t_utf16.o t_utf16 libkrb5support.exports
276
277@lib_frag@
278@libobj_frag@
279
280