]>
Commit | Line | Data |
---|---|---|
c9c0d073 BB |
1 | subdir-m += avl |
2 | subdir-m += nvpair | |
3 | subdir-m += unicode | |
4 | subdir-m += zcommon | |
5 | subdir-m += zfs | |
302ef151 | 6 | subdir-m += zpios |
c9c0d073 | 7 | |
2ee4a18b ED |
8 | ZFS_MODULE_CFLAGS += -include @SPL_OBJ@/spl_config.h |
9 | ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h | |
10 | ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include -I@SPL@/include -I@SPL@ | |
11 | export ZFS_MODULE_CFLAGS | |
12 | ||
c9c0d073 | 13 | modules: |
6283f55e BB |
14 | @# Make the exported SPL symbols available to these modules. |
15 | @# They may be in the root of SPL_OBJ when building against | |
16 | @# installed devel headers, or they may be in the module | |
17 | @# subdirectory when building against the spl source tree. | |
18 | @if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \ | |
19 | /bin/cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \ | |
20 | elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \ | |
21 | /bin/cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \ | |
22 | else \ | |
23 | echo -e "\n" \ | |
24 | "*** Missing spl symbols ensure you have built the spl:\n" \ | |
25 | "*** - @SPL_OBJ@/@SPL_SYMBOLS@, or\n" \ | |
26 | "*** - @SPL_OBJ@/module/@SPL_SYMBOLS@\n"; \ | |
27 | exit 1; \ | |
28 | fi | |
2ee4a18b | 29 | $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_ZFS=m $@ |
c9c0d073 BB |
30 | |
31 | clean: | |
d433c206 BB |
32 | @# Only cleanup the kernel build directories when CONFIG_KERNEL |
33 | @# is defined. This indicates that kernel modules should be built. | |
34 | @CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@ | |
35 | ||
c9c0d073 BB |
36 | if [ -f @SPL_SYMBOLS@ ]; then $(RM) @SPL_SYMBOLS@; fi |
37 | if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi | |
38 | if [ -f Module.markers ]; then $(RM) Module.markers; fi | |
39 | ||
40 | modules_install: | |
6283f55e | 41 | @# Install the kernel modules |
c9c0d073 BB |
42 | $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` \ |
43 | INSTALL_MOD_PATH=$(DESTDIR) \ | |
44 | INSTALL_MOD_DIR=addon/zfs $@ | |
fe0ed8f9 BB |
45 | @# Remove extraneous build products when packaging |
46 | if [ -n "$(DESTDIR)" ]; then \ | |
47 | find $(DESTDIR)/lib/modules/@LINUX_VERSION@ \ | |
48 | -name 'modules.*' | xargs $(RM); \ | |
49 | fi | |
6283f55e | 50 | sysmap=$(DESTDIR)/boot/System.map-@LINUX_VERSION@; \ |
c9c0d073 BB |
51 | if [ -f $$sysmap ]; then \ |
52 | depmod -ae -F $$sysmap @LINUX_VERSION@; \ | |
53 | fi | |
c9c0d073 BB |
54 | |
55 | modules_uninstall: | |
6283f55e BB |
56 | @# Uninstall the kernel modules |
57 | $(RM) -R $(DESTDIR)/lib/modules/@LINUX_VERSION@/addon/zfs | |
c9c0d073 BB |
58 | |
59 | distdir: | |
c9c0d073 BB |
60 | |
61 | distclean maintainer-clean: clean | |
62 | install: modules_install | |
63 | uninstall: modules_uninstall | |
64 | all: modules | |
65 | check: |