xref: /freebsd/krb5/util/ss/Makefile (revision 929f5966a9fd3d050c7b604513c6fb4ac9b5d335)
1#
2# SPDX-License-Identifier: BSD-2-Clause
3#
4# Copyright (c) 2025 FreeBSD Foundation
5#
6# This sofware was developed by Cy Schubert <cy@FreeBSD.org>
7# under sponsorship from the FreeBSD Foundation.
8#
9
10.include <src.opts.mk>
11
12.include "../Makefile.inc"
13# .include "${KRB5_SRCTOP}/Makefile.et"
14
15LIB=		krb5ss
16INTERNALLIB=
17
18.PATH:	${KRB5_DIR}/util/ss
19
20SRCS=	data.c \
21	error.c \
22	execute_cmd.c \
23	help.c \
24	invocation.c \
25	list_rqs.c \
26	listen.c \
27	pager.c \
28	parse.c \
29	prompt.c \
30	request_tbl.c \
31	requests.c \
32	copyright.h \
33	mit-sipb-copyright.h \
34	ss.h \
35	ss_internal.h \
36	${GEN}
37
38SCRIPTS=${GEN_SCRIPTS}
39
40CFLAGS+=-I${KRB5_DIR}/util/ss \
41	-I${KRB5_DIR}/util/et \
42	-I${KRB5_DIR}/util \
43	-I${KRB5_SRCTOP}/include \
44	-I${KRB5_DIR}/include \
45	-I${.OBJDIR:H} \
46	-I${.OBJDIR}
47
48.if !defined(BOOTSTRAPPING)
49CFLAGS+= -DHAVE_READLINE=1 \
50	 -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
51.endif
52
53GEN=	std_rqs.c ${GEN_SS_ERR_C} ${GEN_SS_ERR_H}
54GEN_SCRIPTS=	ct_c.awk ct_c.sed mk_cmds
55GEN_SS_ERR_C=	${GEN_SS_ERR:S/.et$/.c/}
56GEN_SS_ERR_H=	${GEN_SS_ERR:S/.et$/.h/}
57CLEANFILES=	${GEN} ${GEN_SCRIPTS}
58
59mk_cmds: config_script mk_cmds.sh ct_c.awk ct_c.sed
60	sh ${KRB5_DIR}/util/ss/config_script ${KRB5_DIR}/util/ss/mk_cmds.sh \
61		${.OBJDIR} awk sed > ${.TARGET}
62	chmod 755 ${.TARGET}
63
64ct_c.awk: ct_c_awk.in
65	rm -f ${.TARGET}
66	cp ${.ALLSRC} ${.TARGET}
67
68ct_c.sed: ct_c_sed.in
69	sed -e '/^#/d' ${.ALLSRC} > ${.TARGET}
70
71GEN_SS_ERR=	ss_err.et
72${GEN_SS_ERR:[2..-1]}: .NOMETA
73${GEN_SS_ERR_H}: ${GEN_SS_ERR}
74	rm -f et-h-${.PREFIX}.et et-h-${.PREFIX}.c et-h-${.PREFIX}.h
75	cp ${.ALLSRC} et-h-${.PREFIX}.et
76	${COMPILE_ET} et-h-${.PREFIX}.et
77	mv et-h-${.PREFIX}.h ${.PREFIX}.h
78	rm -f et-h-${.PREFIX}.et et-h-${.PREFIX}.h
79
80${GEN_SS_ERR_C}: ${GEN_SS_ERR}
81	rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c et-c-${.PREFIX}.h
82	cp ${.ALLSRC} et-c-${.PREFIX}.et
83	${COMPILE_ET} et-c-${.PREFIX}.et
84	mv et-c-${.PREFIX}.c ${.PREFIX}.c
85	rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c
86
87std_rqs.c: mk_cmds std_rqs.ct ss_err.h
88	./mk_cmds ${KRB5_DIR}/util/ss/std_rqs.ct
89
90.include <bsd.lib.mk>
91
92.SUFFIXES: .h .c .ct .et .awk .sed
93