git: 3078531de10d - main - Fix mergemaster(8) breakage in the 6ad780caa.

From: Maxim Sobolev <sobomax_at_FreeBSD.org>
Date: Tue, 13 Sep 2022 20:44:59 UTC
The branch main has been updated by sobomax:

URL: https://cgit.FreeBSD.org/src/commit/?id=3078531de10dcae44b253a35125c949ff4235284

commit 3078531de10dcae44b253a35125c949ff4235284
Author:     Maxim Sobolev <sobomax@FreeBSD.org>
AuthorDate: 2022-09-13 20:36:22 +0000
Commit:     Maxim Sobolev <sobomax@FreeBSD.org>
CommitDate: 2022-09-13 20:36:22 +0000

    Fix mergemaster(8) breakage in the 6ad780caa.
    
    Split out termcap.small generation into its own Makefile under
    etc/termcap, so it's properly executed by the underlying command:
    
      make 'SUBDIR_OVERRIDE=etc' everything
    
    Reported by:    gbe
    MFC after:      1 month
---
 etc/Makefile                |  1 +
 etc/termcap/Makefile        | 27 +++++++++++++++++++++++++++
 etc/termcap/Makefile.depend | 11 +++++++++++
 share/termcap/Makefile      | 24 +-----------------------
 4 files changed, 40 insertions(+), 23 deletions(-)

diff --git a/etc/Makefile b/etc/Makefile
index c465596de3a0..3036b7acdd19 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -11,6 +11,7 @@ NLS_ALIASES=	POSIX C \
 # No need as it is empty and just causes rebuilds since this file does so much.
 UPDATE_DEPENDFILE=	no
 
+SUBDIR+=termcap
 .if ${MK_SENDMAIL} != "no"
 SUBDIR+=sendmail
 .endif
diff --git a/etc/termcap/Makefile b/etc/termcap/Makefile
new file mode 100644
index 000000000000..85054265b4b2
--- /dev/null
+++ b/etc/termcap/Makefile
@@ -0,0 +1,27 @@
+.PATH: ${SRCTOP}/share/termcap
+
+CLEANFILES+=	termcap.small
+CONFS=		termcap.small
+
+TERMCAP_SMALL_ENTS?=	SC cons25 cons25-m cons25-w cons25l1 cons25l1-m \
+    cons25l1-w cons25l2 cons25l2-m cons25l7 cons25l7-m cons25r cons25r-m \
+    cons25r-mv cons25r-v cons25w cons30 cons30-m cons30-w cons30l1 cons30l1-m \
+    cons30l1-w cons30l2 cons30l2-m cons30l7 cons30l7-m cons30r cons30r-m \
+    cons30r-mv cons30r-v cons43 cons43-m cons43-w cons43l1 cons43l1-m \
+    cons43l1-w cons43l2 cons43l2-m cons43l7 cons43l7-m cons43r cons43r-m \
+    cons43r-mv cons43r-v cons50 cons50-m cons50-w cons50l1 cons50l1-m \
+    cons50l1-w cons50l2 cons50l2-m cons50l7 cons50l7-m cons50r cons50r-m \
+    cons50r-mv cons50r-v cons60 cons60-m cons60-w cons60l1 cons60l1-m \
+    cons60l1-w cons60l2 cons60l2-m cons60l7 cons60l7-m cons60r cons60r-m \
+    cons60r-mv cons60r-v ecma[+]italics vt100 xterm xterm-basic xterm-clear \
+    xterm-color xterm-new xterm-r6 xterm-r6-clear
+
+termcap.small: termcap
+	set -e; set -o pipefail; \
+	(echo "# AUTOMATICALLY GENERATED FROM `basename ${.ALLSRC}`"; \
+	for tcname in ${TERMCAP_SMALL_ENTS}; \
+	do \
+		echo; awk "/^$${tcname}[:|]/{ f = 1; print; next } /^[^\t]/{ f = 0 } f" ${.ALLSRC}; \
+	done) > ${.TARGET}
+
+.include <bsd.prog.mk>
diff --git a/etc/termcap/Makefile.depend b/etc/termcap/Makefile.depend
new file mode 100644
index 000000000000..f80275d86ab1
--- /dev/null
+++ b/etc/termcap/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/termcap/Makefile b/share/termcap/Makefile
index d051e47b5d1b..8e2a82a7b268 100644
--- a/share/termcap/Makefile
+++ b/share/termcap/Makefile
@@ -10,21 +10,7 @@ MAN=	termcap.5
 PACKAGE=	runtime
 FILES=		termcap termcap.db
 FILESDIR=	${BINDIR}/misc
-CLEANFILES+=	termcap.db termcap.small
-CONFS=		termcap.small
-
-TERMCAP_SMALL_ENTS?=	SC cons25 cons25-m cons25-w cons25l1 cons25l1-m \
-    cons25l1-w cons25l2 cons25l2-m cons25l7 cons25l7-m cons25r cons25r-m \
-    cons25r-mv cons25r-v cons25w cons30 cons30-m cons30-w cons30l1 cons30l1-m \
-    cons30l1-w cons30l2 cons30l2-m cons30l7 cons30l7-m cons30r cons30r-m \
-    cons30r-mv cons30r-v cons43 cons43-m cons43-w cons43l1 cons43l1-m \
-    cons43l1-w cons43l2 cons43l2-m cons43l7 cons43l7-m cons43r cons43r-m \
-    cons43r-mv cons43r-v cons50 cons50-m cons50-w cons50l1 cons50l1-m \
-    cons50l1-w cons50l2 cons50l2-m cons50l7 cons50l7-m cons50r cons50r-m \
-    cons50r-mv cons50r-v cons60 cons60-m cons60-w cons60l1 cons60l1-m \
-    cons60l1-w cons60l2 cons60l2-m cons60l7 cons60l7-m cons60r cons60r-m \
-    cons60r-mv cons60r-v ecma[+]italics vt100 xterm xterm-basic xterm-clear \
-    xterm-color xterm-new xterm-r6 xterm-r6-clear
+CLEANFILES+=	termcap.db
 
 .include <bsd.endian.mk>
 .include <src.tools.mk>
@@ -32,14 +18,6 @@ TERMCAP_SMALL_ENTS?=	SC cons25 cons25-m cons25-w cons25l1 cons25l1-m \
 termcap.db: termcap
 	${CAP_MKDB_CMD} ${CAP_MKDB_ENDIAN} -f ${.TARGET:R} ${.ALLSRC}
 
-termcap.small: termcap
-	set -e; set -o pipefail; \
-	(echo "# AUTOMATICALLY GENERATED FROM `basename ${.ALLSRC}`"; \
-	for tcname in ${TERMCAP_SMALL_ENTS}; \
-	do \
-		echo; awk "/^$${tcname}[:|]/{ f = 1; print; next } /^[^\t]/{ f = 0 } f" ${.ALLSRC}; \
-	done) > ${.TARGET}
-
 etc-termcap:
 	${INSTALL_SYMLINK} -T "package=runtime" \
 	    ${BINDIR}/misc/termcap ${DESTDIR}/etc/termcap