From 32ef2905ac5e46c20367dcc91f537e10d44a4a0b Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 15:01:05 +0800 Subject: [PATCH 1/6] support make install --- Makefile | 84 ++++++++++++++++++++++++++++++++++++++++++++++ install_offline.sh | 22 ++++++++++++ install_online.sh | 22 ++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 Makefile create mode 100644 install_offline.sh create mode 100644 install_online.sh diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..65d62ef2b --- /dev/null +++ b/Makefile @@ -0,0 +1,84 @@ +PROFILE_PATH ?= ~/.profile +STANDALONE_ROOT ?= $(shell pwd) +INSTALL_PATH ?= $(STANDALONE_ROOT)/tools/ + +A32_CC_PACK ?= $(STANDALONE_ROOT)/tools/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 +A32_CC_URL ?= https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz +AARCH32_CROSS_PATH ?= $(STANDALONE_ROOT)/tools/gcc-arm-none-eabi-10-2020-q4-major + +A64_CC_PACK ?= $(STANDALONE_ROOT)/tools/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz +A64_CC_URL ?= https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020.11/binrel/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz +AARCH64_CROSS_PATH ?= $(STANDALONE_ROOT)/tools/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf + +.PHONY: uninstall setup register a32cc_register a32cc_offline a32cc_online a64cc_register a64cc_offline a64cc_online + +uninstall: + $(shell sed -i '/export SDK_ROOT=/d' $(PROFILE_PATH)) + $(shell sed -i '/export AARCH32_CROSS_PATH=/d' $(PROFILE_PATH)) + $(shell sed -i '/export PATH=\$$PATH:\$$AARCH32_CROSS_PATH/d' $(PROFILE_PATH)) + $(shell sed -i '/export AARCH64_CROSS_PATH=/d' $(PROFILE_PATH)) + $(shell sed -i '/export PATH=\$$PATH:\$$AARCH64_CROSS_PATH/d' $(PROFILE_PATH)) + @echo ======Uninstall Standalone SDK successed !!! + +setup: +# make sure sdk scripts are executable + $(shell chmod +x $(STANDALONE_ROOT)/*.sh --silent) + $(shell chmod +x $(STANDALONE_ROOT)/scripts/*.sh --silent) + $(shell chmod +x $(STANDALONE_ROOT)/make/*.mk --silent) + $(shell chmod +x $(STANDALONE_ROOT)/tools/Kconfiglib/*.py --silent) + @echo ======Standalone SDK Setup Done !!! + +register: + $(shell echo "export SDK_ROOT=$(STANDALONE_ROOT)" >> $(PROFILE_PATH)) + @echo ======Install Standalone SDK at $(STANDALONE_ROOT) !!! + +a32cc_register: + $(shell echo "export AARCH32_CROSS_PATH=$(AARCH32_CROSS_PATH)" >> $(PROFILE_PATH)) + $(shell echo "export PATH=\$$PATH:\$$AARCH32_CROSS_PATH/bin">> $(PROFILE_PATH)) + @echo ======Install AARCH32 Compiler at $(AARCH32_CROSS_PATH) !!! + +a32cc_offline: +ifeq ("$(wildcard $(AARCH32_CROSS_PATH))", "$(AARCH32_CROSS_PATH)") + @echo ======AARCH32 Compiler Already Installed !!! +else +ifeq ("$(wildcard $(A32_CC_PACK))", "$(A32_CC_PACK)") + @tar -C $(INSTALL_PATH) -jxvf $(A32_CC_PACK) +else + $(error error, Please put $(A32_CC_PACK) first!!) +endif +endif + +a32cc_online: + $(shell [ ! -d $(AARCH32_CROSS_PATH) ] && \ + [ ! -f $(A32_CC_PACK) ] && \ + wget -P $(A32_CC_PACK) $(A32_CC_URL)) + make a32cc_offline + +a64cc_register: + $(shell echo "export AARCH64_CROSS_PATH=$(AARCH64_CROSS_PATH)" >> $(PROFILE_PATH)) + $(shell echo "export PATH=\$$PATH:\$$AARCH64_CROSS_PATH/bin">> $(PROFILE_PATH)) + @echo ======Install AARCH64 Compiler at $(AARCH64_CROSS_PATH) !!! + +a64cc_offline: +ifeq ("$(wildcard $(AARCH64_CROSS_PATH))", "$(AARCH64_CROSS_PATH)") + @echo ======AARCH64 Compiler Already Installed !!! +else +ifeq ("$(wildcard $(A64_CC_PACK))", "$(A64_CC_PACK)") + @tar -C $(INSTALL_PATH) -vxf $(A64_CC_PACK) +else + $(error error, Please put $(A64_CC_PACK) first!!) +endif +endif + +a64cc_online: + $(shell [ ! -d $(AARCH64_CROSS_PATH) ] && \ + [ ! -f $(A64_CC_PACK) ] && \ + wget -P $(A64_CC_PACK) $(A64_CC_URL)) + make a64cc_offline + +.PHONY: install_offline install_online +install_offline: + ./install_offline.sh + +install_online: + ./install_online.sh \ No newline at end of file diff --git a/install_offline.sh b/install_offline.sh new file mode 100644 index 000000000..00fe98611 --- /dev/null +++ b/install_offline.sh @@ -0,0 +1,22 @@ +### + # @ : Copyright (c) 2021 Phytium Information Technology, Inc. + # + # SPDX-License-Identifier: Apache-2.0. + # + # @Date: 2021-07-07 13:57:31 + # @LastEditTime: 2021-07-07 15:00:11 + # @Description:  This files is for + # + # @Modify History: + # Ver   Who        Date         Changes + # ----- ------     --------    -------------------------------------- +### +#!/bin/sh + +make uninstall -s +make setup -s +make a32cc_offline -s +make a32cc_register -s +make a64cc_offline -s +make a64cc_register -s +make register -s \ No newline at end of file diff --git a/install_online.sh b/install_online.sh new file mode 100644 index 000000000..70ca5352a --- /dev/null +++ b/install_online.sh @@ -0,0 +1,22 @@ +### + # @ : Copyright (c) 2021 Phytium Information Technology, Inc. + # + # SPDX-License-Identifier: Apache-2.0. + # + # @Date: 2021-07-07 13:57:31 + # @LastEditTime: 2021-07-07 14:49:48 + # @Description:  This files is for + # + # @Modify History: + # Ver   Who        Date         Changes + # ----- ------     --------    -------------------------------------- +### +#!/bin/sh + +make uninstall -s +make setup -s +make a32cc_online -s +make a32cc_register -s +make a64cc_online -s +make a64cc_register -s +make register -s \ No newline at end of file -- Gitee From dd83b09f01171380b6bbe81208d51095d297ac78 Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 15:41:54 +0800 Subject: [PATCH 2/6] make install --- Makefile | 6 +++++- install_offline.sh | 4 +--- install_online.sh | 7 ++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 65d62ef2b..a5b0ef74f 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,11 @@ a64cc_online: .PHONY: install_offline install_online install_offline: + @chmod +x ./install_offline.sh ./register.sh ./install_offline.sh + ./register.sh install_online: - ./install_online.sh \ No newline at end of file + @chmod +x ./install_online.sh ./register.sh + ./install_online.sh + ./register.sh \ No newline at end of file diff --git a/install_offline.sh b/install_offline.sh index 00fe98611..19bc7fdd9 100644 --- a/install_offline.sh +++ b/install_offline.sh @@ -17,6 +17,4 @@ make uninstall -s make setup -s make a32cc_offline -s make a32cc_register -s -make a64cc_offline -s -make a64cc_register -s -make register -s \ No newline at end of file +make a64cc_offline -s \ No newline at end of file diff --git a/install_online.sh b/install_online.sh index 70ca5352a..d80fef8e0 100644 --- a/install_online.sh +++ b/install_online.sh @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0. # # @Date: 2021-07-07 13:57:31 - # @LastEditTime: 2021-07-07 14:49:48 + # @LastEditTime: 2021-07-07 15:35:44 # @Description:  This files is for # # @Modify History: @@ -16,7 +16,4 @@ make uninstall -s make setup -s make a32cc_online -s -make a32cc_register -s -make a64cc_online -s -make a64cc_register -s -make register -s \ No newline at end of file +make a64cc_online -s \ No newline at end of file -- Gitee From 20730f246dfe8871429cf040e1071037d304c5d8 Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 15:42:34 +0800 Subject: [PATCH 3/6] make register --- register.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 register.sh diff --git a/register.sh b/register.sh new file mode 100644 index 000000000..40a10d8f1 --- /dev/null +++ b/register.sh @@ -0,0 +1,17 @@ +### + # @ : Copyright (c) 2021 Phytium Information Technology, Inc. + # + # SPDX-License-Identifier: Apache-2.0. + # + # @Date: 2021-07-07 15:35:14 + # @LastEditTime: 2021-07-07 15:40:06 + # @Description:  This files is for + # + # @Modify History: + # Ver   Who        Date         Changes + # ----- ------     --------    -------------------------------------- +### + +make a32cc_register -s +make a64cc_register -s +make register -s \ No newline at end of file -- Gitee From b0a1d2aa29f3208d530a6c6ca4e6e6b98c35f62f Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 15:44:06 +0800 Subject: [PATCH 4/6] ignore sdkconfig.old --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 80a123412..558417429 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ app* *.su *.idb *.pdb +*.old # Kernel Module Compile Results *.mod* -- Gitee From ab1a79d78779d48f02e1a6b5bcc23f75c4507f09 Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 16:59:49 +0800 Subject: [PATCH 5/6] remove make install --- Makefile | 88 ---------------------------------------------- README.md | 6 ++-- install_offline.sh | 20 ----------- install_online.sh | 19 ---------- register.sh | 17 --------- 5 files changed, 3 insertions(+), 147 deletions(-) delete mode 100644 Makefile delete mode 100644 install_offline.sh delete mode 100644 install_online.sh delete mode 100644 register.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index a5b0ef74f..000000000 --- a/Makefile +++ /dev/null @@ -1,88 +0,0 @@ -PROFILE_PATH ?= ~/.profile -STANDALONE_ROOT ?= $(shell pwd) -INSTALL_PATH ?= $(STANDALONE_ROOT)/tools/ - -A32_CC_PACK ?= $(STANDALONE_ROOT)/tools/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -A32_CC_URL ?= https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz -AARCH32_CROSS_PATH ?= $(STANDALONE_ROOT)/tools/gcc-arm-none-eabi-10-2020-q4-major - -A64_CC_PACK ?= $(STANDALONE_ROOT)/tools/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz -A64_CC_URL ?= https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020.11/binrel/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz -AARCH64_CROSS_PATH ?= $(STANDALONE_ROOT)/tools/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf - -.PHONY: uninstall setup register a32cc_register a32cc_offline a32cc_online a64cc_register a64cc_offline a64cc_online - -uninstall: - $(shell sed -i '/export SDK_ROOT=/d' $(PROFILE_PATH)) - $(shell sed -i '/export AARCH32_CROSS_PATH=/d' $(PROFILE_PATH)) - $(shell sed -i '/export PATH=\$$PATH:\$$AARCH32_CROSS_PATH/d' $(PROFILE_PATH)) - $(shell sed -i '/export AARCH64_CROSS_PATH=/d' $(PROFILE_PATH)) - $(shell sed -i '/export PATH=\$$PATH:\$$AARCH64_CROSS_PATH/d' $(PROFILE_PATH)) - @echo ======Uninstall Standalone SDK successed !!! - -setup: -# make sure sdk scripts are executable - $(shell chmod +x $(STANDALONE_ROOT)/*.sh --silent) - $(shell chmod +x $(STANDALONE_ROOT)/scripts/*.sh --silent) - $(shell chmod +x $(STANDALONE_ROOT)/make/*.mk --silent) - $(shell chmod +x $(STANDALONE_ROOT)/tools/Kconfiglib/*.py --silent) - @echo ======Standalone SDK Setup Done !!! - -register: - $(shell echo "export SDK_ROOT=$(STANDALONE_ROOT)" >> $(PROFILE_PATH)) - @echo ======Install Standalone SDK at $(STANDALONE_ROOT) !!! - -a32cc_register: - $(shell echo "export AARCH32_CROSS_PATH=$(AARCH32_CROSS_PATH)" >> $(PROFILE_PATH)) - $(shell echo "export PATH=\$$PATH:\$$AARCH32_CROSS_PATH/bin">> $(PROFILE_PATH)) - @echo ======Install AARCH32 Compiler at $(AARCH32_CROSS_PATH) !!! - -a32cc_offline: -ifeq ("$(wildcard $(AARCH32_CROSS_PATH))", "$(AARCH32_CROSS_PATH)") - @echo ======AARCH32 Compiler Already Installed !!! -else -ifeq ("$(wildcard $(A32_CC_PACK))", "$(A32_CC_PACK)") - @tar -C $(INSTALL_PATH) -jxvf $(A32_CC_PACK) -else - $(error error, Please put $(A32_CC_PACK) first!!) -endif -endif - -a32cc_online: - $(shell [ ! -d $(AARCH32_CROSS_PATH) ] && \ - [ ! -f $(A32_CC_PACK) ] && \ - wget -P $(A32_CC_PACK) $(A32_CC_URL)) - make a32cc_offline - -a64cc_register: - $(shell echo "export AARCH64_CROSS_PATH=$(AARCH64_CROSS_PATH)" >> $(PROFILE_PATH)) - $(shell echo "export PATH=\$$PATH:\$$AARCH64_CROSS_PATH/bin">> $(PROFILE_PATH)) - @echo ======Install AARCH64 Compiler at $(AARCH64_CROSS_PATH) !!! - -a64cc_offline: -ifeq ("$(wildcard $(AARCH64_CROSS_PATH))", "$(AARCH64_CROSS_PATH)") - @echo ======AARCH64 Compiler Already Installed !!! -else -ifeq ("$(wildcard $(A64_CC_PACK))", "$(A64_CC_PACK)") - @tar -C $(INSTALL_PATH) -vxf $(A64_CC_PACK) -else - $(error error, Please put $(A64_CC_PACK) first!!) -endif -endif - -a64cc_online: - $(shell [ ! -d $(AARCH64_CROSS_PATH) ] && \ - [ ! -f $(A64_CC_PACK) ] && \ - wget -P $(A64_CC_PACK) $(A64_CC_URL)) - make a64cc_offline - -.PHONY: install_offline install_online -install_offline: - @chmod +x ./install_offline.sh ./register.sh - ./install_offline.sh - ./register.sh - -install_online: - @chmod +x ./install_online.sh ./register.sh - ./install_online.sh - ./register.sh \ No newline at end of file diff --git a/README.md b/README.md index 5aa277779..756ff63b0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0. * * @Date: 2021-07-01 18:12:33 - * @LastEditTime: 2021-07-05 15:17:27 + * @LastEditTime: 2021-07-07 15:50:44 * @Description:  This files is for * * @Modify History: @@ -33,7 +33,7 @@ $ cd ./ft_sdk - 选择在线方式安装Standalone SDK在~/ft_sdk ``` -$ ./export.sh -online +$ make install_online ``` ![download cc](https://images.gitee.com/uploads/images/2021/0701/190528_d93eb2f0_8736513.png "download cc.png") @@ -44,7 +44,7 @@ $ ./export.sh -online - 将下载的编译器安装包放置在'~/ft_sdk/tools'路径下 - 安装SDK开发环境,没有打印错误信息表示安装成功 ``` -$ ./export.sh +$ make install_offline Please type in 'source ./export.sh' Phytium Embedded SDK Setup Done!! Install AARCH32 Compiler at /home/ubuntu/ft_sdk/tools/gcc-arm-none-eabi-10-2020-q4-major diff --git a/install_offline.sh b/install_offline.sh deleted file mode 100644 index 19bc7fdd9..000000000 --- a/install_offline.sh +++ /dev/null @@ -1,20 +0,0 @@ -### - # @ : Copyright (c) 2021 Phytium Information Technology, Inc. - # - # SPDX-License-Identifier: Apache-2.0. - # - # @Date: 2021-07-07 13:57:31 - # @LastEditTime: 2021-07-07 15:00:11 - # @Description:  This files is for - # - # @Modify History: - # Ver   Who        Date         Changes - # ----- ------     --------    -------------------------------------- -### -#!/bin/sh - -make uninstall -s -make setup -s -make a32cc_offline -s -make a32cc_register -s -make a64cc_offline -s \ No newline at end of file diff --git a/install_online.sh b/install_online.sh deleted file mode 100644 index d80fef8e0..000000000 --- a/install_online.sh +++ /dev/null @@ -1,19 +0,0 @@ -### - # @ : Copyright (c) 2021 Phytium Information Technology, Inc. - # - # SPDX-License-Identifier: Apache-2.0. - # - # @Date: 2021-07-07 13:57:31 - # @LastEditTime: 2021-07-07 15:35:44 - # @Description:  This files is for - # - # @Modify History: - # Ver   Who        Date         Changes - # ----- ------     --------    -------------------------------------- -### -#!/bin/sh - -make uninstall -s -make setup -s -make a32cc_online -s -make a64cc_online -s \ No newline at end of file diff --git a/register.sh b/register.sh deleted file mode 100644 index 40a10d8f1..000000000 --- a/register.sh +++ /dev/null @@ -1,17 +0,0 @@ -### - # @ : Copyright (c) 2021 Phytium Information Technology, Inc. - # - # SPDX-License-Identifier: Apache-2.0. - # - # @Date: 2021-07-07 15:35:14 - # @LastEditTime: 2021-07-07 15:40:06 - # @Description:  This files is for - # - # @Modify History: - # Ver   Who        Date         Changes - # ----- ------     --------    -------------------------------------- -### - -make a32cc_register -s -make a64cc_register -s -make register -s \ No newline at end of file -- Gitee From a92b3866a0dc14a9178d9c55afdb91d4292a554e Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 17:02:14 +0800 Subject: [PATCH 6/6] rename install script --- README.md | 6 +++--- export.sh => install.sh | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename export.sh => install.sh (100%) diff --git a/README.md b/README.md index 756ff63b0..663654c97 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0. * * @Date: 2021-07-01 18:12:33 - * @LastEditTime: 2021-07-07 15:50:44 + * @LastEditTime: 2021-07-07 17:01:39 * @Description:  This files is for * * @Modify History: @@ -33,7 +33,7 @@ $ cd ./ft_sdk - 选择在线方式安装Standalone SDK在~/ft_sdk ``` -$ make install_online +$ ./install.sh -online ``` ![download cc](https://images.gitee.com/uploads/images/2021/0701/190528_d93eb2f0_8736513.png "download cc.png") @@ -44,7 +44,7 @@ $ make install_online - 将下载的编译器安装包放置在'~/ft_sdk/tools'路径下 - 安装SDK开发环境,没有打印错误信息表示安装成功 ``` -$ make install_offline +$ ./install.sh Please type in 'source ./export.sh' Phytium Embedded SDK Setup Done!! Install AARCH32 Compiler at /home/ubuntu/ft_sdk/tools/gcc-arm-none-eabi-10-2020-q4-major diff --git a/export.sh b/install.sh similarity index 100% rename from export.sh rename to install.sh -- Gitee