bsd.kmod.mk (7f3dea244c40159a41ab22da77a434d7c5b5e85a) bsd.kmod.mk (fe3cac87c165807dfbed45bdb40cf1dab88b0c44)
1# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
2# $FreeBSD$
3#
1# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
2# $FreeBSD$
3#
4# The include file <bsd.kmod.mk> handles installing Loadable Kernel Modules.
4# The include file <bsd.kmod.mk> handles installing Kernel Loadable Device
5# drivers (KLD's).
5#
6#
7# +++ variables +++
8#
9# CLEANFILES Additional files to remove for the clean and cleandir targets.
10#
11# DISTRIBUTION Name of distribution. [bin]
12#
13# KERN Main Kernel source directory. [${.CURDIR}/../../sys/kern]
14#
6#
7#
8# +++ variables +++
9#
10# CLEANFILES Additional files to remove for the clean and cleandir targets.
11#
12# DISTRIBUTION Name of distribution. [bin]
13#
14# KERN Main Kernel source directory. [${.CURDIR}/../../sys/kern]
15#
15# KMOD The name of the loadable kernel module to build.
16# KMOD The name of the kernel module to build.
16#
17#
17# KMODDIR Base path for loadable kernel modules
18# (see kld(4)). [/modules]
18# KMODDIR Base path for kernel modules (see kld(4)). [/modules]
19#
19#
20# KMODOWN LKM owner. [${BINOWN}]
20# KMODOWN KLD owner. [${BINOWN}]
21#
21#
22# KMODGRP LKM group. [${BINGRP}]
22# KMODGRP KLD group. [${BINGRP}]
23#
23#
24# KMODMODE LKM mode. [${BINMODE}]
24# KMODMODE KLD mode. [${BINMODE}]
25#
25#
26# LINKS The list of LKM links; should be full pathnames, the
26# LINKS The list of KLD links; should be full pathnames, the
27# linked-to file coming first, followed by the linked
28# file. The files are hard-linked. For example, to link
29# /modules/master and /modules/meister, use:
30#
31# LINKS= /modules/master /modules/meister
32#
27# linked-to file coming first, followed by the linked
28# file. The files are hard-linked. For example, to link
29# /modules/master and /modules/meister, use:
30#
31# LINKS= /modules/master /modules/meister
32#
33# MODLOAD Command to load a kernel module [/sbin/modload]
33# KMODLOAD Command to load a kernel module [/sbin/kldload]
34#
34#
35# MODUNLOAD Command to unload a kernel module [/sbin/modunload]
35# KMODUNLOAD Command to unload a kernel module [/sbin/kldunload]
36#
36#
37# NOMAN LKM does not have a manual page if set.
37# NOMAN KLD does not have a manual page if set.
38#
38#
39# PROG The name of the loadable kernel module to build.
39# PROG The name of the kernel module to build.
40# If not supplied, ${KMOD}.o is used.
41#
42# SRCS List of source files
43#
44# KMODDEPS List of modules which this one is dependant on
45#
46# SUBDIR A list of subdirectories that should be built as well.
47# Each of the targets will execute the same target in the

--- 14 unchanged lines hidden (view full) ---

62# install:
63# install the program and its manual pages; if the Makefile
64# does not itself define the target install, the targets
65# beforeinstall and afterinstall may also be used to cause
66# actions immediately before and after the install target
67# is executed.
68#
69# load:
40# If not supplied, ${KMOD}.o is used.
41#
42# SRCS List of source files
43#
44# KMODDEPS List of modules which this one is dependant on
45#
46# SUBDIR A list of subdirectories that should be built as well.
47# Each of the targets will execute the same target in the

--- 14 unchanged lines hidden (view full) ---

62# install:
63# install the program and its manual pages; if the Makefile
64# does not itself define the target install, the targets
65# beforeinstall and afterinstall may also be used to cause
66# actions immediately before and after the install target
67# is executed.
68#
69# load:
70# Load LKM.
70# Load KLD.
71#
72# unload:
71#
72# unload:
73# Unload LKM.
73# Unload KLD.
74#
75# bsd.obj.mk: clean, cleandir and obj
76# bsd.dep.mk: cleandepend, depend and tags
77# bsd.man.mk: maninstall
78#
79
74#
75# bsd.obj.mk: clean, cleandir and obj
76# bsd.dep.mk: cleandepend, depend and tags
77# bsd.man.mk: maninstall
78#
79
80MODLOAD?= /sbin/modload
81MODUNLOAD?= /sbin/modunload
80KMODLOAD?= /sbin/kldload
81KMODUNLOAD?= /sbin/kldunload
82
83.if !target(__initialized__)
84__initialized__:
85.if exists(${.CURDIR}/../Makefile.inc)
86.include "${.CURDIR}/../Makefile.inc"
87.endif
88.endif
89

--- 4 unchanged lines hidden (view full) ---

94
95# Don't use any standard or source-relative include directories.
96# Since -nostdinc will annull any previous -I paths, we repeat all
97# such paths after -nostdinc. It doesn't seem to be possible to
98# add to the front of `make' variable.
99_ICFLAGS:= ${CFLAGS:M-I*}
100CFLAGS+= -nostdinc -I- ${_ICFLAGS}
101
82
83.if !target(__initialized__)
84__initialized__:
85.if exists(${.CURDIR}/../Makefile.inc)
86.include "${.CURDIR}/../Makefile.inc"
87.endif
88.endif
89

--- 4 unchanged lines hidden (view full) ---

94
95# Don't use any standard or source-relative include directories.
96# Since -nostdinc will annull any previous -I paths, we repeat all
97# such paths after -nostdinc. It doesn't seem to be possible to
98# add to the front of `make' variable.
99_ICFLAGS:= ${CFLAGS:M-I*}
100CFLAGS+= -nostdinc -I- ${_ICFLAGS}
101
102# Add -I paths for system headers. Individual LKM makefiles don't
102# Add -I paths for system headers. Individual KLD makefiles don't
103# need any -I paths for this. Similar defaults for .PATH can't be
104# set because there are no standard paths for non-headers.
105CFLAGS+= -I${.OBJDIR} -I${.OBJDIR}/@
106
107# XXX this is now dubious.
108.if defined(DESTDIR)
109CFLAGS+= -I${DESTDIR}/usr/include
110.endif

--- 130 unchanged lines hidden (view full) ---

241.if !target(distribute)
242distribute: _SUBDIR
243.for dist in ${DISTRIBUTION}
244 cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
245.endfor
246.endif
247
248.if !target(load)
103# need any -I paths for this. Similar defaults for .PATH can't be
104# set because there are no standard paths for non-headers.
105CFLAGS+= -I${.OBJDIR} -I${.OBJDIR}/@
106
107# XXX this is now dubious.
108.if defined(DESTDIR)
109CFLAGS+= -I${DESTDIR}/usr/include
110.endif

--- 130 unchanged lines hidden (view full) ---

241.if !target(distribute)
242distribute: _SUBDIR
243.for dist in ${DISTRIBUTION}
244 cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
245.endfor
246.endif
247
248.if !target(load)
249load: ${PROG}
250 ${MODLOAD} -o ${KMOD} -e${KMOD} ${PROG}
249load: ${PROG} install
250 ${KMODLOAD} ${KMOD}
251.endif
252
253.if !target(unload)
251.endif
252
253.if !target(unload)
254unload: ${PROG}
255 ${MODUNLOAD} -n ${KMOD}
254unload:
255 ${KMODUNLOAD} ${KMOD}
256.endif
257
258.if exists(${.CURDIR}/../../kern)
259KERN= ${.CURDIR}/../../kern
260.else
261KERN= ${.CURDIR}/../../sys/kern
262.endif
263

--- 14 unchanged lines hidden ---
256.endif
257
258.if exists(${.CURDIR}/../../kern)
259KERN= ${.CURDIR}/../../kern
260.else
261KERN= ${.CURDIR}/../../sys/kern
262.endif
263

--- 14 unchanged lines hidden ---