-# $OpenBSD: Makefile,v 1.20 2017/01/21 12:40:49 jsg Exp $
+# $OpenBSD: Makefile,v 1.21 2017/04/17 15:53:21 kettenis Exp $
.include <bsd.own.mk>
.if make(obj)
SUBDIR+=libobjc libstdc++ libstdc++-v3 libsupc++-v3 ../usr.bin/cc/libobjc
.else
-. if ${COMPILER_VERSION:L} == "gcc3"
+. if ${BUILD_GCC3:L} == "yes"
SUBDIR+=libobjc libstdc++
-. elif ${COMPILER_VERSION:L} == "gcc4"
+. endif
+. if ${BUILD_GCC4:L} == "yes"
# XXX make sure we build libobjc & libstdc++-v3 from gcc4
SUBDIR+=../usr.bin/cc/libobjc
SUBDIR+=libstdc++-v3 libsupc++-v3
-# $OpenBSD: Makefile,v 1.58 2017/02/20 01:00:26 jsg Exp $
+# $OpenBSD: Makefile,v 1.59 2017/04/17 15:53:21 kettenis Exp $
# $NetBSD: Makefile,v 1.35 1996/04/03 21:20:52 chuck Exp $
.include <bsd.own.mk>
.if make(obj)
SUBDIR+= cc clang gcc
.else
-. if ${COMPILER_VERSION:L} == "gcc3"
+. if ${BUILD_GCC3:L} == "yes"
SUBDIR+= gcc
-. elif ${COMPILER_VERSION:L} == "gcc4"
+. endif
+. if ${BUILD_GCC4:L} == "yes"
SUBDIR+= cc
-. elif ${COMPILER_VERSION:L} == "clang"
+. endif
+. if ${BUILD_CLANG:L} == "yes"
SUBDIR+= clang
. endif
.endif
-# $OpenBSD: Makefile.inc,v 1.4 2017/02/16 02:08:42 jsg Exp $
+# $OpenBSD: Makefile.inc,v 1.5 2017/04/17 15:53:21 kettenis Exp $
LLVM_SRCS?= ${.CURDIR}/../../../llvm
+.if ${COMPILER_VERSION:L} != "clang"
+CC= clang
+CXX= clang++
+.endif
+
BOOTSTRAP_CLANG?=no
.if ${BOOTSTRAP_CLANG} == "yes"
CC= egcc
-# $OpenBSD: Makefile,v 1.218 2017/03/12 23:28:13 guenther Exp $
+# $OpenBSD: Makefile,v 1.219 2017/04/17 15:53:21 kettenis Exp $
# $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $
# @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
../usr.bin/lex ../gnu/lib/libreadline \
../sys/arch/${MACHINE}
-.if ${COMPILER_VERSION:L} == "gcc3"
+.if ${BUILD_GCC3:L} == "yes"
RDIRS+= ../gnu/usr.bin/gcc ../gnu/lib/libobjc
PRDIRS+= ../gnu/lib/libstdc++
-.elif ${COMPILER_VERSION:L} == "gcc4"
+.endif
+.if ${BUILD_GCC4:L} == "yes"
RDIRS+= ../gnu/usr.bin/cc/libobjc
PRDIRS+= ../gnu/lib/libstdc++-v3 ../gnu/usr.bin/cc/include
-.elif ${COMPILER_VERSION:L} == "clang"
+.endif
+.if ${BUILD_CLANG:L} == "yes"
RDIRS+= ../lib/libcxxabi ../lib/libcxx
.endif
-# $OpenBSD: Makefile,v 1.6 2017/04/09 21:47:05 kettenis Exp $
+# $OpenBSD: Makefile,v 1.7 2017/04/17 15:53:21 kettenis Exp $
.include <bsd.own.mk>
-.if ${COMPILER_VERSION:L} == "clang"
+.if ${COMPILER_VERSION:L} != "clang"
+CC= clang
+CXX= clang++
+.endif
+
+.if ${BUILD_CLANG:L} == "yes"
LIB= compiler_rt
NOPIC=
-# $OpenBSD: Makefile,v 1.5 2017/02/16 02:08:42 jsg Exp $
+# $OpenBSD: Makefile,v 1.6 2017/04/17 15:53:21 kettenis Exp $
.include <bsd.own.mk>
-.if ${COMPILER_VERSION:L} == "clang"
+.if ${COMPILER_VERSION:L} != "clang"
+CC= clang
+CXX= clang++
+.endif
+
+.if ${BUILD_CLANG:L} == "yes"
HDRDIR= ${.CURDIR}/include
SRCDIR= ${.CURDIR}/src
-# $OpenBSD: Makefile,v 1.7 2017/04/06 09:28:29 kettenis Exp $
+# $OpenBSD: Makefile,v 1.8 2017/04/17 15:53:21 kettenis Exp $
.include <bsd.own.mk>
-.if ${COMPILER_VERSION:L} == "clang"
+.if ${COMPILER_VERSION:L} != "clang"
+CC= clang
+CXX= clang++
+.endif
+
+.if ${BUILD_CLANG:L} == "yes"
HDRDIR= ${.CURDIR}/include
SRCDIR= ${.CURDIR}/src
-# $OpenBSD: bsd.own.mk,v 1.182 2016/12/18 17:02:21 patrick Exp $
+# $OpenBSD: bsd.own.mk,v 1.183 2017/04/17 15:53:21 kettenis Exp $
# $NetBSD: bsd.own.mk,v 1.24 1996/04/13 02:08:09 thorpej Exp $
# Host-specific overrides
YP?= yes
CLANG_ARCH=aarch64
+GCC4_ARCH=alpha amd64 arm hppa i386 mips64 mips64el powerpc sh sparc64
GCC3_ARCH=m88k
# m88k: ?
STATICPIE_ARCH=alpha amd64 arm hppa i386 mips64 mips64el powerpc sh sparc64
.for _arch in ${MACHINE_ARCH}
-.if !empty(CLANG_ARCH:M${_arch})
-COMPILER_VERSION?=clang
-.elif !empty(GCC3_ARCH:M${_arch})
+.if !empty(GCC3_ARCH:M${_arch})
COMPILER_VERSION?=gcc3
-.else
+.elif !empty(GCC4_ARCH:M${_arch})
COMPILER_VERSION?=gcc4
+.elif !empty(CLANG_ARCH:M${_arch})
+COMPILER_VERSION?=clang
+.endif
+
+.if !empty(GCC3_ARCH:M${_arch})
+BUILD_GCC3?=yes
+.else
+BUILD_GCC3?=no
+.endif
+.if !empty(GCC4_ARCH:M${_arch})
+BUILD_GCC4?=yes
+.else
+BUILD_GCC4?=no
+.endif
+.if !empty(CLANG_ARCH:M${_arch})
+BUILD_CLANG?=yes
+.else
+BUILD_CLANG?=no
.endif
.if !empty(STATICPIE_ARCH:M${_arch})