2 # Build and install a kernel module helper.
4 # See kernel/mk/kmod-build.mk for description of inputs used during the
5 # build. This makefile is responsible for making and cleaning up object
6 # subdirectories. All other tasks are handled by secondary makefile -
9 # The config system tells us:
11 # (1) whether to build this module at all
12 # (2) if we're supposed to build it, should we build 32-bit or 64-bit?
14 # The following config variable addresses #2 above:
16 # CONFIG_KERNEL_BITS = 64
18 # and the following config var tells us whether to bother with this
23 # If we are not supposed to care about this module, we do not even recurse
24 # into the module's build directory.
26 # This way, we separate the concerns of defining a module and how it is
27 # (generically) built, from which platforms/ISA/whatever we're supposed to
28 # build the module for.
30 # To avoid recursively including kmod-build.mk, this makefile turns into a
31 # giant no-op if _KMOD_BUILD is set.
34 .if empty
(_KMOD_BUILD
)
36 .
include <unleashed.mk
>
37 .
include <${SRCTOP}/cfgparam.mk
>
40 @mkdir
-p obj
${CONFIG_KERNEL_BITS}
41 @
${MAKE} -f
${SRCTOP}/kernel
/mk
/kmod-build.mk
all \
42 BITS
=${CONFIG_KERNEL_BITS} SRCTOP
=${SRCTOP}
45 @
${MAKE} -f
${SRCTOP}/kernel
/mk
/kmod-build.mk
clean \
47 @
rm -rf obj
${CONFIG_KERNEL_BITS}
50 @
${MAKE} -f
${SRCTOP}/kernel
/mk
/kmod-build.mk install-misc \
52 @
${MAKE} -f
${SRCTOP}/kernel
/mk
/kmod-build.mk
install \
53 BITS
=${CONFIG_KERNEL_BITS} SRCTOP
=${SRCTOP}
55 .PHONY
: all clean cleandir
install