3 INSTALL_MOD_DIR ?
= extra
5 SUBDIR_TARGETS
= icp lua
8 distclean maintainer-clean
: clean
9 install: modules_install
10 uninstall: modules_uninstall
13 # Filter out options that FreeBSD make doesn't understand
16 $(filter-out --%,$(firstword $(MFLAGS
))) \
17 $(filter -I
%,$(MFLAGS
)) \
18 $(filter -j
%,$(MFLAGS
)); \
20 while getopts
:deiI
:j
:knqrstw flag
; do \
23 :) if
[ $$OPTARG = "j" ]; then \
24 ncpus
=$$(sysctl
-n kern.smp.cpus
2>/dev
/null ||
:); \
25 if
[ -n
"$$ncpus" ]; then fmakeflags
="$$fmakeflags -j$$ncpus"; fi
; \
27 d
) fmakeflags
="$$fmakeflags -dA";; \
28 *) fmakeflags
="$$fmakeflags -$$flag$$OPTARG";; \
33 FMAKEFLAGS
= -C @abs_srcdir@
-f Makefile.bsd
$(shell $(getflags
))
35 ifneq (@abs_srcdir@
,@abs_builddir@
)
36 FMAKEFLAGS
+= MAKEOBJDIR
=@abs_builddir@
38 FMAKE
= env
-u MAKEFLAGS make
$(FMAKEFLAGS
)
41 list
='$(SUBDIR_TARGETS)'; for targetdir in
$$list; do \
42 $(MAKE
) -C
$$targetdir; \
44 $(MAKE
) -C @LINUX_OBJ@ M
=`pwd` @KERNEL_MAKE@ CONFIG_ZFS
=m modules
52 modules
: modules-@ac_system@
55 @
# Only cleanup the kernel build directories when CONFIG_KERNEL
56 @
# is defined. This indicates that kernel modules should be built.
57 @CONFIG_KERNEL_TRUE@
$(MAKE
) -C @LINUX_OBJ@ M
=`pwd` @KERNEL_MAKE@
clean
59 if
[ -f @LINUX_SYMBOLS@
]; then
$(RM
) @LINUX_SYMBOLS@
; fi
60 if
[ -f Module.markers
]; then
$(RM
) Module.markers
; fi
62 find .
-name
'*.ur-safe' -type f
-print | xargs
$(RM
)
67 clean: clean-@ac_system@
69 modules_install-Linux
:
70 @
# Install the kernel modules
71 $(MAKE
) -C @LINUX_OBJ@ M
=`pwd` modules_install \
72 INSTALL_MOD_PATH
=$(DESTDIR
)$(INSTALL_MOD_PATH
) \
73 INSTALL_MOD_DIR
=$(INSTALL_MOD_DIR
) \
74 KERNELRELEASE
=@LINUX_VERSION@
75 @
# Remove extraneous build products when packaging
76 kmoddir
=$(DESTDIR
)$(INSTALL_MOD_PATH
)/lib
/modules
/@LINUX_VERSION@
; \
77 if
[ -n
"$(DESTDIR)" ]; then \
78 find
$$kmoddir -name
'modules.*' | xargs
$(RM
); \
80 sysmap
=$(DESTDIR
)$(INSTALL_MOD_PATH
)/boot
/System.map-@LINUX_VERSION@
; \
81 if
[ -f
$$sysmap ]; then \
82 depmod
-ae
-F
$$sysmap @LINUX_VERSION@
; \
86 ctags-am
: $(TAGS_DEPENDENCIES
) $(am__tagged_files
)
87 $(am__define_uniq_tagged_files
); \
88 test -z
"$(CTAGS_ARGS)$$unique" \
89 ||
$(CTAGS
) $(CTAGSFLAGS
) $(AM_CTAGSFLAGS
) $(CTAGS_ARGS
) \
93 here
=`$(am__cd) $(top_builddir) && pwd` \
94 && $(am__cd
) $(top_srcdir
) \
95 && gtags
-i
$(GTAGS_ARGS
) "$$here"
96 cscopelist
: cscopelist-recursive
98 cscopelist-am
: $(am__tagged_files
)
99 list
='$(am__tagged_files)'; \
100 case
"$(srcdir)" in \
101 [\\/]* | ?
:[\\/]*) sdir
="$(srcdir)" ;; \
102 *) sdir
=$(subdir
)/$(srcdir) ;; \
104 for i in
$$list; do \
105 if
test -f
"$$i"; then \
106 echo
"$(subdir)/$$i"; \
110 done
>> $(top_builddir
)/cscope.files
112 modules_install-FreeBSD
:
113 @
# Install the kernel modules
116 modules_install
: modules_install-@ac_system@
118 modules_uninstall-Linux
:
119 @
# Uninstall the kernel modules
120 kmoddir
=$(DESTDIR
)$(INSTALL_MOD_PATH
)/lib
/modules
/@LINUX_VERSION@
121 list
='$(ZFS_MODULES)'; for objdir in
$$list; do \
122 $(RM
) -R
$$kmoddir/$(INSTALL_MOD_DIR
)/$$objdir; \
125 modules_uninstall-FreeBSD
:
128 modules_uninstall
: modules_uninstall-@ac_system@
131 list
='$(ZFS_MODULES)'; for objdir in
$$list os
/linux
/spl os
/linux
/zfs
; do \
132 (cd @top_srcdir@
/module
&& find
$$objdir -name
'*.[chS]' | \
133 while read path
; do \
134 mkdir
-p @abs_top_builddir@
/module
/$$distdir/$${path
%/*}; \
135 cp
$$path @abs_top_builddir@
/module
/$$distdir/$$path; \