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