changeset 408:ad1633205e26

Try to enable CLANG build.
author Aleksandr Rybalko <ray@ddteam.net>
date Sun, 06 May 2012 21:46:27 +0300
parents f3fbc16205ab
children bf521f431685
files Makefile
diffstat 1 files changed, 30 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri May 04 23:29:30 2012 +0300
+++ b/Makefile	Sun May 06 21:46:27 2012 +0300
@@ -122,6 +122,21 @@
 IMAGE_HEADER_EXTRA?=0
 .endif
 
+.if defined(BUILD_ZROUTER_WITH_CLANG)
+CLANG_TC_VARS?=			\
+	WITH_CLANG=yes
+CLANG_VARS?=			\
+	WITH_CLANG=yes		\
+	CC=clang		\
+	CXX=clang++		\
+	CPP=clang-cpp
+.else
+CLANG_TC_VARS?=			\
+	WITHOUT_CLANG=yes
+CLANG_VARS?=			\
+	WITHOUT_CLANG=yes
+.endif
+
 build-verify:
 .if !exists(${ZROUTER_ROOT}/boards/${TARGET_VENDOR}/) || !exists(${ZROUTER_ROOT}/boards/${TARGET_VENDOR}/${TARGET_DEVICE}/)
 	@echo "Error: No board configuration for pair TARGET_VENDOR/TARGET_DEVICE \`\"${TARGET_VENDOR}\"/\"${TARGET_DEVICE}\"\`"
@@ -207,18 +222,27 @@
 # TODO: make dtd file for FDT
 #
 
+_KERNEL_TC_BUILD_ENV= \
+	TARGET=${TARGET} \
+	TARGET_ARCH=${TARGET_ARCH} \
+	TARGET_CPUARCH=${TARGET_CPUARCH} \
+	ZROUTER_ROOT=${ZROUTER_ROOT} \
+	WITHOUT_RESCUE=yes \
+	${CLANG_TC_VARS} \
+	-DNO_CLEAN
+
 _KERNEL_BUILD_ENV= \
 	TARGET=${TARGET} \
 	TARGET_ARCH=${TARGET_ARCH} \
 	TARGET_CPUARCH=${TARGET_CPUARCH} \
 	ZROUTER_ROOT=${ZROUTER_ROOT} \
 	WITHOUT_RESCUE=yes \
-	WITHOUT_CLANG=yes \
+	${CLANG_VARS} \
 	-DNO_CLEAN
 
 
 kernel-toolchain:
-	MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} kernel-toolchain
+	MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_TC_BUILD_ENV} -C ${FREEBSD_SRC_TREE} kernel-toolchain
 
 ${ZROUTER_FREEBSD_OBJDIR}/tmp/usr/bin/cc:	kernel-toolchain
 
@@ -239,7 +263,6 @@
 kernel:	build-verify build-info kernel-toolchain kernel-build kernel-install-dir kernel-install
 .ORDER:	build-verify build-info kernel-toolchain kernel-build kernel-install-dir kernel-install
 
-
 _WORLD_TCBUILD_ENV= \
 	TARGET=${TARGET} \
 	TARGET_ARCH=${TARGET_ARCH} \
@@ -255,10 +278,11 @@
 	WITHOUT_PROFILE=yes \
 	WITHOUT_RESCUE=yes \
 	WITHOUT_CDDL=yes \
-	WITHOUT_CLANG=yes \
+	${CLANG_TC_VARS} \
 	WITHOUT_CRYPTO=yes \
 	WITHOUT_NIS=yes \
 	WITHOUT_KERBEROS=yes \
+	MALLOC_PRODUCTION=yes \
 	-DNO_CLEAN
 
 _WORLD_BUILD_ENV= \
@@ -269,7 +293,7 @@
 	WITHOUT_ASSERT_DEBUG=yes \
 	WITHOUT_ATM=yes \
 	WITHOUT_AUDIT=yes \
-	WITHOUT_CLANG=yes \
+	${CLANG_VARS} \
 	WITHOUT_INFO=yes \
 	WITHOUT_INSTALLLIB=yes \
 	WITHOUT_IPX=yes \
@@ -279,6 +303,7 @@
 	WITHOUT_PROFILE=yes \
 	WITHOUT_RESCUE=yes \
 	WITHOUT_SSP=yes \
+	MALLOC_PRODUCTION=yes \
 	-DNO_CLEAN