aboutsummaryrefslogtreecommitdiff
path: root/lib/clang/clang.build.mk
diff options
context:
space:
mode:
Diffstat (limited to 'lib/clang/clang.build.mk')
-rw-r--r--lib/clang/clang.build.mk22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index a3fae12d999e..5cb0dd0a07ab 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -39,6 +39,24 @@ CXXFLAGS.clang+= -stdlib=libc++
.PATH: ${LLVM_SRCS}/${SRCDIR}
+.if empty(TOOLSDIR) || !exists(${TOOLSDIR}/usr/bin/clang-tblgen)
+.if ${MACHINE} == "host" && defined(BOOTSTRAPPING_TOOLS)
+.if !empty(LEGACY_TOOLS) && exists(${LEGACY_TOOLS}/usr/bin/tblgen)
+TOOLSDIR= ${LEGACY_TOOLS}
+.endif
+.endif
+.if ${MK_STAGING} == "yes" && exists(${STAGE_HOST_OBJTOP:Uno}/usr/bin/tblgen)
+TOOLSDIR= ${STAGE_HOST_OBJTOP}
+.endif
+.if exists(${LEGACY_TOOLS:Uno}/usr/bin/tblgen)
+TOOLSDIR= ${LEGACY_TOOLS}
+.endif
+.endif
+TOOLSDIR?=
+.if !empty(TOOLSDIR) && exists(${TOOLSDIR}/usr/bin/clang-tblgen)
+TBLGEN= ${TOOLSDIR}/usr/bin/tblgen
+CLANG_TBLGEN= ${TOOLSDIR}/usr/bin/clang-tblgen
+.endif
TBLGEN?= tblgen
CLANG_TBLGEN?= clang-tblgen
@@ -227,3 +245,7 @@ Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
SRCS+= ${TGHDRS:C/$/.inc.h/}
DPSRCS+= ${TGHDRS:C/$/.inc.h/}
CLEANFILES+= ${TGHDRS:C/$/.inc.h/} ${TGHDRS:C/$/.inc.d/}
+
+# if we are not doing explicit 'make depend', there is
+# nothing to cause these to be generated.
+beforebuild: ${SRCS:M*.inc.h}