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