]>
Commit | Line | Data |
---|---|---|
ff4b68ee DP |
1 | obj-m += avl/ |
2 | obj-m += icp/ | |
3 | obj-m += lua/ | |
4 | obj-m += nvpair/ | |
5 | obj-m += spl/ | |
bced7e3a | 6 | obj-m += os/linux/spl/ |
ff4b68ee DP |
7 | obj-m += unicode/ |
8 | obj-m += zcommon/ | |
9 | obj-m += zfs/ | |
bced7e3a | 10 | obj-m += os/linux/zfs/ |
c9c0d073 | 11 | |
d09f98a9 BB |
12 | INSTALL_MOD_DIR ?= extra |
13 | ||
fed90353 BB |
14 | ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement |
15 | ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@ | |
2ee4a18b | 16 | ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h |
006e9a40 MM |
17 | ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/kernel |
18 | ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/spl | |
19 | ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/zfs | |
93ce2b4c | 20 | ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include |
93ce2b4c | 21 | ZFS_MODULE_CPPFLAGS += -D_KERNEL |
fed90353 BB |
22 | ZFS_MODULE_CPPFLAGS += @KERNEL_DEBUG_CPPFLAGS@ |
23 | ||
6a9d6359 | 24 | @CONFIG_QAT_TRUE@ZFS_MODULE_CFLAGS += -I@QAT_SRC@/include |
25 | @CONFIG_QAT_TRUE@KBUILD_EXTRA_SYMBOLS += @QAT_SYMBOLS@ | |
fed90353 BB |
26 | |
27 | export ZFS_MODULE_CFLAGS ZFS_MODULE_CPPFLAGS | |
2ee4a18b | 28 | |
d99a0153 | 29 | SUBDIR_TARGETS = icp lua |
0b04990a | 30 | |
bced7e3a MM |
31 | all: modules |
32 | distclean maintainer-clean: clean | |
33 | install: modules_install | |
34 | uninstall: modules_uninstall | |
35 | check: | |
36 | ||
37 | modules-Linux: | |
0b04990a TC |
38 | list='$(SUBDIR_TARGETS)'; for targetdir in $$list; do \ |
39 | $(MAKE) -C $$targetdir; \ | |
40 | done | |
bced7e3a MM |
41 | $(MAKE) -C @LINUX_OBJ@ M=`pwd` @KERNEL_MAKE@ CONFIG_ZFS=m modules |
42 | ||
43 | modules-unknown: | |
44 | @true | |
45 | ||
46 | modules: modules-@ac_system@ | |
c9c0d073 | 47 | |
bced7e3a | 48 | clean-Linux: |
d433c206 BB |
49 | @# Only cleanup the kernel build directories when CONFIG_KERNEL |
50 | @# is defined. This indicates that kernel modules should be built. | |
bced7e3a | 51 | @CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ M=`pwd` @KERNEL_MAKE@ clean |
d433c206 | 52 | |
c9c0d073 BB |
53 | if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi |
54 | if [ -f Module.markers ]; then $(RM) Module.markers; fi | |
55 | ||
b669ab83 BB |
56 | find . -name '*.ur-safe' -type f -print | xargs $(RM) |
57 | ||
bced7e3a MM |
58 | clean: clean-@ac_system@ |
59 | ||
60 | modules_install-Linux: | |
6283f55e | 61 | @# Install the kernel modules |
bced7e3a | 62 | $(MAKE) -C @LINUX_OBJ@ M=`pwd` modules_install \ |
d09f98a9 | 63 | INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \ |
bb9d808c AP |
64 | INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ |
65 | KERNELRELEASE=@LINUX_VERSION@ | |
fe0ed8f9 | 66 | @# Remove extraneous build products when packaging |
d09f98a9 | 67 | kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \ |
b0fe1ade | 68 | if [ -n "$(DESTDIR)" ]; then \ |
d09f98a9 | 69 | find $$kmoddir -name 'modules.*' | xargs $(RM); \ |
fe0ed8f9 | 70 | fi |
d09f98a9 | 71 | sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \ |
c9c0d073 BB |
72 | if [ -f $$sysmap ]; then \ |
73 | depmod -ae -F $$sysmap @LINUX_VERSION@; \ | |
74 | fi | |
c9c0d073 | 75 | |
bced7e3a MM |
76 | CTAGS: ctags |
77 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) | |
78 | $(am__define_uniq_tagged_files); \ | |
79 | test -z "$(CTAGS_ARGS)$$unique" \ | |
80 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | |
81 | $$unique | |
82 | ||
83 | GTAGS: | |
84 | here=`$(am__cd) $(top_builddir) && pwd` \ | |
85 | && $(am__cd) $(top_srcdir) \ | |
86 | && gtags -i $(GTAGS_ARGS) "$$here" | |
87 | cscopelist: cscopelist-recursive | |
88 | ||
89 | cscopelist-am: $(am__tagged_files) | |
90 | list='$(am__tagged_files)'; \ | |
91 | case "$(srcdir)" in \ | |
92 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ | |
93 | *) sdir=$(subdir)/$(srcdir) ;; \ | |
94 | esac; \ | |
95 | for i in $$list; do \ | |
96 | if test -f "$$i"; then \ | |
97 | echo "$(subdir)/$$i"; \ | |
98 | else \ | |
99 | echo "$$sdir/$$i"; \ | |
100 | fi; \ | |
101 | done >> $(top_builddir)/cscope.files | |
102 | ||
103 | modules_install: modules_install-@ac_system@ | |
104 | ||
105 | modules_uninstall-Linux: | |
6283f55e | 106 | @# Uninstall the kernel modules |
d09f98a9 | 107 | kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@ |
ff4b68ee DP |
108 | list='$(obj-m)'; for objdir in $$list; do \ |
109 | $(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$objdir; \ | |
d09f98a9 | 110 | done |
c9c0d073 | 111 | |
bced7e3a MM |
112 | modules_uninstall: modules_uninstall-@ac_system@ |
113 | ||
c9c0d073 | 114 | distdir: |
ff4b68ee DP |
115 | list='$(obj-m)'; for objdir in $$list; do \ |
116 | (cd @top_srcdir@/module && find $$objdir \ | |
8f12a4f8 | 117 | -name '*.c' -o -name '*.h' -o -name '*.S' | \ |
7b509298 | 118 | xargs -r cp --parents -t @abs_top_builddir@/module/$$distdir); \ |
47a4a6fd | 119 | done |