jdk/make/gensrc/Gensrc-jdk.jdi.gmk
changeset 27565 729f9700483a
parent 27088 ea6446a9121b
child 27953 03e0e3891572
equal deleted inserted replaced
27564:eaaa79b68cd5 27565:729f9700483a
     1 #
     1 #
     2 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     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
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
    28 ################################################################################
    28 ################################################################################
    29 # Translate the Java debugger wire protocol (jdwp.spec) file into a JDWP.java file
    29 # Translate the Java debugger wire protocol (jdwp.spec) file into a JDWP.java file
    30 # and a JDWPCommands.h C-header file.
    30 # and a JDWPCommands.h C-header file.
    31 
    31 
    32 JDWP_SPEC_FILE := $(JDK_TOPDIR)/make/data/jdwp/jdwp.spec
    32 JDWP_SPEC_FILE := $(JDK_TOPDIR)/make/data/jdwp/jdwp.spec
       
    33 HEADER_FILE := $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
       
    34 JAVA_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java
    33 
    35 
    34 $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h: $(JDWP_SPEC_FILE)
    36 # Both the header and java file are created using the same recipe. By declaring
       
    37 # this rule and adding header file to dependencies for java file, both are 
       
    38 # rebuilt if either is missing
       
    39 $(HEADER_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK)
    35 
    40 
    36 $(JDK_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java: \
    41 # Touch the target of this rule at the end to avoid triggering false rebuilds
    37     $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK)
    42 $(JAVA_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK) $(HEADER_FILE)
    38 	$(MKDIR) -p $(@D)
    43 	$(MKDIR) -p $(@D)
    39 	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_jdwp_headers
    44 	$(MKDIR) -p $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent
    40 	$(RM) $@ $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h
    45 	$(RM) $@ $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
    41 	$(ECHO) $(LOG_INFO) Creating JDWP.java and JDWPCommands.h from jdwp.spec
    46 	$(ECHO) $(LOG_INFO) Creating JDWP.java and JDWPCommands.h from jdwp.spec
    42 	$(TOOL_JDWPGEN) $< -jdi $@ -include $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h
    47 	$(TOOL_JDWPGEN) $< -jdi $@ -include \
       
    48 	    $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
       
    49 	$(TOUCH) $@
    43 
    50 
    44 $(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html: $(JDWP_SPEC_FILE) \
    51 $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html: $(JDWP_SPEC_FILE) \
    45     $(BUILD_TOOLS_JDK)
    52     $(BUILD_TOOLS_JDK)
    46 	$(MKDIR) -p $(@D)
    53 	$(MKDIR) -p $(@D)
    47 	$(RM) $@
    54 	$(RM) $@
    48 	$(ECHO) $(LOG_INFO) Creating $(@F) from jdwp.spec
    55 	$(ECHO) $(LOG_INFO) Creating $(@F) from jdwp.spec
    49 	$(TOOL_JDWPGEN) $< -doc $@
    56 	$(TOOL_JDWPGEN) $< -doc $@
    50 
    57 
    51 GENSRC_JDWP := $(JDK_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java \
    58 GENSRC_JDWP := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java \
    52     $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h \
    59     $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h \
    53     $(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html
    60     $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
    54 GENSRC_JDK_JDI += $(GENSRC_JDWP)
    61 GENSRC_JDK_JDI += $(GENSRC_JDWP)
    55 
    62 
    56 ################################################################################
    63 ################################################################################
    57 
    64 
    58 define process-provider
    65 define process-provider
    59 	$(MKDIR) -p $(@D)
    66 	$(MKDIR) -p $(@D)
    60 	$(CAT) $^ | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $@
    67 	$(CAT) $^ | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $@
    61 endef
    68 endef
    62 
    69 
    63 # Filter com.sun.jdi.connect.Connector
    70 # Filter com.sun.jdi.connect.Connector
    64 $(JDK_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector: \
    71 $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector: \
    65     $(JDK_TOPDIR)/src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector
    72     $(JDK_TOPDIR)/src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector \
       
    73     $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
    66 	$(process-provider)
    74 	$(process-provider)
    67 
    75 
    68 GENSRC_JDK_JDI += $(JDK_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector
    76 # Copy the same service file into jdk.hotspot.agent so that they are kept the same.
       
    77 $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector: \
       
    78     $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector
       
    79 	$(install-file)
       
    80 
       
    81 GENSRC_JDK_JDI += $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector \
       
    82     $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector
    69 
    83 
    70 ################################################################################
    84 ################################################################################
    71 
    85 
    72 include GensrcProperties.gmk
    86 include GensrcProperties.gmk
    73 
    87