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.mk192
1 files changed, 109 insertions, 83 deletions
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index c9d17982f690..ec8f4514ffc2 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -10,11 +10,11 @@ CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \
-DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG
-.if !defined(EARLY_BUILD) && defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no"
+.if ${MK_CLANG_FULL} != "no"
CFLAGS+= -DCLANG_ENABLE_ARCMT \
-DCLANG_ENABLE_REWRITER \
-DCLANG_ENABLE_STATIC_ANALYZER
-.endif # !EARLY_BUILD && MK_CLANG_FULL
+.endif # MK_CLANG_FULL
# LLVM is not strict aliasing safe as of 12/31/2011
CFLAGS+= -fno-strict-aliasing
@@ -56,17 +56,9 @@ CLANG_TBLGEN= ${TOOLSDIR}/usr/bin/clang-tblgen
TBLGEN?= tblgen
CLANG_TBLGEN?= clang-tblgen
-Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td \
- ${LLVM_SRCS}/include/llvm/IR/IntrinsicsARM.td \
- ${LLVM_SRCS}/include/llvm/IR/IntrinsicsHexagon.td \
- ${LLVM_SRCS}/include/llvm/IR/IntrinsicsMips.td \
- ${LLVM_SRCS}/include/llvm/IR/IntrinsicsNVVM.td \
- ${LLVM_SRCS}/include/llvm/IR/IntrinsicsPowerPC.td \
- ${LLVM_SRCS}/include/llvm/IR/IntrinsicsR600.td \
- ${LLVM_SRCS}/include/llvm/IR/IntrinsicsX86.td \
- ${LLVM_SRCS}/include/llvm/IR/IntrinsicsXCore.td
- ${TBLGEN} -I ${LLVM_SRCS}/include \
- -gen-intrinsic -o ${.TARGET} \
+Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
+ ${TBLGEN} -gen-intrinsic \
+ -I ${LLVM_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
.for arch in \
ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86
@@ -85,147 +77,181 @@ Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td \
RegisterInfo/-gen-register-info \
SubtargetInfo/-gen-subtarget
${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
- ${TBLGEN} -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target/${arch:H} \
- ${hdr:T:C/,/ /g} -o ${.TARGET} \
+ ${TBLGEN} ${hdr:T:C/,/ /g} \
+ -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target/${arch:H} \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
. endfor
.endfor
Attrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-classes -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-classes \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrDump.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-dump -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-dump \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrIdentifierArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-identifier-arg-list -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-identifier-arg-list \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-impl -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-impl \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-late-parsed-list -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-late-parsed-list \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-list -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-list \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrParsedAttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-parsed-attr-impl -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-impl \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-parsed-attr-kinds -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-kinds \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-parsed-attr-list -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-list \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-pch-read -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-pch-read \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-pch-write -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-pch-write \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-spelling-list -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-spelling-list \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrSpellingListIndex.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-spelling-index -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-spelling-index \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-template-instantiate -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-template-instantiate \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
AttrTypeArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-attr-type-arg-list -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-attr-type-arg-list \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
CommentCommandInfo.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td
- ${CLANG_TBLGEN} \
- -gen-clang-comment-command-info -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-comment-command-info \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/AST/CommentCommands.td
CommentCommandList.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td
- ${CLANG_TBLGEN} \
- -gen-clang-comment-command-list -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-comment-command-list \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/AST/CommentCommands.td
CommentHTMLNamedCharacterReferences.inc.h: \
${CLANG_SRCS}/include/clang/AST/CommentHTMLNamedCharacterReferences.td
- ${CLANG_TBLGEN} \
- -gen-clang-comment-html-named-character-references -o ${.TARGET} \
- ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-comment-html-named-character-references \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/AST/CommentHTMLNamedCharacterReferences.td
CommentHTMLTags.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
- ${CLANG_TBLGEN} \
- -gen-clang-comment-html-tags -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-comment-html-tags \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
CommentHTMLTagsProperties.inc.h: \
${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
- ${CLANG_TBLGEN} \
- -gen-clang-comment-html-tags-properties -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-comment-html-tags-properties \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
CommentNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td
- ${CLANG_TBLGEN} \
- -gen-clang-comment-nodes -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-comment-nodes \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td
DeclNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td
- ${CLANG_TBLGEN} \
- -gen-clang-decl-nodes -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-decl-nodes \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td
StmtNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td
- ${CLANG_TBLGEN} \
- -gen-clang-stmt-nodes -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-stmt-nodes \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td
arm_neon.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td
- ${CLANG_TBLGEN} \
- -gen-arm-neon -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-arm-neon \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/arm_neon.td
arm_neon.inc.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td
- ${CLANG_TBLGEN} \
- -gen-arm-neon-sema -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-arm-neon-sema \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/arm_neon.td
DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic \
- -gen-clang-diag-groups -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-diag-groups \
+ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \
+ -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
DiagnosticIndexName.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic \
- -gen-clang-diags-index-name -o ${.TARGET} ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-diags-index-name \
+ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \
+ -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
.for hdr in AST Analysis Comment Common Driver Frontend Lex Parse Sema Serialization
Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic \
- -gen-clang-diags-defs -clang-component=${hdr} -o ${.TARGET} \
- ${.ALLSRC}
+ ${CLANG_TBLGEN} -gen-clang-diags-defs -clang-component=${hdr} \
+ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \
+ -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
.endfor
Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td
- ${TBLGEN} -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \
- -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
+ ${TBLGEN} -gen-opt-parser-defs \
+ -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Driver/Options.td
CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
- ${TBLGEN} -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \
- -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
-
-Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td \
- ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
- ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \
- -gen-clang-sa-checkers -o ${.TARGET} \
+ ${TBLGEN} -gen-opt-parser-defs \
+ -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \
+ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
+
+Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
+ ${CLANG_TBLGEN} -gen-clang-sa-checkers \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
+.for dep in ${TGHDRS:C/$/.inc.d/}
+. sinclude "${dep}"
+.endfor
+
SRCS+= ${TGHDRS:C/$/.inc.h/}
DPADD+= ${TGHDRS:C/$/.inc.h/}
-CLEANFILES+= ${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.