Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/altsrc.make
32281 views
#1# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#22#2324# This file defines variables and macros which are used in the makefiles to25# allow distributions to augment or replace common hotspot code with26# distribution-specific source files. This capability is disabled when27# an OPENJDK build is requested, unless HS_ALT_SRC_REL has been set externally.2829# Requires: GAMMADIR30# Provides:31# variables: HS_COMMON_SRC, HS_ALT_SRC, HS_COMMON_SRC_REL, and HS_ALT_SRC_REL32# functions: altsrc-equiv, if-has-altsrc, altsrc, altsrc-replace3334HS_COMMON_SRC_REL=src3536ifneq ($(OPENJDK),true)37# This needs to be changed to a more generic location, but we keep it38# as this for now for compatibility39HS_ALT_SRC_REL=src/closed40else41HS_ALT_SRC_REL=NO_SUCH_PATH42endif4344HS_COMMON_SRC=$(GAMMADIR)/$(HS_COMMON_SRC_REL)45HS_ALT_SRC=$(GAMMADIR)/$(HS_ALT_SRC_REL)4647## altsrc-equiv48#49# Convert a common source path to an alternative source path50#51# Parameter: An absolute path into the common sources52# Result: The matching path to the alternate-source location53#54altsrc-equiv=$(subst $(HS_COMMON_SRC)/,$(HS_ALT_SRC)/,$(1))555657## if-has-altsrc58#59# Conditional macro to test for the existence of an alternate source path60#61# Parameter: An absolute path into the common sources62# Parameter: Result if the alternative-source location exists63# Parameter: Result if the alternative-source location does not exist64# Result: expands to parameter 2 or 3 depending on existence of alternate source65#66if-has-altsrc=$(if $(wildcard $(call altsrc-equiv,$(1))),$(2),$(3))676869## altsrc70#71# Converts common source path to alternate source path if the alternate72# path exists, otherwise evaluates to nul (empty string)73#74# Parameter: An absolute path into the common sources75# Result: The equivalent path to the alternate-source location, if such a76# location exists on the filesystem. Otherwise it expands to empty.77#78altsrc=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)))7980## commonsrc81#82# Returns parameter.83#84commonsrc=$(1)858687## altsrc-replace88#89# Converts a common source path to an alternate source path if the alternate90# source path exists. Otherwise it evaluates to the input common source path.91#92# Parameter: An absolute path into the common sources93# Result: A path to either the common or alternate sources94#95altsrc-replace=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)),$(1))969798