3 CLANG_SRCS= ${LLVM_SRCS}/tools/clang
5 CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \
6 -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \
7 -I${LLVM_SRCS}/../../lib/clang/include \
8 -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \
9 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG
11 # LLVM is not strict aliasing safe as of 12/31/2011
12 CFLAGS+= -fno-strict-aliasing
14 TARGET_ARCH?= ${MACHINE_ARCH}
15 BUILD_ARCH?= ${MACHINE_ARCH}
16 TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0
17 BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0
18 CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
19 -DLLVM_HOSTTRIPLE=\"${BUILD_TRIPLE}\" \
20 -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
21 CXXFLAGS+= -fno-exceptions -fno-rtti
23 .PATH: ${LLVM_SRCS}/${SRCDIR}
26 CLANG_TBLGEN?= clang-tblgen
27 TBLINC+= -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target
29 Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/Intrinsics.td
30 ${TBLGEN} -I ${LLVM_SRCS}/lib/VMCore ${TBLINC} -gen-intrinsic \
31 -o ${.TARGET} ${LLVM_SRCS}/include/llvm/Intrinsics.td
33 ARM/ARM Mips/Mips PowerPC/PPC X86/X86
35 AsmMatcher/-gen-asm-matcher \
36 AsmWriter1/-gen-asm-writer,-asmwriternum=1 \
37 AsmWriter/-gen-asm-writer \
38 CallingConv/-gen-callingconv \
39 CodeEmitter/-gen-emitter \
40 DAGISel/-gen-dag-isel \
41 DisassemblerTables/-gen-disassembler \
42 EDInfo/-gen-enhanced-disassembly-info \
43 FastISel/-gen-fast-isel \
44 InstrInfo/-gen-instr-info \
45 MCCodeEmitter/-gen-emitter,-mc-emitter \
46 MCPseudoLowering/-gen-pseudo-lowering \
47 RegisterInfo/-gen-register-info \
48 SubtargetInfo/-gen-subtarget
49 ${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
50 ${TBLGEN} -I ${LLVM_SRCS}/lib/Target/${arch:H} ${TBLINC} \
51 ${hdr:T:C/,/ /g} -o ${.TARGET} \
52 ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
56 Attrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
57 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
58 -gen-clang-attr-classes -o ${.TARGET} \
59 -I ${CLANG_SRCS}/include ${.ALLSRC}
61 AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
62 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
63 -gen-clang-attr-impl -o ${.TARGET} \
64 -I ${CLANG_SRCS}/include ${.ALLSRC}
66 AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
67 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
68 -gen-clang-attr-late-parsed-list -o ${.TARGET} \
69 -I ${CLANG_SRCS}/include ${.ALLSRC}
71 AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
72 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
73 -gen-clang-attr-list -o ${.TARGET} \
74 -I ${CLANG_SRCS}/include ${.ALLSRC}
76 AttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
77 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
78 -gen-clang-attr-parsed-attr-kinds -o ${.TARGET} \
79 -I ${CLANG_SRCS}/include ${.ALLSRC}
81 AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
82 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
83 -gen-clang-attr-parsed-attr-list -o ${.TARGET} \
84 -I ${CLANG_SRCS}/include ${.ALLSRC}
86 AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
87 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Serialization \
88 ${TBLINC} -gen-clang-attr-pch-read -o ${.TARGET} \
89 -I ${CLANG_SRCS}/include ${.ALLSRC}
91 AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
92 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Serialization \
93 ${TBLINC} -gen-clang-attr-pch-write -o ${.TARGET} \
94 -I ${CLANG_SRCS}/include ${.ALLSRC}
96 AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
97 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Lex ${TBLINC} \
98 -gen-clang-attr-spelling-list -o ${.TARGET} \
99 -I ${CLANG_SRCS}/include ${.ALLSRC}
101 AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
102 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
103 -gen-clang-attr-template-instantiate -o ${.TARGET} \
104 -I ${CLANG_SRCS}/include ${.ALLSRC}
106 CommentCommandInfo.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td
107 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
108 -gen-clang-comment-command-info -o ${.TARGET} ${.ALLSRC}
110 CommentHTMLTags.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
111 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
112 -gen-clang-comment-html-tags -o ${.TARGET} ${.ALLSRC}
114 CommentHTMLTagsProperties.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
115 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
116 -gen-clang-comment-html-tags-properties -o ${.TARGET} ${.ALLSRC}
118 CommentNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td
119 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
120 -gen-clang-comment-nodes -o ${.TARGET} ${.ALLSRC}
122 DeclNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td
123 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
124 -gen-clang-decl-nodes -o ${.TARGET} ${.ALLSRC}
126 StmtNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td
127 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
128 -gen-clang-stmt-nodes -o ${.TARGET} ${.ALLSRC}
130 arm_neon.inc.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td
131 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
132 -gen-arm-neon-sema -o ${.TARGET} ${.ALLSRC}
134 DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
135 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
136 -gen-clang-diag-groups -o ${.TARGET} ${.ALLSRC}
138 DiagnosticIndexName.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
139 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
140 -gen-clang-diags-index-name -o ${.TARGET} ${.ALLSRC}
142 .for hdr in AST Analysis Comment Common Driver Frontend Lex Parse Sema Serialization
143 Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
144 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
145 -gen-clang-diags-defs -clang-component=${hdr} \
146 -o ${.TARGET} ${.ALLSRC}
149 Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td
150 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Driver ${TBLINC} \
151 -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
153 CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
154 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Driver ${TBLINC} \
155 -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
157 Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td \
158 ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
159 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers \
160 ${TBLINC} -gen-clang-sa-checkers -o ${.TARGET} \
161 -I ${CLANG_SRCS}/include \
162 ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
164 SRCS+= ${TGHDRS:C/$/.inc.h/}
165 DPADD+= ${TGHDRS:C/$/.inc.h/}
166 CLEANFILES+= ${TGHDRS:C/$/.inc.h/}