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