git: 8a802df1de2d - main - bhyve/gdb: Avoid rebuilding target.xml for install targets

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Thu, 07 Mar 2024 05:58:41 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=8a802df1de2d77fd0a62996bd785ca3f1326887f

commit 8a802df1de2d77fd0a62996bd785ca3f1326887f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-03-07 05:39:07 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-03-07 05:39:07 +0000

    bhyve/gdb: Avoid rebuilding target.xml for install targets
    
    Otherwise it's impossible to install from a read-only objdir.
    
    Fixes:  f81cdf24ba54 ("bhyve: Add support for XML register definitions")
    Reported by:    olivier
---
 usr.sbin/bhyve/gdb/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usr.sbin/bhyve/gdb/Makefile b/usr.sbin/bhyve/gdb/Makefile
index a444b0cc4c69..cc9ba4d224da 100644
--- a/usr.sbin/bhyve/gdb/Makefile
+++ b/usr.sbin/bhyve/gdb/Makefile
@@ -8,6 +8,7 @@ XMLARCH=	i386:x86-64
 FILES+=		amd64.xml
 .endif
 
+.if !make(install*)
 target.xml: .PHONY
 	@echo "<?xml version=\"1.0\"?>" > ${.TARGET}
 	@echo "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">" >> ${.TARGET}
@@ -17,5 +18,6 @@ target.xml: .PHONY
 	@echo "  <xi:include href=\"${file}\"/>" >> ${.TARGET}
 .endfor
 	@echo "</target>" >> ${.TARGET}
+.endif
 
 .include <bsd.prog.mk>