1 # 2 # Copyright (c) 2011, 2020, 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 include GensrcCommonJdk.gmk 27 28 ################################################################################ 29 # Translate the Java debugger wire protocol (jdwp.spec) file into a JDWP.java file 30 # and a JDWPCommands.h C-header file. 31 32 TOOL_JDWPGEN = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ 33 org.openjdk.buildtools.jdwpgen.Main 34 35 JDWP_SPEC_FILE := $(TOPDIR)/make/data/jdwp/jdwp.spec 36 HEADER_FILE := $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h 37 JAVA_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java 38 39 # Both the header and java file are created using the same recipe. By declaring 40 # this rule and adding header file to dependencies for java file, both are 41 # rebuilt if either is missing 42 $(HEADER_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK) 43 44 # Touch the target of this rule at the end to avoid triggering false rebuilds 45 $(JAVA_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK) $(HEADER_FILE) 46 $(call LogInfo, Creating JDWP.java and JDWPCommands.h from jdwp.spec) 47 $(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent) 48 $(RM) $@ $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h 49 $(TOOL_JDWPGEN) $< -jdi $@ -include \ 50 $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h 51 $(TOUCH) $@ 52 53 $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html: $(JDWP_SPEC_FILE) \ 54 $(BUILD_TOOLS_JDK) 55 $(call LogInfo, Creating $(@F) from jdwp.spec) 56 $(call MakeDir, $(@D)) 57 $(RM) $@ 58 $(TOOL_JDWPGEN) $< -doc $@ 59 60 GENSRC_JDWP := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java \ 61 $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h \ 62 $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html 63 GENSRC_JDK_JDI += $(GENSRC_JDWP) 64 65 ################################################################################ 66 67 include GensrcProperties.gmk 68 69 $(eval $(call SetupCompileProperties, COMPILE_PROPERTIES, \ 70 SRC_DIRS := $(TOPDIR)/src/jdk.jdi/share/classes/com/sun/tools/jdi/resources, \ 71 CLASS := ListResourceBundle, \ 72 )) 73 74 GENSRC_JDK_JDI += $(COMPILE_PROPERTIES) 75 76 ################################################################################ 77 78 jdk.jdi: $(GENSRC_JDK_JDI) 79 80 all: jdk.jdi 81 82 .PHONY: all jdk.jdi