C and C++ when wanting to pass flags to only the C compiler.
Tested in a ports bulk build by naddy and the handful of problems
found were fixed by naddy, jca and pascal.
# $FreeBSD: src/gnu/lib/libstdc++/Makefile,v 1.63.2.1 2009/08/03 08:13:06 kensmith Exp $
-# $OpenBSD: Makefile,v 1.7 2013/06/21 17:07:30 robert Exp $
+# $OpenBSD: Makefile,v 1.8 2015/05/14 02:56:01 jsg Exp $
.include "${.CURDIR}/Makefile.common"
LIB= stdc++
-CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
+CPPFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
.if ${MACHINE_ARCH} == "arm"
-CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1
+CPPFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1
.endif
-CFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
-CFLAGS+= -I${GCCLIB}/include -I${SRCDIR}/include -I${.CURDIR}/../libiberty/include -I.
+CPPFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
+CPPFLAGS+= -I${GCCLIB}/include -I${SRCDIR}/include -I${.CURDIR}/../libiberty/include -I.
CFLAGS+= -frandom-seed=RepeatabilityConsideredGood
+CXXFLAGS+= -frandom-seed=RepeatabilityConsideredGood
CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections \
-Wno-deprecated
-# $OpenBSD: Makefile.common,v 1.3 2010/05/16 13:22:58 espie Exp $
+# $OpenBSD: Makefile.common,v 1.4 2015/05/14 02:56:01 jsg Exp $
GCCDIR= ${.CURDIR}/../../gcc/gcc
GCCLIB= ${GCCDIR}/gcc
${SRCDIR}/include ${SUPDIR} ${.CURDIR}/../libiberty/src \
${.CURDIR}/../libstdc++-v3/obj
-CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
-CFLAGS+= -I${.CURDIR}/../libstdc++-v3/ -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
-CFLAGS+= -I${GCCLIB}/include -I${SRCDIR}/include -I${.CURDIR}/../libiberty/include -I.
+CPPFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
+CPPFLAGS+= -I${.CURDIR}/../libstdc++-v3/ -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
+CPPFLAGS+= -I${GCCLIB}/include -I${SRCDIR}/include -I${.CURDIR}/../libiberty/include -I.
CFLAGS+= -frandom-seed=RepeatabilityConsideredGood
+CXXFLAGS+= -frandom-seed=RepeatabilityConsideredGood
CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections \
-Wno-deprecated
-# $OpenBSD: Makefile,v 1.3 2011/07/18 18:32:47 matthieu Exp $
+# $OpenBSD: Makefile,v 1.4 2015/05/14 02:56:01 jsg Exp $
.include "${.CURDIR}/../libstdc++-v3/Makefile.common"
SRCS= ${SUPSRCS}
.if ${MACHINE_ARCH} == "arm"
-CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1
+CPPFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1
.endif
# Build a standard .a lib with PIC objects
NOPIC=
CFLAGS+= ${PICFLAG}
+CXXFLAGS+= ${PICFLAG}
.include <bsd.lib.mk>
-# $OpenBSD: bsd.lib.mk,v 1.71 2013/10/15 22:40:00 deraadt Exp $
+# $OpenBSD: bsd.lib.mk,v 1.72 2015/05/14 02:56:01 jsg Exp $
# $NetBSD: bsd.lib.mk,v 1.67 1996/01/17 20:39:26 mycroft Exp $
# @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
.if defined(NOPIE)
CFLAGS+= ${NOPIE_FLAGS}
+CXXFLAGS+= ${NOPIE_FLAGS}
AFLAGS+= ${NOPIE_FLAGS}
.endif
-# $OpenBSD: bsd.prog.mk,v 1.66 2014/12/23 16:35:53 deraadt Exp $
+# $OpenBSD: bsd.prog.mk,v 1.67 2015/05/14 02:56:01 jsg Exp $
# $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $
# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
.if (defined(LDSTATIC) && !defined(STATICPIE)) || defined(NOPIE)
CFLAGS+= ${NOPIE_FLAGS}
+CXXFLAGS+= ${NOPIE_FLAGS}
AFLAGS+= ${NOPIE_FLAGS}
LDFLAGS+= ${NOPIE_LDFLAGS}
.endif
-# $OpenBSD: sys.mk,v 1.71 2015/01/01 15:50:27 deraadt Exp $
+# $OpenBSD: sys.mk,v 1.72 2015/05/14 02:56:01 jsg Exp $
# $NetBSD: sys.mk,v 1.27 1996/04/10 05:47:19 mycroft Exp $
# @(#)sys.mk 5.11 (Berkeley) 3/13/91
HOSTCC?= cc
CXX?= c++
-CXXFLAGS?= ${CFLAGS}
+CXXFLAGS?= -O2 ${PIPE} ${DEBUG}
COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}