-HOST_ARCH?=$(shell uname -p)
+TARGET_ARCH?=$(shell uname -p)
BUILD_TYPE?=Debug
-# make HOST and TYPE to lowercase
-HOST_ARCH_LC=$(shell echo $(HOST_ARCH) | tr A-Z a-z)
+# make TARGET and TYPE to lowercase
+TARGET_ARCH_LC=$(shell echo $(TARGET_ARCH) | tr A-Z a-z)
BUILD_TYPE_LC=$(shell echo $(BUILD_TYPE) | tr A-Z a-z)
# we need base name 'arm` for all arm arch
-HOST_ARCH_BASE=$(HOST_ARCH_LC)
-ifneq (,$(findstring arm,$(HOST_ARCH_BASE)))
- HOST_ARCH_BASE=arm
+TARGET_ARCH_BASE=$(TARGET_ARCH_LC)
+ifneq (,$(findstring arm,$(TARGET_ARCH_BASE)))
+ TARGET_ARCH_BASE=arm
ifdef ROOTFS_DIR
ROOTFS_ARM=$(ROOTFS_DIR)
export ROOTFS_ARM
endif
endif
# the toolchain file
-TOOLCHAIN_FILE=cmake/arch/$(HOST_ARCH_BASE)/config_$(HOST_ARCH_LC)-linux.cmake
+TOOLCHAIN_FILE=cmake/arch/$(TARGET_ARCH_BASE)/config_$(TARGET_ARCH_LC)-linux.cmake
WORKHOME=Product
-WORKFOLDER=$(HOST_ARCH_LC)-linux.$(BUILD_TYPE_LC)
+WORKFOLDER=$(TARGET_ARCH_LC)-linux.$(BUILD_TYPE_LC)
WORKDIR=$(WORKHOME)/$(WORKFOLDER)
BUILD_ROOT=$(WORKDIR)/obj
mkdir -p $(BUILD_ROOT)
cmake -B$(CURDIR)/$(BUILD_ROOT) -H$(CURDIR) \
-DCMAKE_INSTALL_PREFIX=$(INSTALL_PATH) \
- -DCMAKE_BUILD_TYPE=$(BUILD_TYPE_LC) -DHOST_ARCH=$(HOST_ARCH_LC) \
+ -DCMAKE_BUILD_TYPE=$(BUILD_TYPE_LC) -DHOST_ARCH=$(TARGET_ARCH_LC) \
-DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE)
touch $(TIMESTAMP_CONFIGURE)
## Cross build for ARM
-Give `HOST_ARCH` variable to set the host architecture
+Give `TARGET_ARCH` variable to set the target architecture
```
-HOST_ARCH=armv7l make
-HOST_ARCH=armv7l make install
+TARGET_ARCH=armv7l make
+TARGET_ARCH=armv7l make install
```
- supports only `armv7l` for now
If you used `ROOTFS_DIR` to prepare in alternative folder,
you should also give this to makefile.
```
-ROOTFS_DIR=/home/user/rootfs/arm-xenial BUILD_HOST=armv7l make
-ROOTFS_DIR=/home/user/rootfs/arm-xenial BUILD_HOST=armv7l make install
+ROOTFS_DIR=/home/user/rootfs/arm-xenial TARGET_ARCH=armv7l make
+ROOTFS_DIR=/home/user/rootfs/arm-xenial TARGET_ARCH=armv7l make install
```
# Other how-to documents