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