annotate make/common/RMICompilation.gmk @ 58498:3e6ad3a4a05d

manual merge with default
author vromero
date Tue, 22 Oct 2019 20:49:40 -0400
parents ef0cd710989f
children
rev   line source
erikj@13133 1 #
ihse@27592 2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
erikj@13133 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
erikj@13133 4 #
erikj@13133 5 # This code is free software; you can redistribute it and/or modify it
erikj@13133 6 # under the terms of the GNU General Public License version 2 only, as
erikj@13133 7 # published by the Free Software Foundation. Oracle designates this
erikj@13133 8 # particular file as subject to the "Classpath" exception as provided
erikj@13133 9 # by Oracle in the LICENSE file that accompanied this code.
erikj@13133 10 #
erikj@13133 11 # This code is distributed in the hope that it will be useful, but WITHOUT
erikj@13133 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
erikj@13133 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
erikj@13133 14 # version 2 for more details (a copy is included in the LICENSE file that
erikj@13133 15 # accompanied this code).
erikj@13133 16 #
erikj@13133 17 # You should have received a copy of the GNU General Public License version
erikj@13133 18 # 2 along with this work; if not, write to the Free Software Foundation,
erikj@13133 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
erikj@13133 20 #
erikj@13133 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
erikj@13133 22 # or visit www.oracle.com if you need additional information or have any
erikj@13133 23 # questions.
erikj@13133 24 #
erikj@13133 25
ihse@27592 26 # Setup make rules for creating an RMI compilation.
ihse@27592 27 #
ihse@27592 28 # Parameter 1 is the name of the rule. This name is used as variable prefix,
ihse@27592 29 # and the targets generated are listed in a variable by that name.
ihse@27592 30 #
ihse@27592 31 # Remaining parameters are named arguments. These include:
ihse@27592 32 # CLASSES:=List of classes to generate stubs for
ihse@27592 33 # CLASSES_DIR:=Directory where to look for classes
ihse@27592 34 # STUB_CLASSES_DIR:=Directory in where to put stub classes
ihse@27592 35 # RUN_V11:=Set to run rmic with -v1.1
ihse@27592 36 # RUN_V12:=Set to run rmic with -v1.2
ihse@27592 37 # KEEP_GENERATED:=Set to keep generated sources around
erikj@55639 38 # STUB_SOURCES_DIR:=Directory to put generated sources in
erikj@29312 39 SetupRMICompilation = $(NamedParamsMacroTemplate)
erikj@29312 40 define SetupRMICompilationBody
erikj@13133 41
erikj@20636 42 $1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/_the.$1_rmic.generated
erikj@13133 43
ihse@20363 44 $1_CLASSES_SLASH := $$(subst .,/,$$($1_CLASSES))
ihse@20363 45 $1_CLASS_FILES := $$(addprefix $$($1_CLASSES_DIR)/,$$(addsuffix .class,$$($1_CLASSES_SLASH)))
ihse@20363 46 $1_STUB_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Stub.class,$$($1_CLASSES_SLASH)))
ihse@20363 47 $1_TARGETS := $$($1_STUB_FILES)
ihse@20363 48 $1_ARGS :=
ihse@20363 49 ifneq (,$$($1_RUN_V11))
ihse@20363 50 $1_SKEL_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Skel.class,$$($1_CLASSES_SLASH)))
ihse@20363 51 $1_TARGETS += $$($1_SKEL_FILES)
ihse@20363 52 $1_ARGS += -v1.1
ihse@20363 53 endif
ihse@20363 54 ifneq (,$$($1_RUN_V12))
ihse@20363 55 $1_ARGS += -v1.2
ihse@20363 56 endif
erikj@13133 57
ihse@20363 58 $1_TIE_BASE_FILES := $$(foreach f,$$($1_CLASSES_SLASH),$$(dir $$f)_$$(notdir $$f))
ihse@20363 59 $1_TIE_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/org/omg/stub/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
ihse@20363 60 $1_TIE_STDPKG_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
erikj@13133 61
erikj@55639 62 ifneq ($$($1_KEEP_GENERATED), )
ihse@20363 63 $1_ARGS += -keepgenerated
erikj@55639 64 $1_JAVA_TARGETS := $$(subst .class,.java,$$($1_TARGETS))
erikj@55639 65 ifneq ($$($1_STUB_SOURCES_DIR), )
erikj@55639 66 # This is where the java files are created by rmic
erikj@55639 67 $1_JAVA_TARGETS_REL := $$(subst $$($1_STUB_CLASSES_DIR),, $$($1_JAVA_TARGETS))
erikj@55639 68 # This is where the caller wants the java files
erikj@55639 69 $1_JAVA_TARGETS := $$(addprefix $$($1_STUB_SOURCES_DIR), $$($1_JAVA_TARGETS_REL))
erikj@55639 70 endif
erikj@55639 71 $1_TARGETS += $$($1_JAVA_TARGETS)
ihse@20363 72 endif
erikj@13133 73
ihse@20363 74 $1_DOLLAR_SAFE_CLASSES := $$(subst $$$$,\$$$$,$$($1_CLASSES))
erikj@13133 75
ihse@20363 76 $$($1_TARGETS): $$($1_DEP_FILE) $$($1_CLASS_FILES)
erikj@13133 77
ihse@20363 78 $$($1_DEP_FILE): $$($1_CLASS_FILES)
erikj@35008 79 $$(call LogInfo, Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES))
erikj@35008 80 $$(call MakeDir, $$($1_STUB_CLASSES_DIR))
ihse@27595 81 $(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \
ihse@27595 82 -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \
erikj@55639 83 $$(if $$($1_STUB_SOURCES_DIR), \
erikj@55639 84 $$(foreach f, $$($1_JAVA_TARGETS_REL), \
erikj@55639 85 $(MKDIR) -p $$(dir $$($1_STUB_SOURCES_DIR)/$$f) ; \
erikj@55639 86 $(MV) $$($1_STUB_CLASSES_DIR)/$$f $$($1_STUB_SOURCES_DIR)/$$f ; \
erikj@55639 87 ) \
erikj@55639 88 ) \
erikj@20636 89 $(TOUCH) $$@
erikj@13133 90
erikj@13133 91
erikj@20636 92 $1 := $$($1_TARGETS) $$($1_DEP_FILE)
erikj@13133 93
erikj@13133 94 endef