]>
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 |
0b04990a | 7 | subdir-m += icp |
c9c0d073 | 8 | |
d09f98a9 BB |
9 | INSTALL_MOD_DIR ?= extra |
10 | ||
2ee4a18b ED |
11 | ZFS_MODULE_CFLAGS += -include @SPL_OBJ@/spl_config.h |
12 | ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h | |
13 | ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include -I@SPL@/include -I@SPL@ | |
14 | export ZFS_MODULE_CFLAGS | |
15 | ||
0b04990a TC |
16 | SUBDIR_TARGETS = icp |
17 | ||
c9c0d073 | 18 | modules: |
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 \ | |
24 | /bin/cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \ | |
25 | elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \ | |
26 | /bin/cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \ | |
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 | |
39 | clean: | |
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 | ||
48 | modules_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 | |
64 | modules_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 | |
71 | distdir: | |
47a4a6fd | 72 | list='$(subdir-m)'; for subdir in $$list; do \ |
0b04990a TC |
73 | (cd @top_srcdir@/module && find $$subdir -name '*.c' -o -name '*.h' -o -name '*.S' |\ |
74 | xargs /bin/cp --parents -t $$distdir); \ | |
47a4a6fd | 75 | done |
c9c0d073 BB |
76 | |
77 | distclean maintainer-clean: clean | |
78 | install: modules_install | |
79 | uninstall: modules_uninstall | |
80 | all: modules | |
81 | check: |