blob: 2e1e16e82ed825f7d7985d2eb3bafb6e70d295bb [file] [log] [blame]
dholmes85dd5c82013-01-21 23:17:58 -05001#
2# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26# This was split out from Profiles.gmk to allow GenSrcMisc.gmk to include it
27# without attempting to generate lists for output files that don't exist yet
28
29# These are the external names of each profile
30
31PROFILE_NAMES := compact1 compact2 compact3
32
dholmes8127a4f2013-03-14 01:47:59 -040033# The include files use 1,2,3 for simplicity and conciseness. Internally we
ihsea29e6222013-10-10 15:06:21 +020034# use profile_1, profile_2 and profile_3.
dholmes85dd5c82013-01-21 23:17:58 -050035
36ALL_PROFILES := profile_1 profile_2 profile_3
37
38# This defines targets to generate per-profile Version.java/class files into
39# distinct locations
40
41VERSION_JAVA_DIR := sun/misc
42VERSION_JAVA_FILE := Version.java
43VERSION_JAVA_PATH := $(VERSION_JAVA_DIR)/$(VERSION_JAVA_FILE)
44VERSION_CLASS_PATH := $(VERSION_JAVA_PATH:.java=.class)
45
46PROFILE_VERSION_JAVA_TARGETS := $(foreach i, $(ALL_PROFILES), $(subst XXX,$i, $(JDK_OUTPUTDIR)/gen_XXX/$(VERSION_JAVA_PATH)))
47
48PROFILE_VERSION_CLASS_TARGETS := $(foreach i, $(PROFILE_VERSION_JAVA_TARGETS), $(i:.java=.class))
49
50# Function to map from profile designator, profile_1 etc, to its number
ihsea29e6222013-10-10 15:06:21 +020051profile_number = $(if $(patsubst profile_%,%, $(1)), $(patsubst profile_%,%, $(1)), $(words $(PROFILE_NAMES) extra))
dholmes85dd5c82013-01-21 23:17:58 -050052
53# Function to map from profile number, 1, 2 etc, to the corresponding name
54# An invalid number maps to an empty name
55profile_name = $(word $(1), $(PROFILE_NAMES))
56
57# Function to isolate a profile number from a Version.java target
58# Evaluates to the arg if the arg is not a profile version target
59profile_version_number = $(patsubst $(JDK_OUTPUTDIR)/gen_profile_%/$(VERSION_JAVA_PATH), %, $(1))
60
ihsea29e6222013-10-10 15:06:21 +020061# Function to go from a profile Version.java target to profile name. If not
dholmes85dd5c82013-01-21 23:17:58 -050062# a profile version target then we need a number that maps to an empty name
63profile_version_name = $(word $(if $(filter-out $(call profile_version_number, $(1)), $(1)), $(call profile_version_number, $(1)), $(words $(PROFILE_NAMES) extra)), $(PROFILE_NAMES))