diff --git a/etc/defaults/make.conf b/etc/defaults/make.conf index 15b2fdac4550..055a41018c36 100644 --- a/etc/defaults/make.conf +++ b/etc/defaults/make.conf @@ -46,6 +46,7 @@ #NO_BIND= true # do not build BIND #NO_FORTRAN= true # do not build g77 and related libraries #NO_MAILWRAPPER=true # do not build the mailwrapper(8) MTA selector +#NO_MODULES= true # do not build modules with the kernel #NO_OBJC= true # do not build Objective C support #NO_OPENSSH= true # do not build OpenSSH #NO_OPENSSL= true # do not build OpenSSL (implies NO_OPENSSH) diff --git a/share/examples/etc/make.conf b/share/examples/etc/make.conf index 15b2fdac4550..055a41018c36 100644 --- a/share/examples/etc/make.conf +++ b/share/examples/etc/make.conf @@ -46,6 +46,7 @@ #NO_BIND= true # do not build BIND #NO_FORTRAN= true # do not build g77 and related libraries #NO_MAILWRAPPER=true # do not build the mailwrapper(8) MTA selector +#NO_MODULES= true # do not build modules with the kernel #NO_OBJC= true # do not build Objective C support #NO_OPENSSH= true # do not build OpenSSH #NO_OPENSSL= true # do not build OpenSSL (implies NO_OPENSSH) diff --git a/sys/Makefile b/sys/Makefile index fd1087515074..14331b3bbfa6 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -3,9 +3,6 @@ # The boot loader SUBDIR= boot -# KLD modules build for both a.out and ELF -SUBDIR+=modules - HTAGSFLAGS+= -at `awk -F= '/^RELEASE *=/{release=$2}; END {print "FreeBSD", release, "kernel"}' < conf/newvers.sh` .include diff --git a/sys/conf/Makefile.alpha b/sys/conf/Makefile.alpha index f4e0f79b868c..4c9bdb02a625 100644 --- a/sys/conf/Makefile.alpha +++ b/sys/conf/Makefile.alpha @@ -119,6 +119,9 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o @echo linking ${.TARGET} ${SYSTEM_LD} ${SYSTEM_LD_TAIL} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} all +.endif .if !exists(.depend) ${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/} @@ -136,6 +139,9 @@ clean: vers.c vnode_if.c vnode_if.h \ ${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \ ${CLEAN} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} clean +.endif #lint: /tmp param.c # @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} \ @@ -230,9 +236,15 @@ depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} \ mkdep -a -f .newdep ${ASM_CFLAGS} ${SFILES} ${SYSTEM_SFILES} rm -f .depend mv -f .newdep .depend +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} depend +.endif cleandepend: rm -f .depend +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} cleandepend +.endif links: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ @@ -259,10 +271,16 @@ install install.debug: .endif install -c -m 555 -o root -g wheel -fschg \ ${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${KERNEL} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} install +.endif reinstall reinstall.debug: install -c -m 555 -o root -g wheel -fschg \ ${KERNEL}${.TARGET:S/reinstall//} ${DESTDIR}/${KERNEL} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} install +.endif config.o: ${NORMAL_C} diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386 index 089e4b8e1688..b3c4b5f77244 100644 --- a/sys/conf/Makefile.i386 +++ b/sys/conf/Makefile.i386 @@ -118,6 +118,9 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o @echo linking ${.TARGET} ${SYSTEM_LD} ${SYSTEM_LD_TAIL} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} all +.endif .if !exists(.depend) ${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/} @@ -135,6 +138,9 @@ clean: vers.c vnode_if.c vnode_if.h \ ${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \ ${CLEAN} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} clean +.endif #lint: /tmp param.c # @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} \ @@ -184,9 +190,15 @@ depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} \ mkdep -a -f .newdep ${ASM_CFLAGS} ${SFILES} ${SYSTEM_SFILES} rm -f .depend mv -f .newdep .depend +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} depend +.endif cleandepend: rm -f .depend +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} cleandepend +.endif links: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ @@ -213,10 +225,16 @@ install install.debug: .endif install -c -m 555 -o root -g wheel -fschg \ ${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${KERNEL} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} install +.endif reinstall reinstall.debug: install -c -m 555 -o root -g wheel -fschg \ ${KERNEL}${.TARGET:S/reinstall//} ${DESTDIR}/${KERNEL} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} install +.endif config.o: ${NORMAL_C} diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc index 089e4b8e1688..b3c4b5f77244 100644 --- a/sys/conf/Makefile.powerpc +++ b/sys/conf/Makefile.powerpc @@ -118,6 +118,9 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o @echo linking ${.TARGET} ${SYSTEM_LD} ${SYSTEM_LD_TAIL} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} all +.endif .if !exists(.depend) ${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/} @@ -135,6 +138,9 @@ clean: vers.c vnode_if.c vnode_if.h \ ${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \ ${CLEAN} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} clean +.endif #lint: /tmp param.c # @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} \ @@ -184,9 +190,15 @@ depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} \ mkdep -a -f .newdep ${ASM_CFLAGS} ${SFILES} ${SYSTEM_SFILES} rm -f .depend mv -f .newdep .depend +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} depend +.endif cleandepend: rm -f .depend +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} cleandepend +.endif links: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ @@ -213,10 +225,16 @@ install install.debug: .endif install -c -m 555 -o root -g wheel -fschg \ ${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${KERNEL} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} install +.endif reinstall reinstall.debug: install -c -m 555 -o root -g wheel -fschg \ ${KERNEL}${.TARGET:S/reinstall//} ${DESTDIR}/${KERNEL} +.if !defined(NO_MODULES) && exists(${.CURDIR}/../../modules) + cd ${.CURDIR}/../../modules && ${MAKE} install +.endif config.o: ${NORMAL_C}