defs.mk
来自「This is a resource based on j2me embedde」· MK 代码 · 共 2,347 行 · 第 1/5 页
MK
2,347 行
## # Copyright 1990-2008 Sun Microsystems, Inc. All Rights Reserved.# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER# # This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License version# 2 only, as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but# WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU# General Public License version 2 for more details (a copy is# included at /legal/license.txt). # # You should have received a copy of the GNU General Public License# version 2 along with this work; if not, write to the Free Software# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA# 02110-1301 USA # # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa# Clara, CA 95054 or visit www.sun.com if you need additional# information or have any questions. ### Common makefile defs#empty:=comma:= ,space:= $(empty) $(empty)## Setup HOST_OS, HOST_CPU_FAMILY, and HOST_DEVICE. These are used# to assist in locating the proper tools to use.#UNAME_OS ?= $(shell uname -s)# Solaris host supportifeq ($(UNAME_OS), SunOS)HOST_OS ?= solarisHOST_CPU_FAMILY ?= $(shell uname -p)ifeq ($(HOST_CPU_FAMILY), sparc)HOST_DEVICE ?= sunelseHOST_DEVICE ?= pcendifendif# Linux host supportifeq ($(UNAME_OS), Linux)HOST_OS ?= linuxHOST_CPU_FAMILY ?= $(shell uname -m)ifeq ($(wildcard /etc/redhat-release), /etc/redhat-release) HOST_DEVICE ?= redhatendififeq ($(wildcard /etc/SuSE-release), /etc/SuSE-release) HOST_DEVICE ?= SuSEendifLSB_RELEASE = $(shell lsb_release -i -s 2> /dev/null)ifneq ($(LSB_RELEASE),) HOST_DEVICE ?= $(LSB_RELEASE)endififeq ($(HOST_DEVICE),) HOST_DEVICE ?= genericendifendif# Darwin (MacOS X) host supportifeq ($(UNAME_OS), Darwin)HOST_OS ?= darwinHOST_CPU_FAMILY ?= $(shell uname -p)ifeq ($(HOST_CPU_FAMILY), powerpc)HOST_DEVICE ?= macelseHOST_DEVICE ?= pcendifendif# Windows host supportifeq ($(findstring CYGWIN, $(UNAME_OS)), CYGWIN)HOST_OS ?= win32HOST_CPU_FAMILY ?= $(shell uname -m)HOST_DEVICE ?= cygwinUSE_CYGWIN ?= trueendififeq ($(UNAME_OS), Interix)HOST_OS ?= win32HOST_CPU_FAMILY ?= $(shell uname -m)HOST_DEVICE ?= $(UNAME_OS)TOOL_WHICH ?= PATH="$(PATH)" whence "$(1)"USE_INTERIX ?= trueendififeq ($(HOST_OS),)$(error Invalid host. "$(UNAME_OS)" not recognized.)endif# locate the tools componentexport TOOLS_DIR ?= $(COMPONENTS_DIR)/toolsifeq ($(wildcard $(TOOLS_DIR)/tools.gmk),)$(error TOOLS_DIR must point to the shared tools directory: $(TOOLS_DIR))endif# include tools component makefile. Don't do this until after HOST_OS is setupinclude $(TOOLS_DIR)/tools.gmkTOOL_WHICH ?= PATH="$(PATH)" which "$(1)"## By default we prefer SHELL=sh. Some of the makefile commands require# an sh compatible shell. csh won't work. Most versions of sh, ksh, tcsh,# and bash will work fine. On some hosts we default to something other than# sh. See comments below to find out when and why.## The "-e" option is added to the SHELL command so shell commands will# exit if there is an error. If this isn't done, then sometimes the # makefile continues to execute after a shell command fails.## Note that gnumake also adds "-c" to the command, so you end up with# a command that looks like this:## sh -e -c "<command>"## Some versions of sh don't support this and require you to use "-ec"# instead of "-e -c", but there is no way to get gnumake to do this.# In this case you should override SHELL to use some other shell, or just# drop the -e argument.# # ksh is not the default shell because it is not installed on all # systems, and some versions of it have problems with the long commands# that the makefiles produce.#SHELL = sh -e## Use ksh on solaris, since the solaris sh doesn't support -e as a# separate parameter.#ifeq ($(HOST_OS), solaris)SHELL = ksh -eendif## Use bash on win32, since the Cygwin sh doesn't work for us.#ifeq ($(HOST_DEVICE), cygwin)SHELL = bash -eendififeq ($(HOST_DEVICE), Interix)SHELL = ksh -eendif## Setup host and target platform names. Note that the naming coventions# for each is different with respect to the order of the cpu, os, # and device parts.#CVM_HOST ?= $(HOST_CPU_FAMILY)-$(HOST_DEVICE)-$(HOST_OS)CVM_TARGET = $(TARGET_OS)-$(TARGET_CPU_FAMILY)-$(TARGET_DEVICE)# EVAL_SUPPORTED is true if this version of gnumake supports# the eval function. $(eval EVAL_SUPPORTED=true)# Set overriding values:# Figure out if this is a CDC 1.0 source base or notifeq ($(wildcard $(CDC_DIR)/build/share/defs_zoneinfo.mk),) override CDC_10 = trueelse override CDC_10 = falseendifCVM_JVMDI ?= false# For backwards compatibility of sorts, we migrate CVM_JVMDI to CVM_JVMTICVM_JVMTI ?= $(CVM_JVMDI)CVM_JVMTI_ROM ?= $(CVM_JVMTI)# We need to check this here because the CVM_JVMTI option overrides many# others that follows through CVM_DEBUG:ifeq ($(CVM_JVMTI), true) override CVM_DEBUG_CLASSINFO = trueifeq ($(CVM_JVMTI_ROM), true) override CVM_JAVAC_DEBUG = trueendif override CVM_AGENTLIB = true override CVM_XRUN = true override CVM_THREAD_SUSPENSION = trueendififeq ($(CVM_JVMTI_ROM), true)ifneq ($(CVM_JVMTI), true)$(error CVM_JVMTI must be set to 'true' if CVM_JVMTI_ROM is 'true')endif override CVM_JAVAC_DEBUG=trueendififeq ($(CVM_CLASSLIB_JCOV), true) override CVM_JVMPI = true override CVM_JVMPI_TRACE_INSTRUCTION = trueendififeq ($(CVM_JVMPI), true) override CVM_DEBUG_CLASSINFO = true override CVM_XRUN = true override CVM_THREAD_SUSPENSION = trueendif# Set default options.# NOTE: These options are officially supported and are documented in# docs/guide/build.html:# CVM_DEBUG must be true or false, or the build will fail.CVM_DEBUG ?= falseifneq ($(CVM_DEBUG),true)ifneq ($(CVM_DEBUG),false)$(error CVM_DEBUG must be true or false: CVM_DEBUG=$(CVM_DEBUG))endifendifCVM_TRACE ?= $(CVM_DEBUG)ifeq ($(CVM_TRACE),true)override CVM_DEBUG_DUMPSTACK = trueendififeq ($(CVM_VERIFY_HEAP),true)override CVM_DEBUG_ASSERTS = trueendifCVM_DEBUG_ASSERTS ?= $(CVM_DEBUG)CVM_DEBUG_CLASSINFO ?= $(CVM_DEBUG)CVM_DEBUG_DUMPSTACK ?= $(CVM_DEBUG)CVM_DEBUG_STACKTRACES ?= trueCVM_INSPECTOR ?= $(CVM_DEBUG)CVM_JAVAC_DEBUG ?= $(CVM_DEBUG)CVM_VERIFY_HEAP ?= falseCVM_JIT ?= falseCVM_JVMTI_ROM ?= falseCVM_JVMPI ?= falseCVM_JVMPI_TRACE_INSTRUCTION ?= $(CVM_JVMPI)CVM_THREAD_SUSPENSION ?= falseCVM_GPROF ?= falseCVM_GPROF_NO_CALLGRAPH ?= trueCVM_GCOV ?= falseCVM_USE_CVM_MEMALIGN ?= false# CVM_USE_NATIVE_TOOLS is no longer settable by the user. Note that we# don't give a warning if it was set in a file, because this does# in fact happen when doing a make clean. It gets set when# .previous.build.flags is included.ifneq ($(CVM_USE_NATIVE_TOOLS),) ifneq ($(origin CVM_USE_NATIVE_TOOLS),file) $(warning Setting CVM_USE_NATIVE_TOOLS is no longer supported. \ Any value set will be overridden.) endifendifoverride CVM_USE_NATIVE_TOOLS = trueifeq ($(CVM_DEBUG), true)CVM_OPTIMIZED ?= falseelseCVM_OPTIMIZED ?= trueendifCVM_SYMBOLS ?= $(CVM_DEBUG)CVM_PRODUCT ?= premiumifeq ($(CVM_PRELOAD_LIB), true) override CVM_CREATE_RTJAR = falseendif# CVM_TERSEOUTPUT is now deprecated in favor of USE_VERBOSE_MAKE.# They have opposite meanings. We look at CVM_TERSEOUTPUT here to set# USE_VERBOSE_MAKE properly for backwards compatibility. This is the# only place where CVM_TERSEOUTPUT can be checkedifeq ($(CVM_TERSEOUTPUT),false)USE_VERBOSE_MAKE ?= trueelseUSE_VERBOSE_MAKE ?= falseendif# %begin lvmCVM_LVM ?= false# %end lvmCVM_CSTACKANALYSIS ?= falseCVM_TIMESTAMPING ?= trueCVM_INCLUDE_COMMCONNECTION ?= falseUSE_MIDP ?= falseUSE_JUMP ?= falseUSE_GCI ?= false# Some makefiles still reference CVM_INCLUDE_MIDP and CVM_INCLUDE_JUMP,# so give them proper values until they are cleaned up.CVM_INCLUDE_MIDP ?= $(USE_MIDP)CVM_INCLUDE_JUMP ?= $(USE_JUMP)ifeq ($(USE_MIDP), true) override CVM_KNI = true override CVM_DUAL_STACK = trueelse CVM_KNI ?= false ifeq ($(USE_JUMP), true) override CVM_DUAL_STACK = true else CVM_DUAL_STACK ?= false endifendifCVM_SPLIT_VERIFY ?= falseCVM_JIT_REGISTER_LOCALS ?= trueCVM_JIT_USE_FP_HARDWARE ?= false# NOTE: These options are not officially supported:# NOTE: CVM_INTERPRETER_LOOP can be set to "Split", "Aligned", or "Standard"CVM_CLASSLOADING ?= trueCVM_REFLECT ?= trueCVM_SERIALIZATION ?= trueCVM_DYNAMIC_LINKING ?= trueCVM_TEST_GC ?= falseCVM_TEST_GENERATION_GC ?= falseCVM_INSTRUCTION_COUNTING?= falseCVM_NO_CODE_COMPACTION ?= falseCVM_INTERPRETER_LOOP ?= StandardCVM_XRUN ?= falseCVM_AGENTLIB ?= falseCVM_CLASSLIB_JCOV ?= falseCVM_EMBEDDED_HOOK ?= falseCVM_TRACE_JIT ?= $(CVM_TRACE)CVM_JIT_ESTIMATE_COMPILATION_SPEED ?= falseCVM_CCM_COLLECT_STATS ?= falseCVM_JIT_PROFILE ?= falseCVM_JIT_DEBUG ?= false# mTASKCVM_MTASK ?= false# AOTCVM_AOT ?= false# By default build in the $(CVM_TARGET) directoryCVM_BUILD_SUBDIR ?= false CVM_USE_MEM_MGR ?= falseCVM_MP_SAFE ?= falseCVM_CREATE_RTJAR ?= false# AOT is only supported for Romized build.ifeq ($(CVM_AOT), true) override CVM_PRELOAD_LIB = trueendififneq ($(CVM_CLASSLOADING), true) override CVM_PRELOAD_LIB = trueendififdef CVM_ALLOW_UNRESOLVED $(error Internal flag CVM_ALLOW_UNRESOLVED should not be set)endififdef CVM_PRELOAD_FULL_CLOSURE $(error Internal flag CVM_PRELOAD_FULL_CLOSURE should not be set)endififdef CVM_PRELOAD_ALL $(error Internal flag CVM_PRELOAD_ALL should not be set)endififdef CVM_PRELOAD_SET ifdef CVM_PRELOAD_TEST $(error Do not set both CVM_PRELOAD_SET and CVM_PRELOAD_TEST) endif ifdef CVM_PRELOAD_LIB $(error Do not set both CVM_PRELOAD_SET and CVM_PRELOAD_LIB) endif CVM_FLAGS += CVM_PRELOAD_SETendififdef CVM_PRELOAD_TESTCVM_PRELOAD_LIB = $(CVM_PRELOAD_TEST)endififdef CVM_PRELOAD_LIB CVM_FLAGS += CVM_PRELOAD_LIB ifeq ($(CVM_PRELOAD_LIB), false) ifeq ($(CVM_PRELOAD_TEST), true) $(error CVM_PRELOAD_LIB=false is incompatible with \ CVM_PRELOAD_TEST=true) else CVM_PRELOAD_SET = minfull endif else ifeq ($(CVM_PRELOAD_TEST), true) CVM_PRELOAD_SET = libtestfull else CVM_PRELOAD_SET = libfull endif endifendifCVM_PRELOAD_SET ?= minfullCVM_PRELOAD_ALL = falseifeq ($(patsubst %full,true,$(CVM_PRELOAD_SET)), true) CVM_PRELOAD_FULL_CLOSURE = true ifeq ($(patsubst lib%,true,$(CVM_PRELOAD_SET)), true) CVM_PRELOAD_ALL = true endifelse CVM_PRELOAD_FULL_CLOSURE = falseendififeq ($(CVM_PRELOAD_SET), libtestfull) CVM_PRELOAD_TEST = trueendifCVM_STATICLINK_LIBS = $(CVM_PRELOAD_ALL)override CVM_PRELOAD_LIB = $(CVM_PRELOAD_ALL)ifeq ($(CVM_PRELOAD_ALL), true) override CVM_CREATE_RTJAR = falseendififeq ($(CVM_AOT), true)override CVM_JIT = trueendif# Turn all JIT tracing off if we don't have the jit:ifneq ($(CVM_JIT), true)override CVM_TRACE_JIT = falseoverride CVM_JIT_COLLECT_STATS = falseoverride CVM_JIT_ESTIMATE_COMPILATION_SPEED = falseoverride CVM_CCM_COLLECT_STATS = falseoverride CVM_JIT_PROFILE = falseoverride CVM_JIT_DEBUG = falseendif## prefix and postfix for shared libraries. These can be overriden# by platform makefiles if they need to be different.#ifeq ($(CVM_DEBUG), true)DEBUG_POSTFIX = _gendifLIB_PREFIX = libLIB_POSTFIX = $(DEBUG_POSTFIX).so## All build directories relative to CVM_BUILD_TOP#CVM_BUILD_TOP := $(CDC_DEVICE_COMPONENT_DIR)/build/$(CVM_TARGET)/$(CVM_BUILD_SUBDIR_NAME)CVM_LIBDIR := $(CVM_BUILD_TOP)/libCVM_BUILD_TOP_ABS := $(call ABSPATH,$(CVM_BUILD_TOP))CVM_LIBDIR_ABS := $(CVM_BUILD_TOP_ABS)/libPROFILE_DIR ?= $(CDC_DIR)# Optional Package namesifneq ($(strip $(OPT_PKGS)),) ifeq ($(OPT_PKGS), all) OPT_PKGS_DEFS_FILES := $(wildcard ../share/defs_*_pkg.mk) OPT_PKGS_LIST := $(patsubst ../share/defs_%_pkg.mk,%,\ $(OPT_PKGS_DEFS_FILES))
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?