Add -p switch to "zpool get"
[zfs.git] / module / Makefile.in
1 subdir-m += avl
2 subdir-m += nvpair
3 subdir-m += unicode
4 subdir-m += zcommon
5 subdir-m += zfs
6 subdir-m += zpios
7
8 INSTALL_MOD_DIR ?= extra
9
10 ZFS_MODULE_CFLAGS += -include @SPL_OBJ@/spl_config.h
11 ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h
12 ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include -I@SPL@/include -I@SPL@
13 export ZFS_MODULE_CFLAGS
14
15 modules:
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
31         $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_ZFS=m $@
32
33 clean:
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
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
42 modules_install:
43         @# Install the kernel modules
44         $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
45                 INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
46                 INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)
47         @# Remove extraneous build products when packaging
48         kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
49         if [ -n $$kmoddir ]; then \
50                 find $$kmoddir -name 'modules.*' | xargs $(RM); \
51         fi
52         sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
53         if [ -f $$sysmap ]; then \
54                 depmod -ae -F $$sysmap @LINUX_VERSION@; \
55         fi
56
57 modules_uninstall:
58         @# Uninstall the kernel modules
59         kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
60         list='$(subdir-m)'; for subdir in $$list; do \
61                 $(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
62         done
63
64 distdir:
65
66 distclean maintainer-clean: clean
67 install: modules_install
68 uninstall: modules_uninstall
69 all: modules
70 check: