]>
Commit | Line | Data |
---|---|---|
1 | subdir-m += avl | |
2 | subdir-m += icp | |
3 | subdir-m += lua | |
4 | subdir-m += nvpair | |
5 | subdir-m += spl | |
6 | subdir-m += unicode | |
7 | subdir-m += zcommon | |
8 | subdir-m += zfs | |
9 | ||
10 | INSTALL_MOD_DIR ?= extra | |
11 | ||
12 | ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement | |
13 | ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@ | |
14 | ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h | |
15 | ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/spl | |
16 | ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include | |
17 | ||
18 | ZFS_MODULE_CPPFLAGS += -D_KERNEL | |
19 | ZFS_MODULE_CPPFLAGS += @KERNEL_DEBUG_CPPFLAGS@ | |
20 | ||
21 | @CONFIG_QAT_TRUE@ZFS_MODULE_CFLAGS += -I@QAT_SRC@/include | |
22 | @CONFIG_QAT_TRUE@KBUILD_EXTRA_SYMBOLS += @QAT_SYMBOLS@ | |
23 | ||
24 | export ZFS_MODULE_CFLAGS ZFS_MODULE_CPPFLAGS | |
25 | ||
26 | SUBDIR_TARGETS = icp lua | |
27 | ||
28 | modules: | |
29 | list='$(SUBDIR_TARGETS)'; for targetdir in $$list; do \ | |
30 | $(MAKE) -C $$targetdir; \ | |
31 | done | |
32 | $(MAKE) -C @LINUX_OBJ@ M=`pwd` @KERNEL_MAKE@ CONFIG_ZFS=m $@ | |
33 | ||
34 | clean: | |
35 | @# Only cleanup the kernel build directories when CONFIG_KERNEL | |
36 | @# is defined. This indicates that kernel modules should be built. | |
37 | @CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ M=`pwd` @KERNEL_MAKE@ $@ | |
38 | ||
39 | if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi | |
40 | if [ -f Module.markers ]; then $(RM) Module.markers; fi | |
41 | ||
42 | find . -name '*.ur-safe' -type f -print | xargs $(RM) | |
43 | ||
44 | modules_install: | |
45 | @# Install the kernel modules | |
46 | $(MAKE) -C @LINUX_OBJ@ M=`pwd` $@ \ | |
47 | INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \ | |
48 | INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ | |
49 | KERNELRELEASE=@LINUX_VERSION@ | |
50 | @# Remove extraneous build products when packaging | |
51 | kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \ | |
52 | if [ -n "$(DESTDIR)" ]; then \ | |
53 | find $$kmoddir -name 'modules.*' | xargs $(RM); \ | |
54 | fi | |
55 | sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \ | |
56 | if [ -f $$sysmap ]; then \ | |
57 | depmod -ae -F $$sysmap @LINUX_VERSION@; \ | |
58 | fi | |
59 | ||
60 | modules_uninstall: | |
61 | @# Uninstall the kernel modules | |
62 | kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@ | |
63 | list='$(subdir-m)'; for subdir in $$list; do \ | |
64 | $(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \ | |
65 | done | |
66 | ||
67 | distdir: | |
68 | list='$(subdir-m)'; for subdir in $$list; do \ | |
69 | (cd @top_srcdir@/module && find $$subdir -name '*.c' -o -name '*.h' -o -name '*.S' |\ | |
70 | xargs cp --parents -t $$distdir); \ | |
71 | done | |
72 | ||
73 | distclean maintainer-clean: clean | |
74 | install: modules_install | |
75 | uninstall: modules_uninstall | |
76 | all: modules | |
77 | check: |