From 83235b69653a960de621476d071365f41aed7a94 Mon Sep 17 00:00:00 2001 From: Alexander Kuleshov Date: Mon, 14 Dec 2015 01:28:30 +0600 Subject: [PATCH] boot1: Do not build hammer2 related stuff if WANT_HAMMER2 not passed We can pass the WANT_HAMMER2=yes to buildworld to enable building of the HAMMER2 related code. In the same time, sys/boot/pc32/boot1/Makefile contains HAMMER2 related targets. Let's not build these targets if the WANT_HAMMER2 wasn't passed to buildworld. --- lib/libstand/Makefile | 2 ++ sys/boot/pc32/boot2/Makefile | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index af24f4e..1c72bc5 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -91,7 +91,9 @@ SRCS+= netif.c nfs.c SRCS+= dosfs.c ext2fs.c SRCS+= splitfs.c SRCS+= hammer1.c +.if defined(WANT_HAMMER2) SRCS+= hammer2.c +.endif .include diff --git a/sys/boot/pc32/boot2/Makefile b/sys/boot/pc32/boot2/Makefile index 1a2704d..b8e810b 100644 --- a/sys/boot/pc32/boot2/Makefile +++ b/sys/boot/pc32/boot2/Makefile @@ -88,12 +88,22 @@ boot: boot1_32 boot2_32 .for s in _32 _64 +.if defined(WANT_HAMMER2) +CFLAGS_HAMMER2=-DHAMMER2FS +OBJ_HAMMER2=hammer2$s.o scrc32$s.o +SRC_HAMMER2=hammer2.c scrc32.c +.else +CFLAGS_HAMMER2= +OBJ_HAMMER2= +SRC_HAMMER2= +.endif + _ADDCFLAGS$s:= -DNSECT=${NSECT$s} _ts= $s .if ${_ts} == "_64" _ADDCFLAGS$s+= -DDISKLABEL64 -_ADDCFLAGS$s+= -DHAMMER2FS -DUFS -_ADDOBJS$s+= hammer2$s.o ufsread$s.o scrc32$s.o +_ADDCFLAGS$s+= ${CFLAGS_HAMMER2} -DUFS +_ADDOBJS$s+= ${OBJ_HAMMER2} ufsread$s.o .else _ADDCFLAGS$s+= -DUFS -DUFS1_ONLY _ADDOBJS$s+= ufsread$s.o @@ -113,7 +123,7 @@ boot1$s.o: boot1.S #${.CURDIR}/../../common/ufsread.c ${.CURDIR}/../../../../lib/libstand/hammer2.c -boot2$s.s: boot2.c boot2$s.h ufsread.c hammer2.c scrc32.c +boot2$s.s: boot2.c boot2$s.h ufsread.c ${SRC_HAMMER2} ${CC} ${CFLAGS} ${_ADDCFLAGS$s} -S -o boot2$s.s.tmp ${.CURDIR}/boot2.c sed -e '/align/d' -e '/nop/d' < ${.TARGET}.tmp > ${.TARGET} rm -f ${.TARGET}.tmp @@ -151,13 +161,15 @@ CLEANFILES+= boot1$s boot1$s.out boot1$s.o \ bootasmdef.nx \ ${_ADDOBJS$s} +.if defined(WANT_HAMMER2) hammer2$s.o: hammer2.c ${CC} ${CFLAGS} ${_ADDCFLAGS$s} ${.ALLSRC} -o ${.TARGET} -c -ufsread$s.o: ufsread.c +scrc32$s.o: scrc32.c ${CC} ${CFLAGS} ${_ADDCFLAGS$s} ${.ALLSRC} -o ${.TARGET} -c +.endif -scrc32$s.o: scrc32.c +ufsread$s.o: ufsread.c ${CC} ${CFLAGS} ${_ADDCFLAGS$s} ${.ALLSRC} -o ${.TARGET} -c .endfor -- 2.4.6