xref: /freebsd/krb5/include/krb5_private/Makefile (revision ee3960cba1068e12fb032a68c46d74841d9edab3)
1#
2# SPDX-License-Idendifier: 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 "../Makefile.inc"
11
12# This is a bit of a hack but the reason we have to do this is
13# ${KRB5_DIR}/include/krb5/krb5.h is installed in /usr/include
14# while ${KRB5_DIR}/include/krb5/krb5.hin (generates to krb5.h)
15# installs to /usr/include/krb5/krb5.h. The conflicting files
16# makes it impossible to generate krb5.h when it already exists.
17# The MIT Makefile creates a krb5.h.new file, comparing it and
18# replacing it if different. Then regenerating the original source
19# to install it. Look at the MIT Makefile yourself to fully understand.
20
21.PATH:	${KRB5_DIR}/include/krb5 \
22	${KRB5_DIR}/lib/gssapi/krb5 \
23	${KRB5_DIR}/lib/gssapi/generic \
24	${KRB5_DIR}/include
25
26INCSDIR=	${INCLUDEDIR}/krb5
27INCS=	krb5.h ${GGENI} ${K5GENI}
28
29.include "${KRB5_SRCTOP}/lib/krb5/error_tables/Makefile.inc"
30PFX=	include
31.include "${KRB5_SRCTOP}/lib/gssapi/krb5/Makefile.et"
32.include "${KRB5_SRCTOP}/lib/gssapi/generic/Makefile.et"
33
34CLEANFILES+=	krb5.h
35
36krb5.h:	krb5.hin ${GENI_ET}
37	@echo "/* This file is generated, please don't edit it directly.  */" > ${.TARGET}
38	@echo "#ifndef KRB5_KRB5_H_INCLUDED" >> ${.TARGET}
39	@echo "#define KRB5_KRB5_H_INCLUDED" >> ${.TARGET}
40	@cat ${.ALLSRC} >> ${.TARGET}
41	@echo "#endif /* KRB5_KRB5_H_INCLUDED */" >> ${.TARGET}
42
43.include <bsd.prog.mk>
44