make/common/IdlCompilation.gmk

Mon, 14 Sep 2020 16:42:03 +0100

author
andrew
date
Mon, 14 Sep 2020 16:42:03 +0100
changeset 2554
7f60c2d9823e
parent 912
a667caba1e84
child 1133
50aaf272884f
permissions
-rw-r--r--

Added tag jdk8u272-b08 for changeset 34c6baf21464

ohair@425 1 #
ohair@425 2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@425 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@425 4 #
ohair@425 5 # This code is free software; you can redistribute it and/or modify it
ohair@425 6 # under the terms of the GNU General Public License version 2 only, as
ohair@425 7 # published by the Free Software Foundation. Oracle designates this
ohair@425 8 # particular file as subject to the "Classpath" exception as provided
ohair@425 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@425 10 #
ohair@425 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@425 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@425 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@425 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@425 15 # accompanied this code).
ohair@425 16 #
ohair@425 17 # You should have received a copy of the GNU General Public License version
ohair@425 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@425 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@425 20 #
ohair@425 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@425 22 # or visit www.oracle.com if you need additional information or have any
ohair@425 23 # questions.
ohair@425 24 #
ohair@425 25
ihse@839 26 PREFIXES=-pkgPrefix CORBA org.omg \
ihse@839 27 -pkgPrefix CosNaming org.omg \
ihse@839 28 -pkgPrefix CosTransactions org.omg \
ihse@839 29 -pkgPrefix CosTSInteroperation org.omg \
ihse@839 30 -pkgPrefix DynamicAny org.omg \
ihse@839 31 -pkgPrefix Dynamic org.omg \
ihse@839 32 -pkgPrefix IOP org.omg \
ihse@839 33 -pkgPrefix Messaging org.omg \
ihse@839 34 -pkgPrefix PortableInterceptor org.omg \
ihse@839 35 -pkgPrefix PortableServer org.omg \
ihse@839 36 -pkgPrefix activation com.sun.corba.se.spi \
ihse@839 37 -pkgPrefix GIOP com.sun.corba.se \
ihse@839 38 -pkgPrefix PortableActivationIDL com.sun.corba.se \
ihse@839 39 -pkgPrefix messages com.sun.corba.se
ohair@425 40
ohair@425 41 define add_idl_package
ihse@839 42 # param 1 = MYPACKAGE
ihse@839 43 # param 2 = src root
ihse@839 44 # param 3 = gensrc root
ihse@839 45 # param 4 = source idl to compile
ihse@839 46 # param 5 = target idl package
ihse@839 47 # param 6 = delete these files that were output from the idlj
ihse@839 48 # param 7 = idls that match these patterns should be compiled with -oldImplBase
ihse@839 49 # param 8 = the idlj command
ihse@839 50 # Save the generated java files to a temporary directory so
ihse@839 51 # that we can find them and create proper dependencies.
ihse@839 52 # After that, we move them to the real gensrc target dir.
ihse@839 53 $4_TMPDIR:=tmp___$(subst /,_,$(patsubst $2/%,%,$4))___
ihse@839 54 ifneq ($$(filter $7,$4),)
ihse@839 55 $4_OLDIMPLBASE:=-oldImplBase
ihse@839 56 $4_OLDIMPLBASE_MSG:=with -oldImplBase
ihse@839 57 endif
ihse@839 58 $5 : $4
erikj@459 59 $(MKDIR) -p $3/$$($4_TMPDIR)
erikj@459 60 $(RM) -rf $3/$$($4_TMPDIR)
erikj@459 61 $(MKDIR) -p $(dir $5)
ihse@839 62 $(ECHO) $(LOG_INFO) Compiling IDL $(patsubst $2/%,%,$4)
ohair@425 63 $8 -td $3/$$($4_TMPDIR) \
ihse@839 64 -i $2/org/omg/CORBA \
ihse@839 65 -i $2/org/omg/PortableInterceptor \
ihse@839 66 -i $2/org/omg/PortableServer \
ihse@839 67 -D CORBA3 -corba 3.0 \
ihse@839 68 -fall \
ihse@839 69 $$($4_OLDIMPLBASE) \
ihse@839 70 $(PREFIXES) \
ihse@839 71 $4
erikj@459 72 $(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6)
erikj@669 73 $(CP) -r $3/$$($4_TMPDIR)/* $3
tbell@606 74 ($(CD) $3/$$($4_TMPDIR) && $(FIND) . -type f | $(SED) 's!\./!$3/!g' | $(NAWK) '{ print $$$$1 ": $4" }' > $5)
erikj@459 75 $(RM) -rf $3/$$($4_TMPDIR)
ohair@425 76 endef
ohair@425 77
ohair@425 78 define SetupIdlCompilation
ihse@839 79 # param 1 is for example BUILD_IDLS
ihse@839 80 # param 2,3,4,5,6,7,8 are named args.
ihse@839 81 # IDLJ,SRC,BIN,INCLUDES,EXCLUDES,OLDIMPLBASES,DELETES
ihse@839 82 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
ihse@839 83 $(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
ihse@839 84 $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
erikj@458 85
ihse@839 86 # Find all existing java files and existing class files.
ihse@839 87 $$(eval $$(call MakeDir,$$($1_BIN)))
ihse@839 88 $1_SRCS := $$(shell find $$($1_SRC) -name "*.idl")
ihse@839 89 $1_BINS := $$(shell find $$($1_BIN) -name "*.java")
ihse@839 90 # Prepend the source/bin path to the filter expressions.
ihse@839 91 $1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES))
ihse@839 92 $1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES))
ihse@839 93 $1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES))
ihse@839 94 $1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES))
ihse@839 95 $1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES))
ihse@839 96 # Now remove unwanted java/class files.
ihse@839 97 $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
ihse@839 98 $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
ihse@839 99 $1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS))
ihse@839 100 $1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS))
ihse@839 101 $1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS)))
ihse@839 102 # Now create the dependencies for each idl target.
ihse@839 103 $$(foreach p,$$($1),$$(eval $$(call add_idl_package,$1,$$($1_SRC),$$($1_BIN),$$(patsubst $$($1_BIN)/%.idl.d,$$($1_SRC)/%.idl,$$p),$$p,$$($1_DELETES),$$($1_OLDIMPLBASES),$$($1_IDLJ))))
ohair@425 104 endef
ohair@425 105
ohair@425 106 .SUFFIXES: .java .class .package

mercurial