version_defaults.mk revision ab1e594c5d5cf65db54ad3c19d0abc1a99d4071e
1# 2# Copyright (C) 2008 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17# 18# Handle various build version information. 19# 20# Guarantees that the following are defined: 21# PLATFORM_VERSION 22# PLATFORM_SDK_VERSION 23# BUILD_ID 24# BUILD_NUMBER 25# 26 27# Look for an optional file containing overrides of the defaults, 28# but don't cry if we don't find it. We could just use -include, but 29# the build.prop target also wants INTERNAL_BUILD_ID_MAKEFILE to be set 30# if the file exists. 31# 32INTERNAL_BUILD_ID_MAKEFILE := $(wildcard $(BUILD_SYSTEM)/build_id.mk) 33ifneq "" "$(INTERNAL_BUILD_ID_MAKEFILE)" 34 include $(INTERNAL_BUILD_ID_MAKEFILE) 35endif 36 37ifeq "" "$(PLATFORM_VERSION)" 38 # This is the canonical definition of the platform version, 39 # which is the version that we reveal to the end user. 40 # Update this value when the platform version changes (rather 41 # than overriding it somewhere else). Can be an arbitrary string. 42 PLATFORM_VERSION := Eclair 43endif 44 45ifeq "" "$(PLATFORM_SDK_VERSION)" 46 # This is the canonical definition of the SDK version, which defines 47 # the set of APIs and functionality available in the platform. It 48 # is a single integer that increases monotonically as updates to 49 # the SDK are released. It should only be incremented when the APIs for 50 # the new release are frozen (so that developers don't write apps against 51 # intermediate builds). During development, this number remains at the 52 # SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds 53 # the code-name of the new development work. 54 PLATFORM_SDK_VERSION := 3 55endif 56 57ifeq "" "$(PLATFORM_VERSION_CODENAME)" 58 # This is the current development code-name, if the build is not a final 59 # release build. If this is a final release build, it is simply "REL". 60 PLATFORM_VERSION_CODENAME := Eclair 61endif 62 63ifeq "" "$(BUILD_ID)" 64 # Used to signify special builds. E.g., branches and/or releases, 65 # like "M5-RC7". Can be an arbitrary string, but must be a single 66 # word and a valid file name. 67 # 68 # If there is no BUILD_ID set, make it obvious. 69 BUILD_ID := UNKNOWN 70endif 71 72ifeq "" "$(BUILD_NUMBER)" 73 # BUILD_NUMBER should be set to the source control value that 74 # represents the current state of the source code. E.g., a 75 # perforce changelist number or a git hash. Can be an arbitrary string 76 # (to allow for source control that uses something other than numbers), 77 # but must be a single word and a valid file name. 78 # 79 # If no BUILD_NUMBER is set, create a useful "I am an engineering build 80 # from this date/time" value. Make it start with a non-digit so that 81 # anyone trying to parse it as an integer will probably get "0". 82 BUILD_NUMBER := eng.$(USER).$(shell date +%Y%m%d.%H%M%S) 83endif 84 85