mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
build runs, lots of uncommented and lots of untested though
Refactor everything. Create nice submodules/ and packages/ folders.
This commit is contained in:
40
packages/kernel_module/external.mk
Normal file
40
packages/kernel_module/external.mk
Normal file
@@ -0,0 +1,40 @@
|
||||
################################################################################
|
||||
#
|
||||
# kernel_module
|
||||
#
|
||||
################################################################################
|
||||
|
||||
KERNEL_MODULE_VERSION = 1.0
|
||||
KERNEL_MODULE_SITE = $(BR2_EXTERNAL_KERNEL_MODULE_PATH)
|
||||
KERNEL_MODULE_SITE_METHOD = local
|
||||
|
||||
ifeq ($(BR2_PACKAGE_EIGEN),y)
|
||||
KERNEL_MODULE_DEPENDENCIES += eigen
|
||||
endif
|
||||
ifeq ($(BR2_PACKAGE_LIBDRM),y)
|
||||
KERNEL_MODULE_DEPENDENCIES += libdrm
|
||||
endif
|
||||
ifeq ($(BR2_PACKAGE_OPENBLAS),y)
|
||||
KERNEL_MODULE_DEPENDENCIES += openblas
|
||||
endif
|
||||
|
||||
define KERNEL_MODULE_BUILD_CMDS
|
||||
$(MAKE) -C '$(@D)/user' $(TARGET_CONFIGURE_OPTS) \
|
||||
BR2_PACKAGE_EIGEN="$(BR2_PACKAGE_EIGEN)" \
|
||||
BR2_PACKAGE_LIBDRM="$(BR2_PACKAGE_LIBDRM)" \
|
||||
BR2_PACKAGE_OPENBLAS="$(BR2_PACKAGE_OPENBLAS)" \
|
||||
;
|
||||
endef
|
||||
|
||||
define KERNEL_MODULE_INSTALL_TARGET_CMDS
|
||||
# The modules are already installed by the kernel-module package type
|
||||
# under /lib/modules/**, but let's also copy the modules to the root
|
||||
# for insmod convenience.
|
||||
#
|
||||
# Modules can be still be easily inserted with "modprobe module" however.
|
||||
$(INSTALL) -D -m 0655 $(@D)/*.ko '$(TARGET_DIR)'
|
||||
$(INSTALL) -D -m 0755 $(@D)/user/*.out '$(TARGET_DIR)'
|
||||
endef
|
||||
|
||||
$(eval $(kernel-module))
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user