release.sh changes & fixes
[minix3.git] / external / bsd / llvm / Makefile.inc
blob8cfb4ca752f71a3ee87315c5eb1f2e1377cc8671
1 #       $NetBSD: Makefile.inc,v 1.63 2013/11/28 14:19:59 joerg Exp $
3 .if !defined(LLVM_TOPLEVEL_MK)
4 LLVM_TOPLEVEL_MK=
6 .include <bsd.own.mk>
8 SVN_ROOT=               http://llvm.org/svn/llvm-project
9 SVN_BRANCH=             branches/release_34
11 COMMON_REVISION=        195771
12 CLANG_REVISION=         ${COMMON_REVISION}
13 COMPILER_RT_REVISION=   ${COMMON_REVISION}
14 LLD_REVISION=           ${COMMON_REVISION}
15 LLDB_REVISION=          ${COMMON_REVISION}
16 LLVM_REVISION=          ${COMMON_REVISION}
18 MCLINKER_REVISION=      deeb2a77b4165827316f88e0a7ba4ba6b743a080
19 MCLINKER_ROOT=          https://code.google.com/p/mclinker/
21 LLVM_VERSION=           3.4
22 CLANG_VERSION=          3.4
24 COMPILER_RT_SRCDIR:=    ${.PARSEDIR}/dist/compiler-rt
25 CLANG_SRCDIR:=  ${.PARSEDIR}/dist/clang
26 LLD_SRCDIR:=    ${.PARSEDIR}/dist/lld
27 LLDB_SRCDIR:=   ${.PARSEDIR}/dist/lldb
28 LLVM_SRCDIR:=   ${.PARSEDIR}/dist/llvm
29 MCLINKER_SRCDIR:=       ${.PARSEDIR}/dist/mclinker
30 LLVM_TOPLEVEL:= ${.PARSEDIR}
32 CPPFLAGS+=      -I. -I${CLANG_SRCDIR}/include -I${LLD_SRCDIR}/include \
33                 -I${LLVM_SRCDIR}/include -I${MCLINKER_SRCDIR}/include \
34                 -I${LLDB_SRCDIR}/include \
35                 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS \
36                 -D__STDC_FORMAT_MACROS -DCLANG_ENABLE_STATIC_ANALYZER
38 .if defined(HOSTLIB) || defined(HOSTPROG)
39 LLVM_INCLUDE_CONFIG=    ${LLVM_TOOLCONF_OBJDIR}/config/include
40 CLANG_INCLUDE_CONFIG=   ${LLVM_TOOLCONF_OBJDIR}/config/tools/clang/include
41 MCLINKER_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config/mclinker
42 LLVM_INCLUDE_OBJDIR!=   cd ${NETBSDSRCDIR}/tools/llvm-include && ${PRINTOBJDIR}
43 LLVM_TOOLCONF_OBJDIR!=  cd ${NETBSDSRCDIR}/tools/llvm && ${PRINTOBJDIR}
44 HOST_CPPFLAGS+= ${CPPFLAGS}
45 HOST_CXXFLAGS+= -O2 -g -fno-rtti -fno-exceptions
46 .if ${MKLLD:Uno} == "yes"
47 HOST_CPPFLAGS+= -std=c++11
48 .endif
49 .else
50 LLVM_INCLUDE_CONFIG=    ${LLVM_TOPLEVEL}/config
51 CLANG_INCLUDE_CONFIG=   ${LLVM_TOPLEVEL}/config
52 MCLINKER_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config/mclinker
53 LLVM_INCLUDE_OBJDIR!=   cd ${LLVM_TOPLEVEL}/include && ${PRINTOBJDIR}
55 .if ${MKLLD:Uno} == "yes" || ${MKLLDB:Uno} == "yes"
56 CPPFLAGS+=      -std=c++11
57 .endif
58 .if ${MKLLDB:Uno} == "yes"
59 CPPFLAGS+=      -DLLDB_DISABLE_PYTHON
60 .endif
61 CXXFLAGS+=      -fno-rtti -fno-exceptions
62 CXXFLAGS+=      -ffunction-sections -fdata-sections
63 LDFLAGS+=       -Wl,--gc-sections
64 .endif
65 CPPFLAGS+=      -I${LLVM_INCLUDE_OBJDIR} -I${LLVM_INCLUDE_CONFIG} \
66                 -I${CLANG_INCLUDE_CONFIG} -I${MCLINKER_INCLUDE_CONFIG}
68 .if !defined(__MINIX)
69 LLVM_CONFIGURE_ARGS=    \
70         --enable-targets=x86,powerpc,sparc,aarch64,arm,mips \
71         --with-c-include-dirs=/usr/include/clang-${CLANG_VERSION}:/usr/include \
72         --disable-timestamps --prefix=/usr --sysconfdir=/etc/llvm \
73         --with-clang-srcdir=${CLANG_SRCDIR} \
74         --host=${MACHINE_GNU_PLATFORM} \
75         llvm_cv_gnu_make_command=${MAKE}
76 .else
77 # LSC: Compile LLVM only with the target platform
78 .if ${MACHINE_ARCH:Mi*86} != ""
79 _LLVM_TARGET:=x86
80 .elif ${MACHINE_ARCH:M*arm*} != ""
81 _LLVM_TARGET:=arm
82 .else
83 .error Modify this or add support for all platform, at your convenience.
84 .endif
86 LLVM_CONFIGURE_ARGS=    \
87         --enable-targets=${_LLVM_TARGET} \
88         --with-c-include-dirs=/usr/include/clang-${CLANG_VERSION}:/usr/include \
89         --disable-timestamps --prefix=/usr --sysconfdir=/etc/llvm \
90         --with-clang-srcdir=${CLANG_SRCDIR} \
91         --host=${MACHINE_GNU_PLATFORM} \
92         --with-binutils-include=${NETBSDSRCDIR}/external/gpl3/binutils/dist/include \
93         --disable-debug-symbols --enable-assertions --enable-bindings=none \
94         llvm_cv_gnu_make_command=${MAKE}
96 .if ${HOST_OSTYPE:C/\-.*//} == "Minix"
97 LLVM_CONFIGURE_ARGS+= --disable-threads
98 CPPFLAGS+= -D_NLS_PRIVATE=1
99 .endif # ${HOST_OSTYPE:C/\-.*//} == "Minix"
100 .endif # !defined(__MINIX)
102 .for tool in circo dot dotty fdp neato twopi xdot
103 LLVM_CONFIGURE_ARGS+= ac_cv_path_${tool:tu}="echo ${tool}"
104 .endfor
106 .endif