diff --git a/README.cross-compilation b/README.cross-compilation new file mode 100644 index 000000000..9e6e4ca0f --- /dev/null +++ b/README.cross-compilation @@ -0,0 +1,24 @@ +Cross-compilation is the process of compiling code for one architecture (often +called the target) on a different system, usually called the host. +Cross-compilation of SCST is possible as follows: +1. Download the Linux kernel source code and also the SCST source code. +2. Install the appropriate cross-compiler, e.g. as follows: + + zypper install cross-arm-gcc9 + +3. Store the cross-compilation prefix and architecture names in the + CROSS_COMPILE and ARCH environment variables, e.g. as follows: + + export CROSS_COMPILE=/usr/bin/arm-suse-linux-gnueabi- + export ARCH=arm + +4. Build the Linux kernel. + + cd $HOME/software/linux-kernel + make + +5. Cross-compile SCST using any of the supported build methods. An example: + + export KDIR=$HOME/software/linux-kernel + cd scst.git + make rpm diff --git a/fcst/Makefile b/fcst/Makefile index ac6e640d4..ab7a71f4d 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -46,7 +46,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 6c488c141..9302197ba 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -34,7 +34,9 @@ ifeq ($(KVER),) endif endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/qla2x00t-32gbit/Makefile b/qla2x00t-32gbit/Makefile index 2cc88c31f..dd4f889cc 100644 --- a/qla2x00t-32gbit/Makefile +++ b/qla2x00t-32gbit/Makefile @@ -35,7 +35,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/qla2x00t-32gbit/qla2x00-target/Makefile b/qla2x00t-32gbit/qla2x00-target/Makefile index 94598660a..e541e9da3 100644 --- a/qla2x00t-32gbit/qla2x00-target/Makefile +++ b/qla2x00t-32gbit/qla2x00-target/Makefile @@ -44,7 +44,9 @@ ifeq ($(KVER),) endif endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index 0dce532fa..ce1ba74c6 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -34,7 +34,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index d6f3f0888..89c239c25 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -43,7 +43,9 @@ ifeq ($(KVER),) endif endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/scst/src/Makefile b/scst/src/Makefile index 240a6061d..d611cb71f 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -45,7 +45,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index bddc1a87f..f6c2242ab 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -39,7 +39,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/scst_local/Makefile b/scst_local/Makefile index 5dba991dc..22273223a 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -20,7 +20,9 @@ ifeq ($(KVER),) make -s -C $(KDIR) kernelversion)) endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),) diff --git a/srpt/Makefile b/srpt/Makefile index d96d6df9b..1d2da90c1 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -22,7 +22,9 @@ ifeq ($(KVER),) endif endif else - KDIR := /lib/modules/$(KVER)/build + ifeq ($(KDIR),) + KDIR := /lib/modules/$(KVER)/build + endif endif ifeq ($(INSTALL_MOD_PATH),)