#
#   
#
# Copyright  1990-2006 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version
# 2 only, as published by the Free Software Foundation. 
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 for more details (a copy is
# included at /legal/license.txt). 
# 
# You should have received a copy of the GNU General Public License
# version 2 along with this work; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA 
# 
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 or visit www.sun.com if you need additional
# information or have any questions. 
######################################################################
#
# Module's Component Configuration file
#
######################################################################

# Add to global SUBSYSTEMS list
#
SUBSYSTEMS += jsr_172

# Javadoc source path
SUBSYSTEM_JSR172_SOURCEPATH += $(JSR_172_DIR)/src/ri/jaxp$(PATHSEP)$(JSR_172_DIR)/src/ri/jaxrpc$(PATHSEP)$(JSR_172_DIR)/src/ri/sg

ifneq ($(USE_JSR_177), true)
SUBSYSTEM_JSR172_SOURCEPATH += $(PATHSEP)$(JSR_172_DIR)/src/ri/rmi
endif

SUBSYSTEM_JSR172_PACKAGES = \
   com.sun.j2mews.sg \
   com.sun.j2mews.xml.rpc \
   com.sun.ukit.jaxp \
   javax.microedition.xml.rpc \
   javax.xml.namespace \
   javax.xml.parsers \
   javax.xml.rpc \
   org.xml.sax \
   org.xml.sax.helpers

MIDP_JAVADOC_SOURCEPATH += $(SUBSYSTEM_JSR172_SOURCEPATH)
MIDP_JAVADOC_PACKAGES +=  $(SUBSYSTEM_JSR172_PACKAGES)

MIDP_JAVADOC_ALL += \
	-group "JSR172 Web Services" \
	$(shell echo $(SUBSYSTEM_JSR172_PACKAGES) | tr ' ' $(PATHSEP))

# Java files for the ( jsr_172 ) module
#
INTERNAL_JSR_172_RI_DIR    = $(JSR_172_DIR)/src/ri
INTERNAL_JSR_172_CONFIG_DIR = $(JSR_172_DIR)/src/config

# Jpp files that need preprocessing
#
$(GENERATED_DIR)/classes/com/sun/j2mews/xml/rpc/SOAPDecoder.java: $(INTERNAL_JSR_172_RI_DIR)/jaxrpc/com/sun/j2mews/xml/rpc/SOAPDecoder.jpp
	@$(call runjpp,$^,$@)

$(GENERATED_DIR)/classes/com/sun/j2mews/xml/rpc/SOAPEncoder.java: $(INTERNAL_JSR_172_RI_DIR)/jaxrpc/com/sun/j2mews/xml/rpc/SOAPEncoder.jpp
	@$(call runjpp,$^,$@)

# Include JSR_172 system properties in Configuration
SUBSYSTEM_CONFIGURATION_INPUT_FILES += \
	$(INTERNAL_JSR_172_CONFIG_DIR)/properties_jsr172.xml \
	$(INTERNAL_JSR_172_CONFIG_DIR)/constants_jsr172.xml

# ri_jaxp 
#
INTERNAL_JSR_172_JAVA_FILES_JAXP_RI_FILES := \
       	$(shell (find $(INTERNAL_JSR_172_RI_DIR)/jaxp -name '*.java' | egrep -v 'SCCS'))

# ri_jaxrpc
#
INTERNAL_JSR_172_JAVA_FILES_JAXRPC_RI_FILES := \
       	$(shell (find $(INTERNAL_JSR_172_RI_DIR)/jaxrpc -name '*.java' | egrep -v 'SCCS')) \
	$(GENERATED_DIR)/classes/com/sun/j2mews/xml/rpc/SOAPDecoder.java \
	$(GENERATED_DIR)/classes/com/sun/j2mews/xml/rpc/SOAPEncoder.java

# rmi (for ri_jaxrpc)
INTERNAL_JSR_172_JAVA_FILES_RMI_RI_FILES := \
       	$(shell (find $(INTERNAL_JSR_172_RI_DIR)/rmi -name '*.java' | egrep -v 'SCCS'))

# All of them together to provide to main makefile
SUBSYSTEM_JSR_172_JAVA_FILES = \
    $(INTERNAL_JSR_172_JAVA_FILES_JAXP_RI_FILES) \
    $(INTERNAL_JSR_172_JAVA_FILES_JAXRPC_RI_FILES) \
    $(INTERNAL_JSR_172_JAVA_FILES_RMI_RI_FILES)

# Append JSR 172 source bundle creation to target
source_bundle:: jsr_172_source_bundle

# Create JSR 172 source in subdir 'jsr172/'
JSR_172_SOURCE_OUTPUT_DIR=$(SOURCE_OUTPUT_DIR)/jsr172

# Copy and filter JSR 172 source in WMA_SOURCE_OUTPUT_DIR
jsr_172_source_bundle: JSR_172_DIR SOURCE_OUTPUT_DIR
	@echo " ... JSR 172 source bundle" $(LOG)
	@$(call re_src_filter,$(JSR_172_DIR),$(JSR_172_SOURCE_OUTPUT_DIR),src)
