2010-06-09 19:32:20 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2012-08-23 17:08:07 +00:00
|
|
|
CLANG_SRCS= ${LLVM_SRCS}/tools/clang
|
2010-06-09 19:32:20 +00:00
|
|
|
|
2012-08-23 17:08:07 +00:00
|
|
|
CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \
|
|
|
|
-I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \
|
|
|
|
-I${LLVM_SRCS}/../../lib/clang/include \
|
|
|
|
-DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \
|
|
|
|
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG
|
2010-06-09 19:32:20 +00:00
|
|
|
|
2012-01-01 15:56:15 +00:00
|
|
|
# LLVM is not strict aliasing safe as of 12/31/2011
|
2012-08-23 17:08:07 +00:00
|
|
|
CFLAGS+= -fno-strict-aliasing
|
2010-06-14 06:23:47 +00:00
|
|
|
|
2010-06-09 19:32:20 +00:00
|
|
|
TARGET_ARCH?= ${MACHINE_ARCH}
|
2012-08-20 18:33:03 +00:00
|
|
|
BUILD_ARCH?= ${MACHINE_ARCH}
|
|
|
|
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0
|
|
|
|
BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0
|
|
|
|
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
|
2012-12-03 19:24:08 +00:00
|
|
|
-DLLVM_HOSTTRIPLE=\"${BUILD_TRIPLE}\" \
|
|
|
|
-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
|
|
|
|
CXXFLAGS+= -fno-exceptions -fno-rtti
|
2010-08-21 15:46:33 +00:00
|
|
|
|
2010-06-09 19:32:20 +00:00
|
|
|
.PATH: ${LLVM_SRCS}/${SRCDIR}
|
|
|
|
|
2012-08-23 17:08:07 +00:00
|
|
|
TBLGEN?= tblgen
|
|
|
|
CLANG_TBLGEN?= clang-tblgen
|
|
|
|
TBLINC+= -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target
|
2010-06-09 19:32:20 +00:00
|
|
|
|
|
|
|
Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/Intrinsics.td
|
2011-07-17 19:51:40 +00:00
|
|
|
${TBLGEN} -I ${LLVM_SRCS}/lib/VMCore ${TBLINC} -gen-intrinsic \
|
|
|
|
-o ${.TARGET} ${LLVM_SRCS}/include/llvm/Intrinsics.td
|
2010-06-09 19:32:20 +00:00
|
|
|
.for arch in \
|
|
|
|
ARM/ARM Mips/Mips PowerPC/PPC X86/X86
|
|
|
|
. for hdr in \
|
|
|
|
AsmMatcher/-gen-asm-matcher \
|
|
|
|
AsmWriter1/-gen-asm-writer,-asmwriternum=1 \
|
|
|
|
AsmWriter/-gen-asm-writer \
|
|
|
|
CallingConv/-gen-callingconv \
|
|
|
|
CodeEmitter/-gen-emitter \
|
|
|
|
DAGISel/-gen-dag-isel \
|
2010-09-20 16:43:17 +00:00
|
|
|
DisassemblerTables/-gen-disassembler \
|
|
|
|
EDInfo/-gen-enhanced-disassembly-info \
|
2010-06-09 19:32:20 +00:00
|
|
|
FastISel/-gen-fast-isel \
|
2011-07-17 19:51:40 +00:00
|
|
|
InstrInfo/-gen-instr-info \
|
2011-02-20 19:33:47 +00:00
|
|
|
MCCodeEmitter/-gen-emitter,-mc-emitter \
|
2011-07-17 19:51:40 +00:00
|
|
|
MCPseudoLowering/-gen-pseudo-lowering \
|
|
|
|
RegisterInfo/-gen-register-info \
|
|
|
|
SubtargetInfo/-gen-subtarget
|
2010-06-09 19:32:20 +00:00
|
|
|
${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
|
2011-07-17 19:51:40 +00:00
|
|
|
${TBLGEN} -I ${LLVM_SRCS}/lib/Target/${arch:H} ${TBLINC} \
|
|
|
|
${hdr:T:C/,/ /g} -o ${.TARGET} \
|
|
|
|
${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
|
2010-06-09 19:32:20 +00:00
|
|
|
. endfor
|
|
|
|
.endfor
|
|
|
|
|
2010-07-20 17:16:57 +00:00
|
|
|
Attrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-clang-attr-classes -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
2010-07-20 17:16:57 +00:00
|
|
|
|
2010-09-20 16:43:17 +00:00
|
|
|
AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-clang-attr-impl -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
2010-09-20 16:43:17 +00:00
|
|
|
|
2011-10-22 14:08:43 +00:00
|
|
|
AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
|
|
|
|
-gen-clang-attr-late-parsed-list -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
|
|
|
|
2010-07-20 17:16:57 +00:00
|
|
|
AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-clang-attr-list -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
2010-07-20 17:16:57 +00:00
|
|
|
|
2012-04-16 21:23:25 +00:00
|
|
|
AttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
|
|
|
|
-gen-clang-attr-parsed-attr-kinds -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
|
|
|
|
|
|
|
AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
|
|
|
|
-gen-clang-attr-parsed-attr-list -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
|
|
|
|
2010-09-20 16:43:17 +00:00
|
|
|
AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Serialization \
|
2011-07-17 19:51:40 +00:00
|
|
|
${TBLINC} -gen-clang-attr-pch-read -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
2010-09-20 16:43:17 +00:00
|
|
|
|
|
|
|
AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Serialization \
|
2011-07-17 19:51:40 +00:00
|
|
|
${TBLINC} -gen-clang-attr-pch-write -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
2011-02-20 19:33:47 +00:00
|
|
|
|
|
|
|
AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Lex ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-clang-attr-spelling-list -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
2010-09-20 16:43:17 +00:00
|
|
|
|
2012-04-16 21:23:25 +00:00
|
|
|
AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
|
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
|
|
|
|
-gen-clang-attr-template-instantiate -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include ${.ALLSRC}
|
|
|
|
|
2012-12-03 19:24:08 +00:00
|
|
|
CommentCommandInfo.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td
|
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
|
|
|
|
-gen-clang-comment-command-info -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
|
|
|
CommentHTMLTags.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
|
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
|
|
|
|
-gen-clang-comment-html-tags -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
|
|
|
CommentHTMLTagsProperties.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
|
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
|
|
|
|
-gen-clang-comment-html-tags-properties -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
2012-08-20 18:33:03 +00:00
|
|
|
CommentNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td
|
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
|
|
|
|
-gen-clang-comment-nodes -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
2010-07-20 17:16:57 +00:00
|
|
|
DeclNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-clang-decl-nodes -o ${.TARGET} ${.ALLSRC}
|
2010-07-20 17:16:57 +00:00
|
|
|
|
|
|
|
StmtNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-clang-stmt-nodes -o ${.TARGET} ${.ALLSRC}
|
2010-07-20 17:16:57 +00:00
|
|
|
|
|
|
|
arm_neon.inc.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-arm-neon-sema -o ${.TARGET} ${.ALLSRC}
|
2010-07-20 17:16:57 +00:00
|
|
|
|
2010-06-09 19:32:20 +00:00
|
|
|
DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-clang-diag-groups -o ${.TARGET} ${.ALLSRC}
|
2011-05-02 21:04:37 +00:00
|
|
|
|
|
|
|
DiagnosticIndexName.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-clang-diags-index-name -o ${.TARGET} ${.ALLSRC}
|
2011-05-02 21:04:37 +00:00
|
|
|
|
2012-08-20 18:33:03 +00:00
|
|
|
.for hdr in AST Analysis Comment Common Driver Frontend Lex Parse Sema Serialization
|
2010-06-09 19:32:20 +00:00
|
|
|
Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-clang-diags-defs -clang-component=${hdr} \
|
|
|
|
-o ${.TARGET} ${.ALLSRC}
|
2010-06-09 19:32:20 +00:00
|
|
|
.endfor
|
2011-05-02 21:04:37 +00:00
|
|
|
|
2010-07-20 17:16:57 +00:00
|
|
|
Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Driver ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
|
2010-07-20 17:16:57 +00:00
|
|
|
|
|
|
|
CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Driver ${TBLINC} \
|
2011-07-17 19:51:40 +00:00
|
|
|
-gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
|
2011-02-20 19:33:47 +00:00
|
|
|
|
|
|
|
Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td \
|
|
|
|
${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
|
2011-10-22 14:08:43 +00:00
|
|
|
${CLANG_TBLGEN} -I ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers \
|
2011-07-17 19:51:40 +00:00
|
|
|
${TBLINC} -gen-clang-sa-checkers -o ${.TARGET} \
|
|
|
|
-I ${CLANG_SRCS}/include \
|
|
|
|
${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
|
2010-06-09 19:32:20 +00:00
|
|
|
|
|
|
|
SRCS+= ${TGHDRS:C/$/.inc.h/}
|
|
|
|
DPADD+= ${TGHDRS:C/$/.inc.h/}
|
|
|
|
CLEANFILES+= ${TGHDRS:C/$/.inc.h/}
|