]>
Commit | Line | Data |
---|---|---|
c9c0d073 | 1 | subdir-m += avl |
fed90353 | 2 | subdir-m += icp |
c9c0d073 BB |
3 | subdir-m += nvpair |
4 | subdir-m += unicode | |
5 | subdir-m += zcommon | |
6 | subdir-m += zfs | |
7 | ||
d09f98a9 BB |
8 | INSTALL_MOD_DIR ?= extra |
9 | ||
fed90353 BB |
10 | ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement |
11 | ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@ | |
2ee4a18b ED |
12 | ZFS_MODULE_CFLAGS += -include @SPL_OBJ@/spl_config.h |
13 | ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h | |
14 | ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include -I@SPL@/include -I@SPL@ | |
fed90353 BB |
15 | |
16 | ZFS_MODULE_CPPFLAGS += -DHAVE_SPL -D_KERNEL | |
17 | ZFS_MODULE_CPPFLAGS += @KERNEL_DEBUG_CPPFLAGS@ | |
18 | ||
6a9d6359 | 19 | @CONFIG_QAT_TRUE@ZFS_MODULE_CFLAGS += -I@QAT_SRC@/include |
20 | @CONFIG_QAT_TRUE@KBUILD_EXTRA_SYMBOLS += @QAT_SYMBOLS@ | |
fed90353 BB |
21 | |
22 | export ZFS_MODULE_CFLAGS ZFS_MODULE_CPPFLAGS | |
2ee4a18b | 23 | |
0b04990a TC |
24 | SUBDIR_TARGETS = icp |
25 | ||
c9c0d073 | 26 | modules: |
6283f55e BB |
27 | @# Make the exported SPL symbols available to these modules. |
28 | @# They may be in the root of SPL_OBJ when building against | |
29 | @# installed devel headers, or they may be in the module | |
30 | @# subdirectory when building against the spl source tree. | |
31 | @if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \ | |
e254c8d8 | 32 | cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \ |
6283f55e | 33 | elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \ |
e254c8d8 | 34 | cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \ |
6283f55e BB |
35 | else \ |
36 | echo -e "\n" \ | |
37 | "*** Missing spl symbols ensure you have built the spl:\n" \ | |
38 | "*** - @SPL_OBJ@/@SPL_SYMBOLS@, or\n" \ | |
39 | "*** - @SPL_OBJ@/module/@SPL_SYMBOLS@\n"; \ | |
40 | exit 1; \ | |
41 | fi | |
0b04990a TC |
42 | list='$(SUBDIR_TARGETS)'; for targetdir in $$list; do \ |
43 | $(MAKE) -C $$targetdir; \ | |
44 | done | |
fed90353 | 45 | $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNEL_MAKE@ CONFIG_ZFS=m $@ |
c9c0d073 BB |
46 | |
47 | clean: | |
d433c206 BB |
48 | @# Only cleanup the kernel build directories when CONFIG_KERNEL |
49 | @# is defined. This indicates that kernel modules should be built. | |
fed90353 | 50 | @CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNEL_MAKE@ $@ |
d433c206 | 51 | |
c9c0d073 BB |
52 | if [ -f @SPL_SYMBOLS@ ]; then $(RM) @SPL_SYMBOLS@; fi |
53 | if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi | |
54 | if [ -f Module.markers ]; then $(RM) Module.markers; fi | |
55 | ||
56 | modules_install: | |
6283f55e | 57 | @# Install the kernel modules |
d09f98a9 BB |
58 | $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \ |
59 | INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \ | |
bb9d808c AP |
60 | INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ |
61 | KERNELRELEASE=@LINUX_VERSION@ | |
fe0ed8f9 | 62 | @# Remove extraneous build products when packaging |
d09f98a9 | 63 | kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \ |
b0fe1ade | 64 | if [ -n "$(DESTDIR)" ]; then \ |
d09f98a9 | 65 | find $$kmoddir -name 'modules.*' | xargs $(RM); \ |
fe0ed8f9 | 66 | fi |
d09f98a9 | 67 | sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \ |
c9c0d073 BB |
68 | if [ -f $$sysmap ]; then \ |
69 | depmod -ae -F $$sysmap @LINUX_VERSION@; \ | |
70 | fi | |
c9c0d073 BB |
71 | |
72 | modules_uninstall: | |
6283f55e | 73 | @# Uninstall the kernel modules |
d09f98a9 BB |
74 | kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@ |
75 | list='$(subdir-m)'; for subdir in $$list; do \ | |
76 | $(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \ | |
77 | done | |
c9c0d073 BB |
78 | |
79 | distdir: | |
47a4a6fd | 80 | list='$(subdir-m)'; for subdir in $$list; do \ |
0b04990a | 81 | (cd @top_srcdir@/module && find $$subdir -name '*.c' -o -name '*.h' -o -name '*.S' |\ |
e254c8d8 | 82 | xargs cp --parents -t $$distdir); \ |
47a4a6fd | 83 | done |
c9c0d073 BB |
84 | |
85 | distclean maintainer-clean: clean | |
86 | install: modules_install | |
87 | uninstall: modules_uninstall | |
88 | all: modules | |
89 | check: |