aboutsummaryrefslogtreecommitdiff
path: root/share/mk/bsd.kmod.mk
diff options
context:
space:
mode:
authorMike Smith <msmith@FreeBSD.org>1998-10-02 04:51:10 +0000
committerMike Smith <msmith@FreeBSD.org>1998-10-02 04:51:10 +0000
commit90f60fc9bc41cc389c948ef561b8854e7021ce81 (patch)
treeb246ca694ca4da703306093ef5da3c28acd5769c /share/mk/bsd.kmod.mk
parent27af0eb7b6bbdb24ba4148fdda71798464be4f81 (diff)
downloadsrc-90f60fc9bc41cc389c948ef561b8854e7021ce81.tar.gz
src-90f60fc9bc41cc389c948ef561b8854e7021ce81.zip
Changes to support building of KLD modules. This includes the possibly
to be removed KMODDEPS define.
Notes
Notes: svn path=/head/; revision=39882
Diffstat (limited to 'share/mk/bsd.kmod.mk')
-rw-r--r--share/mk/bsd.kmod.mk12
1 files changed, 11 insertions, 1 deletions
diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk
index febbec5f8214..fa3ba95be18f 100644
--- a/share/mk/bsd.kmod.mk
+++ b/share/mk/bsd.kmod.mk
@@ -1,5 +1,5 @@
# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
-# $Id: bsd.kmod.mk,v 1.51 1998/08/08 07:02:07 peter Exp $
+# $Id: bsd.kmod.mk,v 1.52 1998/09/02 14:29:09 bde Exp $
#
# The include file <bsd.kmod.mk> handles installing Loadable Kernel Modules.
#
@@ -47,6 +47,8 @@
#
# SRCS List of source files
#
+# KMODDEPS List of modules which this one is dependant on
+#
# SUBDIR A list of subdirectories that should be built as well.
# Each of the targets will execute the same target in the
# subdirectories.
@@ -132,10 +134,17 @@ CFLAGS+= -DPSEUDO_LKM
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
.if !defined(PROG)
+.if defined(KLDMOD)
+PROG= ${KMOD}.ko
+.else
PROG= ${KMOD}.o
.endif
+.endif
${PROG}: ${OBJS} ${DPADD}
+.if defined(KLDMOD)
+ ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${OBJS} ${KMODDEPS}
+.else
${LD} -r ${LDFLAGS:N-static} -o tmp.o ${OBJS}
.if defined(EXPORT_SYMS)
rm -f symb.tmp
@@ -144,6 +153,7 @@ ${PROG}: ${OBJS} ${DPADD}
rm -f symb.tmp
.endif
mv tmp.o ${.TARGET}
+.endif
.if !defined(NOMAN)
.include <bsd.man.mk>