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