diff --git a/Makefile b/Makefile index ffff51dbcdbea64d5ba2d68b6ef62c561b3ce9d6..5f099abf5a2923e75801201d4bfd901e5fb19115 100644 --- a/Makefile +++ b/Makefile @@ -106,16 +106,16 @@ setup: (cd tools; ./setup_tools.sh) .PHONY: test1 -test1: +test1: libcore python3 test/main.py test/testsuite/ouroboros/string_test/RT0001-rt-string-ReflectString/ReflectString.java --test_cfg=test/testsuite/ouroboros/test.cfg --fail-verbose --debug .PHONY: test_irbuild -test_irbuild: +test_irbuild: install python3 test/main.py test/testsuite/irbuild_test --test_cfg=test/testsuite/irbuild_test/test.cfg -j20 -pFAIL .PHONY: test_ourboros -test_ourboros: - python3 test/main.py test//testsuite/ouroboros --test_cfg=test/testsuite/ouroboros/test.cfg --timeout=180 -j20 --retry 1 --fail_exit -pFAIL +test_ourboros: libcore + python3 test/main.py test//testsuite/ouroboros --test_cfg=test/testsuite/ouroboros/test.cfg --timeout=180 -j20 --fail_exit -pFAIL .PHONY: testall testall: test_irbuild test_ourboros diff --git a/Readme.md b/Readme.md index 1a6833a93343bd51f8550e34b79c109e495b1030..4b536ab2f3b6691c4f7cdc71ea0c6829986d3b31 100644 --- a/Readme.md +++ b/Readme.md @@ -38,6 +38,13 @@ Open the front end, back end, and compilation optimization of compilers. Support - FutureWei Mapleall https://gitee.com/openarkcompiler-incubator/mapleall - Maple Engine https://gitee.com/openarkcompiler-incubator/maple_engine +## How to use +- source build/envsetup.sh +- make setup +- make +- make libcore +- make testall + ## Related Documents - Architecture Design Principles diff --git a/Readme_zh.md b/Readme_zh.md index ac3dd279ddd45b98e81e6649035ab27e1e96523b..12dd1d041984b28988a43cc2d268fab64c538fa7 100644 --- a/Readme_zh.md +++ b/Readme_zh.md @@ -34,6 +34,13 @@ OpenArkCompiler是来自华为方舟编译器的开源项目。 **计划持续更新...** +## 如何使用 +- source build/envsetup.sh +- make setup +- make +- make libcore +- make testall + ## 孵化器项目 - FutureWei编译器分支 https://gitee.com/openarkcompiler-incubator/mapleall - Maple Engine https://gitee.com/openarkcompiler-incubator/maple_engine diff --git a/build/core/libcore.mk b/build/core/libcore.mk index 092389c26c0ae4e5d9080ae6d939a0174920134f..58d99da3a165cbd8065ea94d47adbb1814c5cf0c 100644 --- a/build/core/libcore.mk +++ b/build/core/libcore.mk @@ -65,7 +65,7 @@ include $(MAPLE_BUILD_CORE)/extra.mk include $(MAPLE_BUILD_CORE)/mplcomb_dex.mk include $(MAPLE_BUILD_CORE)/dex2mpl.mk -$(APP_DEX): %.dex : $(D8) +$(APP_DEX): %.dex : $(D8) $(LIB_CORE_JAR) $(D8) --min-api 39 --output . $(LIB_CORE_JAR) mv classes.dex $(APP_DEX) diff --git a/doc/cn/DevelopmentPreparation.md b/doc/cn/DevelopmentPreparation.md index dfa793e0d458c2bb5d066f2ca2d22b6a350e1fb3..40d597820ad4618c3fc18d4cfde2b8bfe046fd4d 100644 --- a/doc/cn/DevelopmentPreparation.md +++ b/doc/cn/DevelopmentPreparation.md @@ -18,10 +18,10 @@ sudo apt-get -y install openjdk-8-jdk git-core build-essential zlib1g-dev libc6- sudo apt-get -y install gcc-5-aarch64-linux-gnu g++-5-aarch64-linux-gnu ``` -## 安装 +## 自动安装工具 ``` -cd tools -./setup_tools.sh +source build/envsetup.sh +tools/setup_tools.sh ``` diff --git a/doc/en/DevelopmentPreparation.md b/doc/en/DevelopmentPreparation.md index eef8c7d6cf9498662334451815378ba07b3fa413..6332c7560bacf1086d367c475a49c110d7238376 100644 --- a/doc/en/DevelopmentPreparation.md +++ b/doc/en/DevelopmentPreparation.md @@ -18,6 +18,11 @@ sudo apt-get -y install openjdk-8-jdk git-core build-essential zlib1g-dev libc6- sudo apt-get -y install gcc-5-aarch64-linux-gnu g++-5-aarch64-linux-gnu ``` +## Auto Installation of Tools +``` +source build/envsetup.sh +tools/setup_tools.sh +``` ## Installing and Configuring Clang (for Compiling the OpenArkCompiler Code) @@ -36,7 +41,7 @@ ${MAPLE_ROOT} is the root directory of the OpenArkCompiler source code. ## Installing and configuring Ninja and GN -Download **Ninja(v1.9.0)** and **GN(Linux Version)** +Download **Ninja(v1.10.0)** and **GN(Linux Version)** Ninja download address: https://github.com/ninja-build/ninja/releases GN download address: https://gitee.com/xlnb/gn_binary diff --git a/tools/build_and_run.sh b/tools/build_and_run.sh new file mode 100755 index 0000000000000000000000000000000000000000..da0cb68fb32129d4fbad0f8f91a50e3fa02ccd20 --- /dev/null +++ b/tools/build_and_run.sh @@ -0,0 +1,43 @@ +#!/bin/bash -x +# +# Copyright (C) [2020] Futurewei Technologies, Inc. All rights reverved. +# +# Licensed under the Mulan Permissive Software License v2. +# You can use this software according to the terms and conditions of the MulanPSL - 2.0. +# You may obtain a copy of MulanPSL - 2.0 at: +# +# https://opensource.org/licenses/MulanPSL-2.0 +# +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR +# FIT FOR A PARTICULAR PURPOSE. +# See the MulanPSL - 2.0 for more details. +# + +set -e + +today=$(date +%Y-%m-%d-%H_%M) + +cd $MAPLE_ROOT +make clean + +mkdir -p output +REPORT=output/report.txt +touch $REPORT + +echo $today >> $REPORT + +echo "start OpenArkCompiler build and testing..." >> $REPORT + +echo "make setup" >> $REPORT +make setup +echo "make" >> $REPORT +make + +echo "make libcore" +make libcore +echo "make testall" >> $REPORT +make testall 2>> $REPORT + +cat $REPORT +echo "end OpenArkCompiler ..." diff --git a/tools/setup_tools.sh b/tools/setup_tools.sh index 78514793c43a1a69a4e2d9c9825a4d609283331a..5dd6d2744e5b1acb6c627fb0744138544bb8976a 100755 --- a/tools/setup_tools.sh +++ b/tools/setup_tools.sh @@ -16,11 +16,14 @@ set -e +if [ -z "$MAPLE_ROOT" ]; then + export MAPLE_ROOT=$(pwd)/.. +fi +echo MAPLE_ROOT: $MAPLE_ROOT + android_env=$1 -TOOLS=$(pwd) -export MAPLE_ROOT=$TOOLS/.. -echo MAPLE_ROOT: $MAPLE_ROOT +TOOLS=$MAPLE_ROOT/tools ANDROID_VERSION=android-10.0.0_r35 ANDROID_SRCDIR=$MAPLE_ROOT/../android/$ANDROID_VERSION