1 #
   2 # Copyright (c) 2014, 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 default: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include JavaCompilation.gmk
  31 include IdlCompilation.gmk
  32 
  33 include CommonCorba.gmk
  34 
  35 ################################################################################
  36 
  37 $(eval $(call SetupJavaCompilation,BUILD_STRIPPROP, \
  38     SETUP := GENERATE_OLDBYTECODE, \
  39     SRC := $(CORBA_TOPDIR)/make/tools/src, \
  40     BIN := $(CORBA_OUTPUTDIR)/stripprop_classes))
  41 
  42 TOOL_STRIPPROP_CMD := $(JAVA) -cp $(CORBA_OUTPUTDIR)/stripprop_classes \
  43     build.tools.stripproperties.StripPropertiesCorba
  44 
  45 $(eval $(call SetupJavaCompilation,BUILD_IDLJ, \
  46     SETUP := GENERATE_OLDBYTECODE, \
  47     SRC := $(CORBA_TOPDIR)/src/share/classes, \
  48     BIN := $(CORBA_OUTPUTDIR)/idlj_classes, \
  49     COPY := .prp, \
  50     INCLUDES := com/sun/tools/corba/se/idl, \
  51     EXCLUDE_FILES := ResourceBundleUtil.java))
  52 
  53 TOOL_IDLJ_CMD := $(JAVA) -cp $(CORBA_OUTPUTDIR)/idlj_classes \
  54     com.sun.tools.corba.se.idl.toJavaPortable.Compile
  55 
  56 $(eval $(call SetupJavaCompilation,BUILD_LOGUTIL, \
  57     SETUP := GENERATE_OLDBYTECODE, \
  58     SRC := $(CORBA_TOPDIR)/src/share/classes, \
  59     BIN := $(CORBA_OUTPUTDIR)/logutil_classes, \
  60     INCLUDES := com/sun/tools/corba/se/logutil))
  61 
  62 TOOL_LOGUTIL_CMD := $(JAVA) -cp $(CORBA_OUTPUTDIR)/logutil_classes \
  63     com.sun.tools.corba.se.logutil.MC
  64 
  65 ################################################################################
  66 
  67 # Generate LogWrapper classes
  68 $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/%SystemException.java: \
  69     $(CORBA_TOPDIR)/src/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
  70     $(BUILD_LOGUTIL)
  71         $(MKDIR) -p $(@D)
  72         $(RM) -f $(@D)/_the_wrappers.d
  73         $(ECHO) $(LOG_INFO) Generating class file from $*.mc
  74         $(TOOL_LOGUTIL_CMD) make-class $< $(@D)
  75 
  76 # Generate LogWrapper properties file by concatening resource files
  77 $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/LogStrings.properties: \
  78     $(CORBA_OUTPUTDIR)/logwrappers/ActivationSystemException.resource \
  79     $(CORBA_OUTPUTDIR)/logwrappers/IORSystemException.resource \
  80     $(CORBA_OUTPUTDIR)/logwrappers/InterceptorsSystemException.resource \
  81     $(CORBA_OUTPUTDIR)/logwrappers/NamingSystemException.resource \
  82     $(CORBA_OUTPUTDIR)/logwrappers/OMGSystemException.resource \
  83     $(CORBA_OUTPUTDIR)/logwrappers/ORBUtilSystemException.resource \
  84     $(CORBA_OUTPUTDIR)/logwrappers/POASystemException.resource \
  85     $(CORBA_OUTPUTDIR)/logwrappers/UtilSystemException.resource
  86         $(MKDIR) -p $(@D)
  87         $(ECHO) $(LOG_INFO) Concatenating 8 resource files into $(@F)
  88         $(CAT) $^ > $@
  89 
  90 # The resources files are generated from lisp-like .mc files.
  91 $(CORBA_OUTPUTDIR)/logwrappers/%SystemException.resource: \
  92     $(CORBA_TOPDIR)/src/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
  93     $(BUILD_LOGUTIL)
  94         $(MKDIR) -p $(@D)
  95         $(RM) -f $(@D)/_the_wrappers.d
  96         $(ECHO) $(LOG_INFO) Generating resource file from $*.mc
  97         $(TOOL_LOGUTIL_CMD) make-resource $< $(@D)
  98 
  99 
 100 LOGWRAPPER_TARGETS := \
 101     $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/ActivationSystemException.java \
 102     $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/IORSystemException.java \
 103     $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/InterceptorsSystemException.java \
 104     $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/NamingSystemException.java \
 105     $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/OMGSystemException.java \
 106     $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/ORBUtilSystemException.java \
 107     $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/POASystemException.java \
 108     $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/UtilSystemException.java \
 109     $(CORBA_OUTPUTDIR)/gensrc/com/sun/corba/se/impl/logging/LogStrings.properties
 110 
 111 ################################################################################
 112 # Build the IDLs.
 113 
 114 $(eval $(call SetupIdlCompilation,BUILD_IDLS, \
 115     IDLJ := $(TOOL_IDLJ_CMD), \
 116     SRC := $(CORBA_TOPDIR)/src/share/classes, \
 117     BIN := $(CORBA_OUTPUTDIR)/gensrc, \
 118     EXCLUDES := com/sun/tools/corba/se/idl/% \
 119         org/omg/CORBA/% \
 120         com/sun/corba/se/GiopIDL/% \
 121         org/omg/PortableServer/corba.idl, \
 122     INCLUDES := %, \
 123     OLDIMPLBASES := com/sun/corba/se/PortableActivationIDL/activation.idl \
 124         com/sun/corba/se/spi/activation/activation.idl, \
 125     DELETES := DYNANYDELETEFILES org/omg/DynamicAny/*POA* org/omg/DynamicAny/*Holder* org/omg/DynamicAny/DynValueBoxHelper.java org/omg/DynamicAny/DynValueCommonHelper.java org/omg/DynamicAny/_DynValueCommonStub.java org/omg/DynamicAny/_DynValueBoxStub.java org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.java org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.java org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.java IOPDELETEFILES org/omg/IOP/BI_DIR_IIOP.java org/omg/IOP/ChainBypassCheck.java org/omg/IOP/ChainBypassInfo.java org/omg/IOP/FORWARDED_IDENTITY.java org/omg/IOP/INVOCATION_POLICIES.java org/omg/IOP/LogicalThreadId.java org/omg/IOP/SendingContextRunTime.java org/omg/IOP/UnknownExceptionInfo.java org/omg/IOP/TaggedComponentSeqHolder.java POAHELHOLFILES org/omg/PortableServer/CurrentPackage/NoContextHolder.java org/omg/PortableServer/ForwardRequestHolder.java org/omg/PortableServer/IdAssignmentPolicyValueHelper.java org/omg/PortableServer/IdAssignmentPolicyValueHolder.java org/omg/PortableServer/IdUniquenessPolicyValueHelper.java org/omg/PortableServer/IdUniquenessPolicyValueHolder.java org/omg/PortableServer/ImplicitActivationPolicyValueHelper.java org/omg/PortableServer/ImplicitActivationPolicyValueHolder.java org/omg/PortableServer/LifespanPolicyValueHelper.java org/omg/PortableServer/LifespanPolicyValueHolder.java org/omg/PortableServer/ServantRetentionPolicyValueHelper.java org/omg/PortableServer/ServantRetentionPolicyValueHolder.java org/omg/PortableServer/ObjectIdHelper.java org/omg/PortableServer/ObjectIdHolder.java org/omg/PortableServer/POAListHelper.java org/omg/PortableServer/POAListHolder.java org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.java org/omg/PortableServer/POAManagerPackage/StateHelper.java org/omg/PortableServer/POAManagerPackage/StateHolder.java org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.java org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.java org/omg/PortableServer/POAPackage/InvalidPolicyHolder.java org/omg/PortableServer/POAPackage/NoServantHolder.java org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.java org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.java org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.java org/omg/PortableServer/POAPackage/ServantNotActiveHolder.java org/omg/PortableServer/POAPackage/WrongAdapterHolder.java org/omg/PortableServer/POAPackage/WrongPolicyHolder.java org/omg/PortableServer/RequestProcessingPolicyValueHelper.java org/omg/PortableServer/RequestProcessingPolicyValueHolder.java org/omg/PortableServer/ServantActivatorHolder.java org/omg/PortableServer/ServantLocatorHolder.java org/omg/PortableServer/ThreadPolicyValueHelper.java org/omg/PortableServer/ThreadPolicyValueHolder.java PIHELHOLFILES org/omg/PortableInterceptor/ClientRequestInfoHelper.java org/omg/PortableInterceptor/ClientRequestInterceptorHelper.java org/omg/PortableInterceptor/IORInfoHelper.java org/omg/PortableInterceptor/IORInterceptorHelper.java org/omg/PortableInterceptor/InterceptorHelper.java org/omg/PortableInterceptor/ORBInitInfoHelper.java org/omg/PortableInterceptor/ORBInitializerHelper.java org/omg/PortableInterceptor/PolicyFactoryHelper.java org/omg/PortableInterceptor/ReplyStatusHelper.java org/omg/PortableInterceptor/RequestInfoHelper.java org/omg/PortableInterceptor/ServerRequestInfoHelper.java org/omg/PortableInterceptor/ServerRequestInterceptorHelper.java org/omg/PortableInterceptor/SlotIdHelper.java org/omg/PortableInterceptor/ClientRequestInfoHolder.java org/omg/PortableInterceptor/ClientRequestInterceptorHolder.java org/omg/PortableInterceptor/CurrentHolder.java org/omg/PortableInterceptor/ForwardRequestHolder.java org/omg/PortableInterceptor/IORInfoHolder.java org/omg/PortableInterceptor/IORInterceptorHolder.java org/omg/PortableInterceptor/InterceptorHolder.java org/omg/PortableInterceptor/InvalidSlotHolder.java org/omg/PortableInterceptor/ORBInitInfoHolder.java org/omg/PortableInterceptor/ORBInitializerHolder.java org/omg/PortableInterceptor/PolicyFactoryHolder.java org/omg/PortableInterceptor/RequestInfoHolder.java org/omg/PortableInterceptor/ServerRequestInfoHolder.java org/omg/PortableInterceptor/ServerRequestInterceptorHolder.java org/omg/PortableInterceptor/TaggedComponentSeqHolder.java org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHolder.java org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHolder.java org/omg/IOP/CodecPackage/FormatMismatchHolder.java org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.java org/omg/IOP/CodecPackage/TypeMismatchHolder.java org/omg/IOP/CodecHelper.java org/omg/IOP/EncodingFormatHelper.java org/omg/IOP/EncodingHelper.java org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.java org/omg/IOP/CodecFactoryHolder.java org/omg/IOP/CodecHolder.java org/omg/IOP/EncodingHolder.java org/omg/IOP/TaggedComponentSeqHelper.java org/omg/Dynamic/ContextListHelper.java org/omg/Dynamic/ExceptionListHelper.java org/omg/Dynamic/ParameterHolder.java org/omg/Dynamic/ParameterListHolder.java org/omg/Dynamic/ExceptionListHolder.java org/omg/Dynamic/ParameterHelper.java org/omg/Dynamic/ParameterListHelper.java org/omg/Dynamic/RequestContextHelper.java CORBAX org/omg/CORBA/OctetSeqHelper.java org/omg/CORBA/OctetSeqHolder.java org/omg/CORBA/PolicyError.java org/omg/CORBA/RepositoryIdHelper.java))
 126 
 127 $(BUILD_IDLS): $(BUILD_IDLJ)
 128 
 129 ################################################################################
 130 # Run stripproperties on all sunorb resource files.
 131 
 132 STRIP_PROP_SRC_FILES := $(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb*.properties")
 133 STRIP_PROP_FILES := $(patsubst $(CORBA_TOPDIR)/src/share/classes/%, $(CORBA_OUTPUTDIR)/classes/%, \
 134     $(STRIP_PROP_SRC_FILES))
 135 # Simple delivery of zh_HK properties files just copies zh_TW properties files
 136 STRIP_PROP_SRC_FILE_ZH_TW := $(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb_zh_TW.properties")
 137 STRIP_PROP_SRC_FILES += $(STRIP_PROP_SRC_FILE_ZH_TW)
 138 STRIP_PROP_FILES += $(patsubst $(CORBA_TOPDIR)/src/share/classes/%_zh_TW.properties, \
 139     $(CORBA_OUTPUTDIR)/classes/%_zh_HK.properties, $(STRIP_PROP_SRC_FILE_ZH_TW))
 140 STRIP_PROP_CMDLINE := $(subst _SPACE_, $(SPACE), \
 141     $(join $(addprefix -clean_SPACE_, $(STRIP_PROP_SRC_FILES)), \
 142     $(addprefix _SPACE_, $(STRIP_PROP_FILES))))
 143 
 144 $(CORBA_OUTPUTDIR)/_the.stripped_properties: $(STRIP_PROP_SRC_FILES) \
 145     $(BUILD_STRIPPROP)
 146         $(MKDIR) -p $(sort $(dir $(STRIP_PROP_FILES)))
 147         $(call ListPathsSafely,STRIP_PROP_CMDLINE,\n, >> $(CORBA_OUTPUTDIR)/_the.strip_prop.cmdline)
 148         $(TOOL_STRIPPROP_CMD) @$(CORBA_OUTPUTDIR)/_the.strip_prop.cmdline
 149         $(TOUCH) $@
 150 
 151 ################################################################################
 152 
 153 all: $(BUILD_IDLS) $(CORBA_OUTPUTDIR)/_the.stripped_properties $(LOGWRAPPER_TARGETS)