# # Copyright (C) 2016 The Android Open Source Project # # 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. # ################################################################################ # # NanoApp C/C++ Makefile Utils # ################################################################################
# Toolchain Prefix
ifndef CROSS_COMPILE
$(error Please set the environment variable CROSS_COMPILE to the complete \
path to the toolchain directory plus the binary prefix, e.g. export \
CROSS_COMPILE=~/bin/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-) endif
# TOP_RELPATH is ANDROID_TOP relative to NANOHUB_DIR
TOP_RELPATH := ../../../..
TOP_ABSPATH := $(realpath $(NANOHUB_DIR)/$(TOP_RELPATH))
# for local variants there is always a path; for out-of-tree variants there may be # - a $(VARIANT) soft link under firmware/variant subdir, or # - VARIANT_PATH is found as vendor/<vendor_name>/<variant_name>/nanohub, or # - explicitly provided in VARIANT_CONFIG_PATH (path, where <variant>_conf.mk is located) # ifeq ($(VARIANT_CONFIG_PATH),)
variant_conf := $(wildcard $(TOP_ABSPATH)/vendor/*/*/nanohub/$(VARIANT)_conf.mk) ifeq ($(words $(variant_conf)),1)
VARIANT_CONFIG_PATH := $(patsubst $(TOP_ABSPATH)/%/$(VARIANT)_conf.mk,%,$(variant_conf)) else
VARIANT_CONFIG_PATH := device/google/contexthub/firmware/variant/$(VARIANT) endif endif
include $(TOP_ABSPATH)/$(VARIANT_CONFIG_PATH)/$(VARIANT)_conf.mk
# $(VARIANT)_conf.mk defines VARIANT_PATH, PLATFORM, CHIP, CPU, VARIANT # VARIANT_PATH from $(VARIANT)_conf.mk is ANDROID_TOP relative
# change VARIANT_PATH to become CWD-relative
VARIANT_PATH := $(NANOHUB_DIR)/$(TOP_RELPATH)/$(VARIANT_PATH)
# all output goes here
ifndef OUT
OUT:=out/nanohub/$(VARIANT)/app/$(BIN) else ifneq ($(filter $(TOP_ABSPATH)/out/target/product/%,$(OUT)),) # this looks like Android OUT env var; update it
IMAGE_TARGET_OUT:=$(OUT)/vendor/firmware/$(BIN).napp
OUT:=$(OUT)/nanohub/$(VARIANT)/app/$(BIN) endif endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.