tools/llvm: Do not build with symbols
[minix3.git] / external / bsd / llvm / include / Makefile
blob877d8fc985c5d1df8eec8727629de46397582056
1 # $NetBSD: Makefile,v 1.25 2013/11/11 23:51:36 joerg Exp $
3 .include <bsd.init.mk>
5 .PATH: ${CLANG_SRCDIR}/lib/Headers
7 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
8 INCS= __wmmintrin_aes.h \
9 __wmmintrin_pclmul.h \
10 ammintrin.h \
11 avx2intrin.h \
12 avxintrin.h \
13 bmi2intrin.h \
14 bmiintrin.h \
15 emmintrin.h \
16 f16cintrin.h \
17 fmaintrin.h \
18 fma4intrin.h \
19 immintrin.h \
20 lzcntintrin.h \
21 mm3dnow.h \
22 mmintrin.h \
23 mm_malloc.h \
24 nmmintrin.h \
25 pmmintrin.h \
26 popcntintrin.h \
27 prfchwintrin.h \
28 rdseedintrin.h \
29 rtmintrin.h \
30 shaintrin.h \
31 smmintrin.h \
32 tbmintrin.h \
33 tmmintrin.h \
34 wmmintrin.h \
35 x86intrin.h \
36 xmmintrin.h \
37 xopintrin.h
38 .elif ${MACHINE_ARCH} == "powerpc"
39 INCS= altivec.h
40 .endif
41 INCSDIR= /usr/include/clang-${CLANG_VERSION}
43 HEADER= \
44 float.h \
45 iso646.h \
46 limits.h \
47 stdarg.h \
48 stdbool.h \
49 stddef.h \
50 stdint.h \
51 tgmath.h
53 .PATH: ${LLVM_SRCDIR}/include/llvm/IR \
54 ${CLANG_SRCDIR}/include/clang/AST \
55 ${CLANG_SRCDIR}/include/clang/Basic \
56 ${CLANG_SRCDIR}/include/clang/Driver
58 TABLEGEN_SRC= Intrinsics.td Options.td CC1AsOptions.td
60 TABLEGEN_OUTPUT.Intrinsics.td= \
61 llvm/IR/Intrinsics.gen|-gen-intrinsic
63 CLANG_TABLEGEN_SRC= Attr.td CommentCommands.td CommentHTMLTags.td \
64 CommentNodes.td CommentHTMLNamedCharacterReferences.td DeclNodes.td \
65 StmtNodes.td Diagnostic.td arm_neon.td
67 CLANG_TABLEGEN_INCLUDES.Attr.td= -I${CLANG_SRCDIR}/include
68 CLANG_TABLEGEN_OUTPUT.Attr.td= \
69 clang/AST/Attrs.inc|-gen-clang-attr-classes \
70 clang/AST/AttrDump.inc|-gen-clang-attr-dump \
71 clang/AST/AttrImpl.inc|-gen-clang-attr-impl \
72 clang/Basic/AttrList.inc|-gen-clang-attr-list \
73 clang/Lex/AttrSpellings.inc|-gen-clang-attr-spelling-list \
74 clang/Parse/AttrIdentifierArg.inc|-gen-clang-attr-identifier-arg-list \
75 clang/Parse/AttrLateParsed.inc|-gen-clang-attr-late-parsed-list \
76 clang/Parse/AttrTypeArg.inc|-gen-clang-attr-type-arg-list \
77 clang/Sema/AttrParsedAttrImpl.inc|-gen-clang-attr-parsed-attr-impl \
78 clang/Sema/AttrParsedAttrKinds.inc|-gen-clang-attr-parsed-attr-kinds \
79 clang/Sema/AttrParsedAttrList.inc|-gen-clang-attr-parsed-attr-list \
80 clang/Sema/AttrSpellingListIndex.inc|-gen-clang-attr-spelling-index \
81 clang/Sema/AttrTemplateInstantiate.inc|-gen-clang-attr-template-instantiate \
82 clang/Serialization/AttrPCHRead.inc|-gen-clang-attr-pch-read \
83 clang/Serialization/AttrPCHWrite.inc|-gen-clang-attr-pch-write
85 CLANG_TABLEGEN_OUTPUT.StmtNodes.td= \
86 clang/AST/StmtNodes.inc|-gen-clang-stmt-nodes
88 CLANG_TABLEGEN_OUTPUT.DeclNodes.td= \
89 clang/AST/DeclNodes.inc|-gen-clang-decl-nodes
91 CLANG_TABLEGEN_OUTPUT.CommentNodes.td= \
92 clang/AST/CommentNodes.inc|-gen-clang-comment-nodes
94 CLANG_TABLEGEN_OUTPUT.CommentCommands.td= \
95 clang/AST/CommentCommandInfo.inc|-gen-clang-comment-command-info \
96 clang/AST/CommentCommandList.inc|-gen-clang-comment-command-list
98 CLANG_TABLEGEN_OUTPUT.CommentHTMLTags.td= \
99 clang/AST/CommentHTMLTags.inc|-gen-clang-comment-html-tags \
100 clang/AST/CommentHTMLTagsProperties.inc|-gen-clang-comment-html-tags-properties
102 CLANG_TABLEGEN_OUTPUT.CommentHTMLNamedCharacterReferences.td= \
103 clang/AST/CommentHTMLNamedCharacterReferences.inc|-gen-clang-comment-html-named-character-references
105 CLANG_TABLEGEN_INCLUDES.Diagnostic.td= -I${CLANG_SRCDIR}/include/clang/Basic
106 CLANG_TABLEGEN_OUTPUT.Diagnostic.td= \
107 clang/Basic/DiagnosticAnalysisKinds.inc|-gen-clang-diags-defs^-clang-component=Analysis \
108 clang/Basic/DiagnosticASTKinds.inc|-gen-clang-diags-defs^-clang-component=AST \
109 clang/Basic/DiagnosticCommentKinds.inc|-gen-clang-diags-defs^-clang-component=Comment \
110 clang/Basic/DiagnosticCommonKinds.inc|-gen-clang-diags-defs^-clang-component=Common \
111 clang/Basic/DiagnosticDriverKinds.inc|-gen-clang-diags-defs^-clang-component=Driver \
112 clang/Basic/DiagnosticFrontendKinds.inc|-gen-clang-diags-defs^-clang-component=Frontend \
113 clang/Basic/DiagnosticLexKinds.inc|-gen-clang-diags-defs^-clang-component=Lex \
114 clang/Basic/DiagnosticParseKinds.inc|-gen-clang-diags-defs^-clang-component=Parse \
115 clang/Basic/DiagnosticSemaKinds.inc|-gen-clang-diags-defs^-clang-component=Sema \
116 clang/Basic/DiagnosticSerializationKinds.inc|-gen-clang-diags-defs^-clang-component=Serialization \
117 clang/Basic/DiagnosticGroups.inc|-gen-clang-diag-groups \
118 clang/Basic/DiagnosticIndexName.inc|-gen-clang-diags-index-name
120 CLANG_TABLEGEN_OUTPUT.arm_neon.td= \
121 clang/Basic/arm_neon.inc|-gen-arm-neon-sema \
122 arm_neon.h.inc|-gen-arm-neon
124 TABLEGEN_INCLUDES.Options.td= -I${CLANG_SRCDIR}/include/clang/Driver
125 TABLEGEN_OUTPUT.Options.td= \
126 clang/Driver/Options.inc|-gen-opt-parser-defs
128 TABLEGEN_INCLUDES.CC1AsOptions.td= -I${CLANG_SRCDIR}/include/clang/Driver
129 TABLEGEN_OUTPUT.CC1AsOptions.td= \
130 clang/Driver/CC1AsOptions.inc|-gen-opt-parser-defs
132 .include "${.PARSEDIR}/../tablegen.mk"
134 DPSRCS+= clang/Basic/Version.inc
135 CLEANFILES+= clang/Basic/Version.inc
137 clang/Basic/Version.inc: ${LLVM_TOPLEVEL}/Makefile.inc
138 mkdir -p ${.TARGET:H}
139 printf '#define CLANG_VERSION ${CLANG_VERSION}\n' > ${.TARGET}.tmp
140 printf '#define CLANG_VERSION_MAJOR ${CLANG_VERSION:C,\.[0-9]*,,}\n' >> ${.TARGET}.tmp
141 printf '#define CLANG_VERSION_MINOR ${CLANG_VERSION:C,[0-9]*\.,,}\n' >> ${.TARGET}.tmp
142 mv ${.TARGET}.tmp ${.TARGET}
144 .ifndef HOST_BUILD
146 DPSRCS+= llvm/Config/config.h llvm/Config/llvm-config.h
147 CLEANFILES+= llvm/Config/config.h llvm/Config/llvm-config.h
149 llvm/Config/config.h: ${LLVM_TOPLEVEL}/Makefile.inc ${LLVM_TOPLEVEL}/config/llvm/Config/config.h.in
150 mkdir -p ${.TARGET:H}
151 ${TOOL_SED} -e /LLVM_DEFAULT_TARGET_TRIPLE/d -e /LLVM_NATIVE_/d \
152 -e /LLVM_VERSION_/d -e /PACKAGE_VERSION/d \
153 -e /^\#endif/d \
154 < ${LLVM_TOPLEVEL}/config/llvm/Config/config.h.in \
155 > ${.TARGET}.tmp
156 printf '#define LLVM_DEFAULT_TARGET_TRIPLE "${MACHINE_GNU_PLATFORM}"\n' >> ${.TARGET}.tmp
157 printf '#define PACKAGE_VERSION "${LLVM_VERSION} (trunk ${LLVM_REVISION})"\n' >> ${.TARGET}.tmp
158 printf '#define LLVM_VERSION_MAJOR ${LLVM_VERSION:C,\.[0-9]*,,}\n' >> ${.TARGET}.tmp
159 printf '#define LLVM_VERSION_MINOR ${LLVM_VERSION:C,[0-9]*\.,,}\n' >> ${.TARGET}.tmp
160 printf '#endif\n' >> ${.TARGET}.tmp
161 mv ${.TARGET}.tmp ${.TARGET}
163 llvm/Config/llvm-config.h: ${LLVM_TOPLEVEL}/Makefile.inc ${LLVM_TOPLEVEL}/config/llvm/Config/llvm-config.h.in
164 mkdir -p ${.TARGET:H}
165 ${TOOL_SED} -e /LLVM_DEFAULT_TARGET_TRIPLE/d -e /LLVM_NATIVE_/d \
166 -e /LLVM_VERSION_/d -e /PACKAGE_VERSION/d \
167 -e /\#endif/d \
168 < ${LLVM_TOPLEVEL}/config/llvm/Config/llvm-config.h.in \
169 > ${.TARGET}.tmp
170 printf '#define LLVM_DEFAULT_TARGET_TRIPLE "${MACHINE_GNU_PLATFORM}"\n' >> ${.TARGET}.tmp
171 printf '#define LLVM_VERSION_MAJOR ${LLVM_VERSION:C,\.[0-9]*,,}\n' >> ${.TARGET}.tmp
172 printf '#define LLVM_VERSION_MINOR ${LLVM_VERSION:C,[0-9]*\.,,}\n' >> ${.TARGET}.tmp
173 printf '#endif\n' >> ${.TARGET}.tmp
174 mv ${.TARGET}.tmp ${.TARGET}
176 run-configure:
177 [ ! -d tmp ] || rm -r tmp
178 mkdir -p tmp
179 cd tmp && ${LLVM_SRCDIR}/configure ${LLVM_CONFIGURE_ARGS} \
180 CC=${CC:Q} CFLAGS=${CFLAGS:N-Werror:Q} CXX=${CXX:Q} CXXFLAGS=${CXXFLAGS:N-Werror:Q} \
181 CPPFLAGS=${CPPFLAGS:N-std=c++11:Q} LDFLAGS=${LDFLAGS:Q} LD=${LD:Q} LIBS=-lm \
182 ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_mmap_file=yes llvm_cv_c_printf_a=yes
183 cp -r tmp/include/llvm/* ${LLVM_INCLUDE_CONFIG}/llvm/
184 mv ${LLVM_INCLUDE_CONFIG}/llvm/Config/config.h \
185 ${LLVM_INCLUDE_CONFIG}/llvm/Config/config.h.in
186 mv ${LLVM_INCLUDE_CONFIG}/llvm/Config/llvm-config.h \
187 ${LLVM_INCLUDE_CONFIG}/llvm/Config/llvm-config.h.in
188 cp -r tmp/tools/clang/include/clang/* ${CLANG_INCLUDE_CONFIG}/clang/
189 rm -r tmp
190 .endif
192 depend dependall all: ${DPSRCS}
194 .include <bsd.prog.mk>