-# $OpenBSD: Makefile.inc,v 1.49 2016/11/06 16:04:20 tb Exp $
+# $OpenBSD: Makefile.inc,v 1.50 2017/06/01 11:18:53 naddy Exp $
CFLAGS=${DEBUG} ${COPTS} -Os -Wall -Werror
-CFLAGS+= -fno-stack-protector -DMDRANDOM
+CFLAGS+= -ffreestanding -fno-stack-protector -DMDRANDOM
CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR}
SACFLAGS=-D_STANDALONE
DEBUGFLAGS=
SACFLAGS+=-nostdinc -fno-builtin -fpack-struct
+.include <bsd.own.mk>
+.if ${COMPILER_VERSION:Mclang}
+NO_INTEGR_AS= -no-integrated-as
+.endif
+
.if !make(clean) && !make(cleandir) && !make(includes) && !make(libdep) && \
!make(sadep) && !make(salibdir) && !make(obj)
.BEGIN:
@([ X$(S) = X -o -h machine ] || ln -s $(S)/arch/i386/include machine)
assym.h: ${S}/kern/genassym.sh ${SADIR}/etc/genassym.cf
- sh ${S}/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
+ sh ${S}/kern/genassym.sh ${CC} ${NO_INTEGR_AS} ${CFLAGS} ${CPPFLAGS} \
${PARAM} < ${SADIR}/etc/genassym.cf > assym.h.tmp && \
mv -f assym.h.tmp assym.h
.endif
-# $OpenBSD: Makefile,v 1.27 2016/07/30 03:25:48 guenther Exp $
+# $OpenBSD: Makefile,v 1.28 2017/06/01 11:18:53 naddy Exp $
MAN= biosboot.8
CPPFLAGS+=-DLOADADDR=$(LOADADDR) -DLINKADDR=$(LINKADDR) -DBOOTMAGIC=$(BOOTMAGIC)
CPPFLAGS+=${DEBUGFLAGS}
CFLAGS+=-fno-pie
+AFLAGS+=${NO_INTEGR_AS}
#AFLAGS+=-Wa,-a
AFLAGS+=-fno-pie
.else
-# $OpenBSD: Makefile,v 1.64 2016/09/18 16:34:59 jsing Exp $
+# $OpenBSD: Makefile,v 1.65 2017/06/01 11:18:53 naddy Exp $
COPTS?=
MAN?= boot.8
CPPFLAGS+=-DSLOW -DSMALL -DNOBYFOUR -DNO_GZIP -DDYNAMIC_CRC_TABLE
CPPFLAGS+=-DHEAP_LIMIT=${HEAP_LIMIT} -I${S}/stand/boot #-DCOMPAT_UFS
CFLAGS+=-m32 $(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie
+AFLAGS+=${NO_INTEGR_AS}
AFLAGS+=-m32 # -Wa,-R
# AFLAGS+=-Wa,-a
AFLAGS+=-fno-pie
-# $OpenBSD: Makefile,v 1.29 2016/09/18 16:34:59 jsing Exp $
+# $OpenBSD: Makefile,v 1.30 2017/06/01 11:18:53 naddy Exp $
MAN= cdboot.8
CFLAGS+=-DOSREV=\"${OSREV}\" -DMACHINE=\"${MACHINE}\"
CFLAGS+=-DKERNEL=\"/${OSREV}/${MACHINE}/bsd.rd\"
CFLAGS+=-fno-pie
+AFLAGS+=${NO_INTEGR_AS}
#AFLAGS+=-Wa,-R
# AFLAGS+=-Wa,-a
AFLAGS+=-fno-pie
-# $OpenBSD: Makefile,v 1.26 2016/09/18 16:34:59 jsing Exp $
+# $OpenBSD: Makefile,v 1.27 2017/06/01 11:18:53 naddy Exp $
MAN= pxeboot.8
CPPFLAGS+=-DHEAP_LIMIT=${HEAP_LIMIT}
CPPFLAGS+=-I${S}/stand/boot
CFLAGS+=$(SACFLAGS) -D__INTERNAL_LIBSA_CREAD -fno-pie
+AFLAGS+=${NO_INTEGR_AS}
#AFLAGS+=-Wa,-R
# AFLAGS+=-Wa,-a
AFLAGS+=-fno-pie