加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 2.64 KB
一键复制 编辑 原始数据 按行查看 历史
# Copyright 2015-2017 Samsung Electronics Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
UNAME_M := $(shell uname -m)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
UNAME_S := linux
endif
ifeq ($(UNAME_S),Darwin)
UNAME_S := darwin
endif
TUV_PLATFORM ?= $(UNAME_M)-$(UNAME_S)
TUV_BUILD_TYPE ?= debug
TUV_BOARD ?= unknown
TUV_SYSTEMROOT ?= default
TUV_BUILDTESTER ?= yes
TUV_BUILDAPIEMULTESTER ?= no
TUV_BUILDHOSTHELPER ?= no
TUV_CREATE_SHARED_LIB ?= no
OUTPUT_ROOT := build
BUILD_FOLDER := ./$(OUTPUT_ROOT)/$(TUV_PLATFORM)/$(TUV_BUILD_TYPE)
CMAKE_FOLDER := $(BUILD_FOLDER)/cmake
CMAKE_DEFINES := \
-DCMAKE_TOOLCHAIN_FILE=./cmake/config/config_$(TUV_PLATFORM).cmake \
-DCMAKE_BUILD_TYPE=$(TUV_BUILD_TYPE) \
-DTARGET_PLATFORM=$(TUV_PLATFORM) \
-DBUILDTESTER=${TUV_BUILDTESTER} \
-DBUILD_HOST_HELPER=${TUV_BUILDHOSTHELPER} \
-DCREATE_SHARED_LIB=${TUV_CREATE_SHARED_LIB} \
-DTUV_FEATURE_PROCESS=ON
ifneq ($(TUV_BOARD),unknown)
CMAKE_DEFINES += -DTARGET_BOARD=${TUV_BOARD}
endif
ifneq ($(TUV_SYSTEMROOT),default)
CMAKE_DEFINES += -DTARGET_SYSTEMROOT=${TUV_SYSTEMROOT}
endif
ifneq ($(TUV_BUILDAPIEMULTESTER),no)
CMAKE_DEFINES += -DBUILDAPIEMULTESTER=${TUV_BUILDAPIEMULTESTER}
endif
.phony: all
all:
mkdir -p $(CMAKE_FOLDER)
cmake -B$(CMAKE_FOLDER) -H./ $(CMAKE_DEFINES)
make -C $(CMAKE_FOLDER)
ifeq ($(TUV_PLATFORM), $(filter $(TUV_PLATFORM), i686-linux x86_64-linux x86_64-darwin))
@echo '=============================================================='
@echo 'to run test,'
@echo '$(BUILD_FOLDER)/bin/tuvtester'
@echo '=============================================================='
endif
ifeq ("$(TUV_BUILDHOSTHELPER)","yes")
@echo '=============================================================='
@echo 'to run helper in host,'
@echo '$(BUILD_FOLDER)/bin/tuvhelper'
@echo '=============================================================='
endif
run_test:
make
ifeq ($(TUV_PLATFORM), $(filter $(TUV_PLATFORM), i686-linux x86_64-linux x86_64-darwin))
$(BUILD_FOLDER)/bin/tuvtester
else
@echo 'Cannot run test for $(TUV_PLATFORM)'
endif
call:
make -C $(CMAKE_FOLDER)
clean:
rm -rf $(OUTPUT_ROOT)
install:
make -C $(CMAKE_FOLDER) $@
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化