clang.build.mk revision 266309
1193323Sed# $FreeBSD: stable/10/lib/clang/clang.build.mk 266309 2014-05-17 12:47:11Z dim $
2193323Sed
3193323SedCLANG_SRCS=	${LLVM_SRCS}/tools/clang
4193323Sed
5193323SedCFLAGS+=	-I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \
6193323Sed		-I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \
7193323Sed		-I${LLVM_SRCS}/../../lib/clang/include \
8193323Sed		-DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \
9193323Sed		-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG
10193323Sed
11193323Sed.if !defined(EARLY_BUILD) && defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no"
12193323SedCFLAGS+=	-DCLANG_ENABLE_ARCMT \
13193323Sed		-DCLANG_ENABLE_REWRITER \
14193323Sed		-DCLANG_ENABLE_STATIC_ANALYZER
15193323Sed.endif # !EARLY_BUILD && MK_CLANG_FULL
16193323Sed
17193323Sed# LLVM is not strict aliasing safe as of 12/31/2011
18193323SedCFLAGS+=	-fno-strict-aliasing
19193323Sed
20193323SedTARGET_ARCH?=	${MACHINE_ARCH}
21193323SedBUILD_ARCH?=	${MACHINE_ARCH}
22193323Sed
23193323Sed.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \
24193323Sed    ${MK_ARM_EABI} != "no"
25193323SedTARGET_ABI=	gnueabi
26193323Sed.else
27193323SedTARGET_ABI=	unknown
28193323Sed.endif
29193323Sed
30193323SedTARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.0
31193323SedBUILD_TRIPLE?=	${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0
32193323SedCFLAGS+=	-DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
33193323Sed		-DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \
34193323Sed		-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
35193323SedCXXFLAGS+=	-fno-exceptions -fno-rtti
36193323Sed
37193323Sed.PATH:	${LLVM_SRCS}/${SRCDIR}
38249423Sdim
39249423SdimTBLGEN?=	tblgen
40249423SdimCLANG_TBLGEN?=	clang-tblgen
41249423Sdim
42249423SdimIntrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
43193323Sed	${TBLGEN} -gen-intrinsic \
44249423Sdim	    -I ${LLVM_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
45249423Sdim	    ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
46193323Sed.for arch in \
47193323Sed	ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86
48193323Sed. for hdr in \
49193323Sed	AsmMatcher/-gen-asm-matcher \
50193323Sed	AsmWriter1/-gen-asm-writer,-asmwriternum=1 \
51249423Sdim	AsmWriter/-gen-asm-writer \
52249423Sdim	CallingConv/-gen-callingconv \
53193323Sed	CodeEmitter/-gen-emitter \
54193323Sed	DAGISel/-gen-dag-isel \
55193323Sed	DisassemblerTables/-gen-disassembler \
56193323Sed	FastISel/-gen-fast-isel \
57193323Sed	InstrInfo/-gen-instr-info \
58193323Sed	MCCodeEmitter/-gen-emitter,-mc-emitter \
59193323Sed	MCPseudoLowering/-gen-pseudo-lowering \
60193323Sed	RegisterInfo/-gen-register-info \
61193323Sed	SubtargetInfo/-gen-subtarget
62193323Sed${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
63193323Sed	${TBLGEN} ${hdr:T:C/,/ /g} \
64193323Sed	    -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target/${arch:H} \
65193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
66193323Sed	    ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td
67193323Sed. endfor
68193323Sed.endfor
69193323Sed
70193323SedAttrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
71193323Sed	${CLANG_TBLGEN} -gen-clang-attr-classes \
72193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
73251662Sdim	    ${.ALLSRC}
74193323Sed
75193323SedAttrDump.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
76193323Sed	${CLANG_TBLGEN} -gen-clang-attr-dump \
77193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
78193323Sed	    ${.ALLSRC}
79193323Sed
80251662SdimAttrIdentifierArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
81193323Sed	${CLANG_TBLGEN} -gen-clang-attr-identifier-arg-list \
82193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
83193323Sed	    ${.ALLSRC}
84193323Sed
85193323SedAttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
86193323Sed	${CLANG_TBLGEN} -gen-clang-attr-impl \
87193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
88193323Sed	    ${.ALLSRC}
89193323Sed
90193323SedAttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
91193323Sed	${CLANG_TBLGEN} -gen-clang-attr-late-parsed-list \
92193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
93193323Sed	    ${.ALLSRC}
94193323Sed
95234353SdimAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
96193323Sed	${CLANG_TBLGEN} -gen-clang-attr-list \
97193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
98193323Sed	    ${.ALLSRC}
99193323Sed
100193323SedAttrParsedAttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
101193323Sed	${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-impl \
102193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
103193323Sed	    ${.ALLSRC}
104193323Sed
105193323SedAttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
106193323Sed	${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-kinds \
107193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
108193323Sed	    ${.ALLSRC}
109193323Sed
110193323SedAttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
111193323Sed	${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-list \
112193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
113193323Sed	    ${.ALLSRC}
114193323Sed
115193323SedAttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
116193323Sed	${CLANG_TBLGEN} -gen-clang-attr-pch-read \
117193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
118193323Sed	    ${.ALLSRC}
119193323Sed
120193323SedAttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
121193323Sed	${CLANG_TBLGEN} -gen-clang-attr-pch-write \
122193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
123193323Sed	    ${.ALLSRC}
124193323Sed
125193323SedAttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
126193323Sed	${CLANG_TBLGEN} -gen-clang-attr-spelling-list \
127234353Sdim	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
128193323Sed	    ${.ALLSRC}
129193323Sed
130193323SedAttrSpellingListIndex.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
131193323Sed	${CLANG_TBLGEN} -gen-clang-attr-spelling-index \
132193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
133193323Sed	    ${.ALLSRC}
134193323Sed
135193323SedAttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
136193323Sed	${CLANG_TBLGEN} -gen-clang-attr-template-instantiate \
137193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
138193323Sed	    ${.ALLSRC}
139193323Sed
140193323SedAttrTypeArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
141193323Sed	${CLANG_TBLGEN} -gen-clang-attr-type-arg-list \
142193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
143193323Sed	    ${.ALLSRC}
144193323Sed
145193323SedCommentCommandInfo.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td
146193323Sed	${CLANG_TBLGEN} -gen-clang-comment-command-info \
147193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
148193323Sed
149193323SedCommentCommandList.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td
150193323Sed	${CLANG_TBLGEN} -gen-clang-comment-command-list \
151193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
152193323Sed
153193323SedCommentHTMLNamedCharacterReferences.inc.h: \
154193323Sed	${CLANG_SRCS}/include/clang/AST/CommentHTMLNamedCharacterReferences.td
155193323Sed	${CLANG_TBLGEN} -gen-clang-comment-html-named-character-references \
156193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
157193323Sed
158193323SedCommentHTMLTags.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
159193323Sed	${CLANG_TBLGEN} -gen-clang-comment-html-tags \
160193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
161243830Sdim
162193323SedCommentHTMLTagsProperties.inc.h: \
163193323Sed	${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td
164193323Sed	${CLANG_TBLGEN} -gen-clang-comment-html-tags-properties \
165193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
166193323Sed
167193323SedCommentNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td
168193323Sed	${CLANG_TBLGEN} -gen-clang-comment-nodes \
169193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
170193323Sed
171193323SedDeclNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td
172193323Sed	${CLANG_TBLGEN} -gen-clang-decl-nodes \
173193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
174193323Sed
175193323SedStmtNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td
176193323Sed	${CLANG_TBLGEN} -gen-clang-stmt-nodes \
177193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
178193323Sed
179193323Sedarm_neon.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td
180193323Sed	${CLANG_TBLGEN} -gen-arm-neon \
181193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
182193323Sed
183193323Sedarm_neon.inc.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td
184193323Sed	${CLANG_TBLGEN} -gen-arm-neon-sema \
185193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
186193323Sed
187193323SedDiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
188202375Srdivacky	${CLANG_TBLGEN} -gen-clang-diag-groups \
189243830Sdim	    -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \
190193323Sed	    -o ${.TARGET} ${.ALLSRC}
191193323Sed
192193323SedDiagnosticIndexName.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
193193323Sed	${CLANG_TBLGEN} -gen-clang-diags-index-name \
194193323Sed	    -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \
195193323Sed	    -o ${.TARGET} ${.ALLSRC}
196193323Sed
197193323Sed.for hdr in AST Analysis Comment Common Driver Frontend Lex Parse Sema Serialization
198193323SedDiagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td
199193323Sed	${CLANG_TBLGEN} -gen-clang-diags-defs -clang-component=${hdr} \
200193323Sed	    -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \
201193323Sed	    -o ${.TARGET} ${.ALLSRC}
202193323Sed.endfor
203193323Sed
204193323SedOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td
205193323Sed	${TBLGEN} -gen-opt-parser-defs \
206193323Sed	    -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \
207193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
208193323Sed
209193323SedCC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
210193323Sed	${TBLGEN} -gen-opt-parser-defs \
211193323Sed	    -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \
212193323Sed	    -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC}
213193323Sed
214193323SedCheckers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td \
215193323Sed	    ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/CheckerBase.td
216193323Sed	${CLANG_TBLGEN} -gen-clang-sa-checkers \
217193323Sed	    -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
218193323Sed	    ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
219193323Sed
220193323Sed.for dep in ${TGHDRS:C/$/.inc.d/}
221193323Sed. sinclude "${dep}"
222193323Sed.endfor
223193323Sed
224193323SedSRCS+=		${TGHDRS:C/$/.inc.h/}
225193323SedDPADD+=		${TGHDRS:C/$/.inc.h/}
226193323SedCLEANFILES+=	${TGHDRS:C/$/.inc.h/} ${TGHDRS:C/$/.inc.d/}
227193323Sed