dholmes | 85dd5c8 | 2013-01-21 23:17:58 -0500 | [diff] [blame] | 1 | # |
| 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 | |
| 31 | PROFILE_NAMES := compact1 compact2 compact3 |
| 32 | |
dholmes | 8127a4f | 2013-03-14 01:47:59 -0400 | [diff] [blame] | 33 | # The include files use 1,2,3 for simplicity and conciseness. Internally we |
ihse | a29e622 | 2013-10-10 15:06:21 +0200 | [diff] [blame] | 34 | # use profile_1, profile_2 and profile_3. |
dholmes | 85dd5c8 | 2013-01-21 23:17:58 -0500 | [diff] [blame] | 35 | |
| 36 | ALL_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 | |
| 41 | VERSION_JAVA_DIR := sun/misc |
| 42 | VERSION_JAVA_FILE := Version.java |
| 43 | VERSION_JAVA_PATH := $(VERSION_JAVA_DIR)/$(VERSION_JAVA_FILE) |
| 44 | VERSION_CLASS_PATH := $(VERSION_JAVA_PATH:.java=.class) |
| 45 | |
| 46 | PROFILE_VERSION_JAVA_TARGETS := $(foreach i, $(ALL_PROFILES), $(subst XXX,$i, $(JDK_OUTPUTDIR)/gen_XXX/$(VERSION_JAVA_PATH))) |
| 47 | |
| 48 | PROFILE_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 |
ihse | a29e622 | 2013-10-10 15:06:21 +0200 | [diff] [blame] | 51 | profile_number = $(if $(patsubst profile_%,%, $(1)), $(patsubst profile_%,%, $(1)), $(words $(PROFILE_NAMES) extra)) |
dholmes | 85dd5c8 | 2013-01-21 23:17:58 -0500 | [diff] [blame] | 52 | |
| 53 | # Function to map from profile number, 1, 2 etc, to the corresponding name |
| 54 | # An invalid number maps to an empty name |
| 55 | profile_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 |
| 59 | profile_version_number = $(patsubst $(JDK_OUTPUTDIR)/gen_profile_%/$(VERSION_JAVA_PATH), %, $(1)) |
| 60 | |
ihse | a29e622 | 2013-10-10 15:06:21 +0200 | [diff] [blame] | 61 | # Function to go from a profile Version.java target to profile name. If not |
dholmes | 85dd5c8 | 2013-01-21 23:17:58 -0500 | [diff] [blame] | 62 | # a profile version target then we need a number that maps to an empty name |
| 63 | profile_version_name = $(word $(if $(filter-out $(call profile_version_number, $(1)), $(1)), $(call profile_version_number, $(1)), $(words $(PROFILE_NAMES) extra)), $(PROFILE_NAMES)) |