diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-02-25 19:02:38 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-02-25 19:02:38 +0000 |
commit | cdf27a9bb8d75d0954a2d98d0156c7f980f0c3a9 (patch) | |
tree | 623150fda5b31692bc9a42a0c9609746ac1afbb6 | |
parent | 0cb8e6d7104328fac890cdec7d3fa387baf23c86 (diff) |
Added <bsd.lkm.mk> file. Correspondent changes made to the bsd.README.
All the rest changed to be $OpenBSD$.
Dedicated to Suzi Quatro (she must be alive still, so best wishes to here).
-rw-r--r-- | share/mk/Makefile | 5 | ||||
-rw-r--r-- | share/mk/bsd.README | 25 | ||||
-rw-r--r-- | share/mk/bsd.dep.mk | 2 | ||||
-rw-r--r-- | share/mk/bsd.doc.mk | 2 | ||||
-rw-r--r-- | share/mk/bsd.lib.mk | 2 | ||||
-rw-r--r-- | share/mk/bsd.lkm.mk | 106 | ||||
-rw-r--r-- | share/mk/bsd.man.mk | 2 | ||||
-rw-r--r-- | share/mk/bsd.nls.mk | 2 | ||||
-rw-r--r-- | share/mk/bsd.own.mk | 2 | ||||
-rw-r--r-- | share/mk/bsd.subdir.mk | 2 | ||||
-rw-r--r-- | share/mk/bsd.sys.mk | 2 | ||||
-rw-r--r-- | share/mk/sys.mk | 2 |
12 files changed, 141 insertions, 13 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile index 1ae420145fe..2bfa40505d1 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.12 1995/10/22 00:45:53 christos Exp $ +# $OpenBSD: Makefile,v 1.3 1996/02/25 19:02:30 mickey Exp $ # @(#)Makefile 5.3 (Berkeley) 6/22/90 FILES= bsd.README bsd.doc.mk bsd.dep.mk bsd.lib.mk bsd.man.mk bsd.nls.mk \ - bsd.obj.mk bsd.own.mk bsd.prog.mk bsd.subdir.mk bsd.sys.mk sys.mk + bsd.obj.mk bsd.own.mk bsd.prog.mk bsd.subdir.mk bsd.sys.mk sys.mk \ + bsd.lkm.mk NOOBJ= noobj install: diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 9bf91863928..cee81c0b7fd 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -1,4 +1,4 @@ -# $NetBSD: bsd.README,v 1.15 1996/01/22 22:46:06 cgd Exp $ +# $OpenBSD: bsd.README,v 1.6 1996/02/25 19:02:31 mickey Exp $ # @(#)bsd.README 5.1 (Berkeley) 5/11/90 This is the README file for the new make "include" files for the BSD @@ -261,7 +261,7 @@ MAN Manual pages (should end in .1 - .9). If no MAN variable is PROG The name of the program to build. If not supplied, nothing is built. -SRCS List of source files to build the program. If PROG is not +SRCS List of source files to build the program. If it's not defined, it's assumed to be ${PROG}.c. DPADD Additional dependencies for the program. Usually used for @@ -379,3 +379,24 @@ It has rules for building profiled objects; profiled libraries are built by default. Libraries are ranlib'd when made. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +The include file <bsd.lkm.mk> has support for building the LKM's. It has +the same seven targets as <bsd.prog.mk>: all, clean, cleandir, depend, +install, lint, and tags. In addition two targets are made available +that is specific to the LKM's: load, unload. + +It sets/uses the following variables (in addition to the <bsd.prog.mk>'s): + +LKM LKM name to build. + +LKMGRP Module group. + +LKMOWN Module owner. + +LKMMODE Module mode. + +The include file <bsd.lkm.mk> includes the file named "../Makefile.inc" +if it exists, as well as the include file <bsd.man.mk>. + diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 1333b19c977..8cefadd33fe 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.dep.mk,v 1.12 1995/09/27 01:15:09 christos Exp $ +# $OpenBSD: bsd.dep.mk,v 1.2 1996/02/25 19:02:32 mickey Exp $ # some of the rules involve .h sources, so remove them from mkdep line .if !target(depend) diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk index def748daa2c..030c3b141b2 100644 --- a/share/mk/bsd.doc.mk +++ b/share/mk/bsd.doc.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.doc.mk,v 1.20 1994/07/26 19:42:37 mycroft Exp $ +# $OpenBSD: bsd.doc.mk,v 1.2 1996/02/25 19:02:32 mickey Exp $ # @(#)bsd.doc.mk 8.1 (Berkeley) 8/14/93 BIB?= bib diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index e3ff91ce55e..f8347cbf73d 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.lib.mk,v 1.67 1996/01/17 20:39:26 mycroft Exp $ +# $OpenBSD: bsd.lib.mk,v 1.4 1996/02/25 19:02:33 mickey Exp $ # @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 .if exists(${.CURDIR}/../Makefile.inc) diff --git a/share/mk/bsd.lkm.mk b/share/mk/bsd.lkm.mk new file mode 100644 index 00000000000..e8efcd16037 --- /dev/null +++ b/share/mk/bsd.lkm.mk @@ -0,0 +1,106 @@ +# $OpenBSD: bsd.lkm.mk,v 1.1 1996/02/25 19:02:33 mickey Exp $ +# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 + +.if exists(${.CURDIR}/../Makefile.inc) +.include "${.CURDIR}/../Makefile.inc" +.endif + +.include <bsd.own.mk> + +.SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 + +CFLAGS+= ${COPTS} -D_KERNEL -I/sys -I/sys/arch + +LDFLAGS+= -r +.if defined(LKM) +SRCS?= ${LKM}.c +.if !empty(SRCS:N*.h:N*.sh) +OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} +LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} +.endif +COMBINED?=combined.o + +.if defined(OBJS) && !empty(OBJS) + +${COMBINED}: ${OBJS} ${DPADD} + ${LD} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + +.endif # defined(OBJS) && !empty(OBJS) + +.if !defined(MAN) +MAN= ${LKM}.1 +.endif # !defined(MAN) +.endif # defined(LKM) + +.MAIN: all +all: ${COMBINED} _SUBDIRUSE + +.if !target(clean) +clean: _SUBDIRUSE + rm -f a.out [Ee]rrs mklog core *.core \ + ${LKM} ${COMBINED} ${OBJS} ${LOBJS} ${CLEANFILES} +.endif + +cleandir: _SUBDIRUSE clean + +.if !target(install) +.if !target(beforeinstall) +beforeinstall: +.endif +.if !target(afterinstall) +afterinstall: +.endif + +.if !target(realinstall) +realinstall: +.if defined(LKM) + install ${COPY} ${STRIP} -o ${LKMOWN} -g ${LKMGRP} -m ${LKMMODE} \ + ${LKM} ${DESTDIR}${BINDIR} +.endif +.endif + + +load: ${COMBINED} + modload -d -o $(LKM) -e$(LKM) $(COMBINED) + +unload: + modunload -n $(LKM) + +install: maninstall _SUBDIRUSE +.if defined(LINKS) && !empty(LINKS) + @set ${LINKS}; \ + while test $$# -ge 2; do \ + l=${DESTDIR}$$1; \ + shift; \ + t=${DESTDIR}$$1; \ + shift; \ + echo $$t -\> $$l; \ + rm -f $$t; \ + ln $$l $$t; \ + done; true +.endif + +maninstall: afterinstall +afterinstall: realinstall +realinstall: beforeinstall +.endif + +.if !target(lint) +lint: ${LOBJS} +.if defined(LOBJS) && !empty(LOBJS) + @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD} +.endif +.endif + +.if !defined(NOMAN) +.include <bsd.man.mk> +.endif + +.if !defined(NONLS) +.include <bsd.nls.mk> +.endif + +.include <bsd.obj.mk> +.include <bsd.dep.mk> +.include <bsd.subdir.mk> +.include <bsd.sys.mk> diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index cd0b1e7c030..5bc9b4f66a3 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.man.mk,v 1.21 1995/11/25 19:53:33 perry Exp $ +# $OpenBSD: bsd.man.mk,v 1.7 1996/02/25 19:02:34 mickey Exp $ # @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90 MANTARGET?= cat diff --git a/share/mk/bsd.nls.mk b/share/mk/bsd.nls.mk index 89a4d3a76a9..a38d40a17a5 100644 --- a/share/mk/bsd.nls.mk +++ b/share/mk/bsd.nls.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.nls.mk,v 1.2 1995/04/27 18:05:38 jtc Exp $ +# $OpenBSD: bsd.nls.mk,v 1.2 1996/02/25 19:02:35 mickey Exp $ .if !target(.MAIN) .if exists(${.CURDIR}/../Makefile.inc) diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 67d6c4a6297..05786a1630c 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.23 1995/11/03 23:33:33 cgd Exp $ +# $OpenBSD: bsd.own.mk,v 1.4 1996/02/25 19:02:35 mickey Exp $ # Defining `SKEY' causes support for S/key authentication to be compiled in. SKEY= yes diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 0eebc5a6be6..4810f46de02 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.subdir.mk,v 1.10 1995/07/24 04:22:29 cgd Exp $ +# $OpenBSD: bsd.subdir.mk,v 1.4 1996/02/25 19:02:36 mickey Exp $ # @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91 .if !target(.MAIN) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 3451ac9da3c..8404e8d0259 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.sys.mk,v 1.2 1995/12/13 01:25:07 cgd Exp $ +# $OpenBSD: bsd.sys.mk,v 1.4 1996/02/25 19:02:36 mickey Exp $ # # Overrides used for NetBSD source tree builds. diff --git a/share/mk/sys.mk b/share/mk/sys.mk index aceaf394898..344cd2aa30f 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -1,4 +1,4 @@ -# $NetBSD: sys.mk,v 1.22 1995/09/24 23:49:09 christos Exp $ +# $OpenBSD: sys.mk,v 1.3 1996/02/25 19:02:37 mickey Exp $ # @(#)sys.mk 5.11 (Berkeley) 3/13/91 unix= We run OpenBSD. |