Cross compile variable: TARGET_ARCH
authorHyeongseok Oh <hseok82.oh@samsung.com>
Mon, 5 Mar 2018 09:52:54 +0000 (18:52 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 6 Mar 2018 01:28:22 +0000 (10:28 +0900)
Change HOST_ARCH to TARGET_ARCH that set build target architecture to avoid confusion
Fix readme: BUILD_HOST -> HOST_ARCH -> TARGET_ARCH

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
Makefile
README.md

index cbe7250..e15dae0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,23 @@
-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
@@ -55,7 +55,7 @@ configure_internal:
        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)
 
index 36b77b9..a80aa69 100644 (file)
--- a/README.md
+++ b/README.md
@@ -51,18 +51,18 @@ sudo ./tools/cross/build_rootfs.sh arm --skipproxy
 
 ## 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