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 CFLAGS+=-DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0\"
17 .ifndef LLVM_REQUIRES_EH
18 CXXFLAGS+=-fno-exceptions
20 # If the library or program requires EH, it also requires RTTI.
24 .ifndef LLVM_REQUIRES_RTTI
28 CFLAGS+=-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
30 .PATH: ${LLVM_SRCS}/${SRCDIR}
33 CLANG_TBLGEN?=clang-tblgen
34 TBLINC+=-I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target
36 Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/Intrinsics.td
37 ${TBLGEN} -I ${LLVM_SRCS}/lib/VMCore ${TBLINC} -gen-intrinsic \
38 -o ${.TARGET} ${LLVM_SRCS}/include/llvm/Intrinsics.td
40 ARM/ARM Mips/Mips PowerPC/PPC X86/X86
42 AsmMatcher/-gen-asm-matcher \
43 AsmWriter1/-gen-asm-writer,-asmwriternum=1 \
44 AsmWriter/-gen-asm-writer \
45 CallingConv/-gen-callingconv \
46 CodeEmitter/-gen-emitter \
47 DAGISel/-gen-dag-isel \
48 DisassemblerTables/-gen-disassembler \
49 EDInfo/-gen-enhanced-disassembly-info \
50 FastISel/-gen-fast-isel \
51 InstrInfo/-gen-instr-info \
52 MCCodeEmitter/-gen-emitter,-mc-emitter \
53 MCPseudoLowering/-gen-pseudo-lowering \
54 RegisterInfo/-gen-register-info \
55 SubtargetInfo/-gen-subtarget
56 ${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
57 ${TBLGEN} -I ${LLVM_SRCS}/lib/Target/${arch:H} ${TBLINC} \
58 ${hdr:T:C/,/ /g} -o ${.TARGET} \
59 ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
63 Attrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
64 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
65 -gen-clang-attr-classes -o ${.TARGET} \
66 -I ${CLANG_SRCS}/include ${.ALLSRC}
68 AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
69 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
70 -gen-clang-attr-impl -o ${.TARGET} \
71 -I ${CLANG_SRCS}/include ${.ALLSRC}
73 AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
74 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
75 -gen-clang-attr-late-parsed-list -o ${.TARGET} \
76 -I ${CLANG_SRCS}/include ${.ALLSRC}
78 AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
79 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
80 -gen-clang-attr-list -o ${.TARGET} \
81 -I ${CLANG_SRCS}/include ${.ALLSRC}
83 AttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
84 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
85 -gen-clang-attr-parsed-attr-kinds -o ${.TARGET} \
86 -I ${CLANG_SRCS}/include ${.ALLSRC}
88 AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
89 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
90 -gen-clang-attr-parsed-attr-list -o ${.TARGET} \
91 -I ${CLANG_SRCS}/include ${.ALLSRC}
93 AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
94 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Serialization \
95 ${TBLINC} -gen-clang-attr-pch-read -o ${.TARGET} \
96 -I ${CLANG_SRCS}/include ${.ALLSRC}
98 AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
99 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Serialization \
100 ${TBLINC} -gen-clang-attr-pch-write -o ${.TARGET} \
101 -I ${CLANG_SRCS}/include ${.ALLSRC}
103 AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
104 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Lex ${TBLINC} \
105 -gen-clang-attr-spelling-list -o ${.TARGET} \
106 -I ${CLANG_SRCS}/include ${.ALLSRC}
108 AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
109 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
110 -gen-clang-attr-template-instantiate -o ${.TARGET} \
111 -I ${CLANG_SRCS}/include ${.ALLSRC}
113 DeclNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td
114 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
115 -gen-clang-decl-nodes -o ${.TARGET} ${.ALLSRC}
117 StmtNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td
118 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/AST ${TBLINC} \
119 -gen-clang-stmt-nodes -o ${.TARGET} ${.ALLSRC}
121 arm_neon.inc.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td
122 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
123 -gen-arm-neon-sema -o ${.TARGET} ${.ALLSRC}
125 DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
126 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
127 -gen-clang-diag-groups -o ${.TARGET} ${.ALLSRC}
129 DiagnosticIndexName.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
130 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
131 -gen-clang-diags-index-name -o ${.TARGET} ${.ALLSRC}
133 .for hdr in AST Analysis Common Driver Frontend Lex Parse Sema Serialization
134 Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
135 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic ${TBLINC} \
136 -gen-clang-diags-defs -clang-component=${hdr} \
137 -o ${.TARGET} ${.ALLSRC}
140 Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td
141 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Driver ${TBLINC} \
142 -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
144 CC1Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1Options.td
145 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Driver ${TBLINC} \
146 -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
148 CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
149 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Driver ${TBLINC} \
150 -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
152 Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td \
153 ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
154 ${CLANG_TBLGEN} -I ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers \
155 ${TBLINC} -gen-clang-sa-checkers -o ${.TARGET} \
156 -I ${CLANG_SRCS}/include \
157 ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
159 SRCS+= ${TGHDRS:C/$/.inc.h/}
160 DPADD+= ${TGHDRS:C/$/.inc.h/}
161 CLEANFILES+= ${TGHDRS:C/$/.inc.h/}