]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - module/Makefile.in
module/Makefile.in: use relative cp
[FreeBSD/FreeBSD.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 subdir-m += icp
8
9 INSTALL_MOD_DIR ?= extra
10
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
16 SUBDIR_TARGETS = icp
17
18 modules:
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                 cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
25         elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
26                 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
34         list='$(SUBDIR_TARGETS)'; for targetdir in $$list; do \
35                 $(MAKE) -C $$targetdir; \
36         done
37         $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_ZFS=m $@
38
39 clean:
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
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:
49         @# Install the kernel modules
50         $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
51                 INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
52                 INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
53                 KERNELRELEASE=@LINUX_VERSION@
54         @# Remove extraneous build products when packaging
55         kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
56         if [ -n "$(DESTDIR)" ]; then \
57                 find $$kmoddir -name 'modules.*' | xargs $(RM); \
58         fi
59         sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
60         if [ -f $$sysmap ]; then \
61                 depmod -ae -F $$sysmap @LINUX_VERSION@; \
62         fi
63
64 modules_uninstall:
65         @# Uninstall the kernel modules
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
70
71 distdir:
72         list='$(subdir-m)'; for subdir in $$list; do \
73                 (cd @top_srcdir@/module && find $$subdir -name '*.c' -o -name '*.h' -o -name '*.S' |\
74                 xargs cp --parents -t $$distdir); \
75         done
76
77 distclean maintainer-clean: clean
78 install: modules_install
79 uninstall: modules_uninstall
80 all: modules
81 check: