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