1 # $NetBSD: Makefile,v 1.37 2015/05/29 17:40:41 joerg Exp $
5 .PATH
: ${CLANG_SRCDIR}/lib
/Headers
7 .if
${MACHINE_ARCH} == "i386" ||
${MACHINE_ARCH} == "x86_64"
8 INCS
= __wmmintrin_aes.h \
46 .elif
${MACHINE_ARCH} == "powerpc" ||
${MACHINE_ARCH} == "powerpc64"
48 .elif
${MACHINE_CPU} == "arm"
53 INCSDIR
= /usr
/include/clang-
${CLANG_VERSION
:R
}
55 .PATH
: ${LLVM_SRCDIR}/include/llvm
/IR \
56 ${CLANG_SRCDIR}/include/clang
/AST \
57 ${CLANG_SRCDIR}/include/clang
/Basic \
58 ${CLANG_SRCDIR}/include/clang
/Driver
60 TABLEGEN_SRC
= Intrinsics.td Options.td
62 TABLEGEN_OUTPUT.Intrinsics.td
= \
63 llvm
/IR
/Intrinsics.gen|
-gen-intrinsic
65 CLANG_TABLEGEN_SRC
= Attr.td CommentCommands.td CommentHTMLTags.td \
66 CommentNodes.td CommentHTMLNamedCharacterReferences.td DeclNodes.td \
67 StmtNodes.td Diagnostic.td arm_neon.td
69 CLANG_TABLEGEN_INCLUDES.Attr.td
= -I
${CLANG_SRCDIR}/include
70 CLANG_TABLEGEN_OUTPUT.Attr.td
= \
71 clang
/AST
/Attrs.inc|
-gen-clang-attr-classes \
72 clang
/AST
/AttrDump.inc|
-gen-clang-attr-dump \
73 clang
/AST
/AttrImpl.inc|
-gen-clang-attr-impl \
74 clang
/AST
/AttrVisitor.inc|
-gen-clang-attr-ast-visitor \
75 clang
/Basic
/AttrList.inc|
-gen-clang-attr-list \
76 clang
/Basic
/AttrHasAttributeImpl.inc|
-gen-clang-attr-has-attribute-impl \
77 clang
/Parse
/AttrParserStringSwitches.inc|
-gen-clang-attr-parser-string-switches \
78 clang
/Sema
/AttrParsedAttrImpl.inc|
-gen-clang-attr-parsed-attr-impl \
79 clang
/Sema
/AttrParsedAttrKinds.inc|
-gen-clang-attr-parsed-attr-kinds \
80 clang
/Sema
/AttrParsedAttrList.inc|
-gen-clang-attr-parsed-attr-list \
81 clang
/Sema
/AttrSpellingListIndex.inc|
-gen-clang-attr-spelling-index \
82 clang
/Sema
/AttrTemplateInstantiate.inc|
-gen-clang-attr-template-instantiate \
83 clang
/Serialization
/AttrPCHRead.inc|
-gen-clang-attr-pch-read \
84 clang
/Serialization
/AttrPCHWrite.inc|
-gen-clang-attr-pch-write
86 CLANG_TABLEGEN_OUTPUT.StmtNodes.td
= \
87 clang
/AST
/StmtNodes.inc|
-gen-clang-stmt-nodes
89 CLANG_TABLEGEN_OUTPUT.DeclNodes.td
= \
90 clang
/AST
/DeclNodes.inc|
-gen-clang-decl-nodes
92 CLANG_TABLEGEN_OUTPUT.CommentNodes.td
= \
93 clang
/AST
/CommentNodes.inc|
-gen-clang-comment-nodes
95 CLANG_TABLEGEN_OUTPUT.CommentCommands.td
= \
96 clang
/AST
/CommentCommandInfo.inc|
-gen-clang-comment-command-info \
97 clang
/AST
/CommentCommandList.inc|
-gen-clang-comment-command-list
99 CLANG_TABLEGEN_OUTPUT.CommentHTMLTags.td
= \
100 clang
/AST
/CommentHTMLTags.inc|
-gen-clang-comment-html-tags \
101 clang
/AST
/CommentHTMLTagsProperties.inc|
-gen-clang-comment-html-tags-properties
103 CLANG_TABLEGEN_OUTPUT.CommentHTMLNamedCharacterReferences.td
= \
104 clang
/AST
/CommentHTMLNamedCharacterReferences.inc|
-gen-clang-comment-html-named-character-references
106 CLANG_TABLEGEN_INCLUDES.Diagnostic.td
= -I
${CLANG_SRCDIR}/include/clang
/Basic
107 CLANG_TABLEGEN_OUTPUT.Diagnostic.td
= \
108 clang
/Basic
/DiagnosticAnalysisKinds.inc|
-gen-clang-diags-defs^
-clang-component
=Analysis \
109 clang
/Basic
/DiagnosticASTKinds.inc|
-gen-clang-diags-defs^
-clang-component
=AST \
110 clang
/Basic
/DiagnosticCommentKinds.inc|
-gen-clang-diags-defs^
-clang-component
=Comment \
111 clang
/Basic
/DiagnosticCommonKinds.inc|
-gen-clang-diags-defs^
-clang-component
=Common \
112 clang
/Basic
/DiagnosticDriverKinds.inc|
-gen-clang-diags-defs^
-clang-component
=Driver \
113 clang
/Basic
/DiagnosticFrontendKinds.inc|
-gen-clang-diags-defs^
-clang-component
=Frontend \
114 clang
/Basic
/DiagnosticLexKinds.inc|
-gen-clang-diags-defs^
-clang-component
=Lex \
115 clang
/Basic
/DiagnosticParseKinds.inc|
-gen-clang-diags-defs^
-clang-component
=Parse \
116 clang
/Basic
/DiagnosticSemaKinds.inc|
-gen-clang-diags-defs^
-clang-component
=Sema \
117 clang
/Basic
/DiagnosticSerializationKinds.inc|
-gen-clang-diags-defs^
-clang-component
=Serialization \
118 clang
/Basic
/DiagnosticGroups.inc|
-gen-clang-diag-groups \
119 clang
/Basic
/DiagnosticIndexName.inc|
-gen-clang-diags-index-name
121 CLANG_TABLEGEN_OUTPUT.arm_neon.td
= \
122 clang
/Basic
/arm_neon.inc|
-gen-arm-neon-sema \
123 arm_neon.h|
-gen-arm-neon
125 TABLEGEN_INCLUDES.Options.td
= -I
${CLANG_SRCDIR}/include/clang
/Driver
126 TABLEGEN_OUTPUT.Options.td
= \
127 clang
/Driver
/Options.inc|
-gen-opt-parser-defs
129 .
include "${.PARSEDIR}/../tablegen.mk"
131 DPSRCS
+= clang
/Basic
/Version.inc
132 CLEANFILES
+= clang
/Basic
/Version.inc
134 clang
/Basic
/Version.inc
: ${LLVM_TOPLEVEL}/Makefile.inc
135 mkdir
-p
${.TARGET
:H
}
136 printf
'#define CLANG_VERSION ${CLANG_VERSION}\n' > ${.TARGET
}.tmp
137 printf
'#define CLANG_VERSION_MAJOR ${CLANG_VERSION:R:R}\n' >> ${.TARGET
}.tmp
138 printf
'#define CLANG_VERSION_MINOR ${CLANG_VERSION:R:E}\n' >> ${.TARGET
}.tmp
139 mv
${.TARGET
}.tmp
${.TARGET
}
141 lld
/Config
/Version.inc
: ${LLVM_TOPLEVEL}/Makefile.inc
144 DPSRCS
+= lld
/Config
/Version.inc
145 CLEANFILES
+= lld
/Config
/Version.inc
147 lld
/Config
/Version.inc
: ${LLVM_TOPLEVEL}/Makefile.inc
148 mkdir
-p
${.TARGET
:H
}
149 printf
'#define LLD_VERSION ${LLD_VERSION}\n' > ${.TARGET
}.tmp
150 printf
'#define LLD_VERSION_MAJOR ${LLD_VERSION:R:R}\n' >> ${.TARGET
}.tmp
151 printf
'#define LLD_VERSION_MINOR ${LLD_VERSION:R:E}\n' >> ${.TARGET
}.tmp
152 printf
'#define LLD_REVISION_STRING "r${LLD_REVISION}"\n' >> ${.TARGET
}.tmp
153 printf
'#define LLD_REPOSITORY_STRING "${SVN_ROOT}/lld/${SVN_BRANCH}"\n' >> ${.TARGET
}.tmp
154 mv
${.TARGET
}.tmp
${.TARGET
}
159 DPSRCS
+= llvm
/Config
/config.h llvm
/Config
/llvm-config.h
160 CLEANFILES
+= llvm
/Config
/config.h llvm
/Config
/llvm-config.h
162 llvm
/Config
/config.h
: ${LLVM_TOPLEVEL}/Makefile.inc
${LLVM_TOPLEVEL}/config
/llvm
/Config
/config.h.in
163 mkdir
-p
${.TARGET
:H
}
164 ${TOOL_SED} -e
/LLVM_DEFAULT_TARGET_TRIPLE
/d
-e
/LLVM_NATIVE_
/d \
165 -e
/LLVM_VERSION_
/d
-e
/PACKAGE_VERSION
/d
-e
'x' \
166 < ${LLVM_TOPLEVEL}/config
/llvm
/Config
/config.h.in \
168 printf
'#define LLVM_DEFAULT_TARGET_TRIPLE "${MACHINE_GNU_PLATFORM}"\n' >> ${.TARGET
}.tmp
169 printf
'#define PACKAGE_VERSION "${LLVM_VERSION} (trunk ${LLVM_REVISION})"\n' >> ${.TARGET
}.tmp
170 printf
'#define LLVM_VERSION_MAJOR ${LLVM_VERSION:R:R}\n' >> ${.TARGET
}.tmp
171 printf
'#define LLVM_VERSION_MINOR ${LLVM_VERSION:R:E}\n' >> ${.TARGET
}.tmp
172 printf
'#endif\n' >> ${.TARGET
}.tmp
173 mv
${.TARGET
}.tmp
${.TARGET
}
175 llvm
/Config
/llvm-config.h
: ${LLVM_TOPLEVEL}/Makefile.inc
${LLVM_TOPLEVEL}/config
/llvm
/Config
/llvm-config.h.in
176 mkdir
-p
${.TARGET
:H
}
177 ${TOOL_SED} -e
/LLVM_DEFAULT_TARGET_TRIPLE
/d
-e
/LLVM_NATIVE_
/d \
178 -e
/LLVM_VERSION_
/d
-e
/PACKAGE_VERSION
/d
-e
'x' \
179 < ${LLVM_TOPLEVEL}/config
/llvm
/Config
/llvm-config.h.in \
181 printf
'#define LLVM_DEFAULT_TARGET_TRIPLE "${MACHINE_GNU_PLATFORM}"\n' >> ${.TARGET
}.tmp
182 printf
'#define LLVM_VERSION_MAJOR ${LLVM_VERSION:R:R}\n' >> ${.TARGET
}.tmp
183 printf
'#define LLVM_VERSION_MINOR ${LLVM_VERSION:R:E}\n' >> ${.TARGET
}.tmp
184 printf
'#endif\n' >> ${.TARGET
}.tmp
185 mv
${.TARGET
}.tmp
${.TARGET
}
188 [ ! -d tmp
] ||
rm -r tmp
190 cd tmp
&& ${LLVM_SRCDIR}/configure
${LLVM_CONFIGURE_ARGS} \
191 CC
=${CC
:Q
} CFLAGS
=${CFLAGS
:N-Werror
:Q
} CXX
=${CXX
:Q
} CXXFLAGS
=${CXXFLAGS
:N-Werror
:Q
} \
192 CPPFLAGS
=${CPPFLAGS
:N-std
=c
++11:Q
} LDFLAGS
=${LDFLAGS
:Q
} LD
=${LD
:Q
} LIBS
=-lm \
193 ac_cv_func_mmap_fixed_mapped
=yes ac_cv_func_mmap_file
=yes llvm_cv_c_printf_a
=yes
194 cp
-r tmp
/include/llvm
/* ${LLVM_INCLUDE_CONFIG}/llvm
/
195 mv
${LLVM_INCLUDE_CONFIG}/llvm
/Config
/config.h \
196 ${LLVM_INCLUDE_CONFIG}/llvm
/Config
/config.h.in
197 mv
${LLVM_INCLUDE_CONFIG}/llvm
/Config
/llvm-config.h \
198 ${LLVM_INCLUDE_CONFIG}/llvm
/Config
/llvm-config.h.in
199 cp
-r tmp
/tools
/clang
/include/clang
/* ${CLANG_INCLUDE_CONFIG}/clang
/
203 depend dependall
all: ${DPSRCS}
205 .
include <bsd.prog.mk
>