xref: /freebsd/krb5/include/krb5_private/Makefile (revision ee3960cba1068e12fb032a68c46d74841d9edab3)
1*ee3960cbSCy Schubert#
2*ee3960cbSCy Schubert# SPDX-License-Idendifier: BSD-2-Clause
3*ee3960cbSCy Schubert#
4*ee3960cbSCy Schubert# Copyright (c) 2025 FreeBSD Foundation
5*ee3960cbSCy Schubert#
6*ee3960cbSCy Schubert# This sofware was developed by Cy Schubert <cy@FreeBSD.org>
7*ee3960cbSCy Schubert# under sponsorship from the FreeBSD Foundation.
8*ee3960cbSCy Schubert#
9*ee3960cbSCy Schubert
10*ee3960cbSCy Schubert.include "../Makefile.inc"
11*ee3960cbSCy Schubert
12*ee3960cbSCy Schubert# This is a bit of a hack but the reason we have to do this is
13*ee3960cbSCy Schubert# ${KRB5_DIR}/include/krb5/krb5.h is installed in /usr/include
14*ee3960cbSCy Schubert# while ${KRB5_DIR}/include/krb5/krb5.hin (generates to krb5.h)
15*ee3960cbSCy Schubert# installs to /usr/include/krb5/krb5.h. The conflicting files
16*ee3960cbSCy Schubert# makes it impossible to generate krb5.h when it already exists.
17*ee3960cbSCy Schubert# The MIT Makefile creates a krb5.h.new file, comparing it and
18*ee3960cbSCy Schubert# replacing it if different. Then regenerating the original source
19*ee3960cbSCy Schubert# to install it. Look at the MIT Makefile yourself to fully understand.
20*ee3960cbSCy Schubert
21*ee3960cbSCy Schubert.PATH:	${KRB5_DIR}/include/krb5 \
22*ee3960cbSCy Schubert	${KRB5_DIR}/lib/gssapi/krb5 \
23*ee3960cbSCy Schubert	${KRB5_DIR}/lib/gssapi/generic \
24*ee3960cbSCy Schubert	${KRB5_DIR}/include
25*ee3960cbSCy Schubert
26*ee3960cbSCy SchubertINCSDIR=	${INCLUDEDIR}/krb5
27*ee3960cbSCy SchubertINCS=	krb5.h ${GGENI} ${K5GENI}
28*ee3960cbSCy Schubert
29*ee3960cbSCy Schubert.include "${KRB5_SRCTOP}/lib/krb5/error_tables/Makefile.inc"
30*ee3960cbSCy SchubertPFX=	include
31*ee3960cbSCy Schubert.include "${KRB5_SRCTOP}/lib/gssapi/krb5/Makefile.et"
32*ee3960cbSCy Schubert.include "${KRB5_SRCTOP}/lib/gssapi/generic/Makefile.et"
33*ee3960cbSCy Schubert
34*ee3960cbSCy SchubertCLEANFILES+=	krb5.h
35*ee3960cbSCy Schubert
36*ee3960cbSCy Schubertkrb5.h:	krb5.hin ${GENI_ET}
37*ee3960cbSCy Schubert	@echo "/* This file is generated, please don't edit it directly.  */" > ${.TARGET}
38*ee3960cbSCy Schubert	@echo "#ifndef KRB5_KRB5_H_INCLUDED" >> ${.TARGET}
39*ee3960cbSCy Schubert	@echo "#define KRB5_KRB5_H_INCLUDED" >> ${.TARGET}
40*ee3960cbSCy Schubert	@cat ${.ALLSRC} >> ${.TARGET}
41*ee3960cbSCy Schubert	@echo "#endif /* KRB5_KRB5_H_INCLUDED */" >> ${.TARGET}
42*ee3960cbSCy Schubert
43*ee3960cbSCy Schubert.include <bsd.prog.mk>
44