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