Add script for builtin module building.

This commit introduces a "copy-builtin" script designed to prepare a
kernel source tree for building SPL as a builtin module. The script
makes a full copy of all needed files, thus making the kernel source
tree fully independent of the spl source package.

To achieve that, some compilation flags (-include, -I) have been moved
to module/Makefile. This Makefile is only used when compiling external
modules; when compiling builtin modules, a Kbuild file generated by the
configure-builtin script is used instead. This makes sure Makefiles
inside the kernel source tree does not contain references to the spl
source package.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue zfsonlinux/zfs#851
This commit is contained in:
Etienne Dechamps
2012-07-09 11:10:31 +02:00
committed by Brian Behlendorf
parent 723aa3b0c2
commit c167aadb27
5 changed files with 137 additions and 9 deletions
+5 -1
View File
@@ -3,8 +3,12 @@ subdir-m += splat
INSTALL=/usr/bin/install
SPL_MODULE_CFLAGS = -I@abs_top_srcdir@/include
SPL_MODULE_CFLAGS += -include @abs_top_builddir@/spl_config.h
export SPL_MODULE_CFLAGS
modules:
$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@
$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_SPL=m $@
clean:
@# Only cleanup the kernel build directories when CONFIG_KERNEL
+2 -4
View File
@@ -1,12 +1,10 @@
# Makefile.in for spl kernel module
MODULE := spl
EXTRA_CFLAGS = @KERNELCPPFLAGS@
EXTRA_CFLAGS += -I@abs_top_srcdir@/include
EXTRA_CFLAGS += -include @abs_top_builddir@/spl_config.h
EXTRA_CFLAGS = $(SPL_MODULE_CFLAGS) @KERNELCPPFLAGS@
# Solaris porting layer module
obj-m := $(MODULE).o
obj-$(CONFIG_SPL) := $(MODULE).o
$(MODULE)-objs += @top_srcdir@/module/spl/spl-debug.o
$(MODULE)-objs += @top_srcdir@/module/spl/spl-proc.o
+2 -4
View File
@@ -1,12 +1,10 @@
# Makefile.in for splat kernel module
MODULE := splat
EXTRA_CFLAGS = @KERNELCPPFLAGS@
EXTRA_CFLAGS += -I@abs_top_srcdir@/include
EXTRA_CFLAGS += -include @abs_top_builddir@/spl_config.h
EXTRA_CFLAGS = $(SPL_MODULE_CFLAGS) @KERNELCPPFLAGS@
# Solaris Porting LAyer Tests
obj-m := $(MODULE).o
obj-$(CONFIG_SPL) := $(MODULE).o
$(MODULE)-objs += @top_srcdir@/module/splat/splat-ctl.o
$(MODULE)-objs += @top_srcdir@/module/splat/splat-kmem.o