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 /share/mk/bsd.lkm.mk | |
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).
Diffstat (limited to 'share/mk/bsd.lkm.mk')
-rw-r--r-- | share/mk/bsd.lkm.mk | 106 |
1 files changed, 106 insertions, 0 deletions
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> |