jdk/make/Tools.gmk
changeset 22858 f4a6f0eba875
parent 21805 c7d7946239de
child 22046 b7163958d6d9
equal deleted inserted replaced
22857:2167396cfc83 22858:f4a6f0eba875
       
     1 #
       
     2 # Copyright (c) 2011, 2013, 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 # Cache all finds needed for this file. Only used on windows.
       
    27 $(eval $(call FillCacheFind, $(JDK_TOPDIR)/make/src/classes))
       
    28 
       
    29 TOOLS_SRC := $(JDK_TOPDIR)/make/src/classes
       
    30 
       
    31 ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
       
    32   TOOLS_SRC += $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator
       
    33 endif
       
    34 
       
    35 # The exception handling of swing beaninfo which have the own tool directory
       
    36 ifeq (, $(BUILD_TOOLS))
       
    37   $(eval $(call SetupJavaCompilation,BUILD_TOOLS, \
       
    38       SETUP := GENERATE_OLDBYTECODE, \
       
    39       SRC := $(TOOLS_SRC), \
       
    40       BIN := $(JDK_OUTPUTDIR)/btclasses))
       
    41 endif
       
    42 
       
    43 $(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/%.template: \
       
    44     $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/%.template
       
    45 	$(call install-file)
       
    46 
       
    47 BUILD_TOOLS += $(foreach i, $(wildcard $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/*.template), $(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/$(notdir $i))
       
    48 
       
    49 # Resource used by CheckDeps tool
       
    50 $(JDK_OUTPUTDIR)/btclasses/build/tools/deps/refs.allowed: \
       
    51     $(JDK_TOPDIR)/make/data/checkdeps/refs.allowed
       
    52 	$(call install-file)
       
    53 
       
    54 BUILD_TOOLS += $(JDK_OUTPUTDIR)/btclasses/build/tools/deps/refs.allowed
       
    55 
       
    56 # Add a checksum ("jsum") to the end of a text file. Prevents trivial tampering with class lists.
       
    57 TOOL_ADDJSUM = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    58     build.tools.addjsum.AddJsum
       
    59 
       
    60 # The buildmetaindex tool creates a meta-index to make core class loaders lazier.
       
    61 TOOL_BUILDMETAINDEX = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    62     build.tools.buildmetaindex.BuildMetaIndex
       
    63 
       
    64 TOOL_COMPILEFONTCONFIG = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    65     build.tools.compilefontconfig.CompileFontConfig
       
    66 
       
    67 TOOL_COMPILEPROPERTIES = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    68     build.tools.compileproperties.CompileProperties
       
    69 
       
    70 TOOL_STRIPPROPERTIES = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    71     build.tools.stripproperties.StripProperties
       
    72 
       
    73 TOOL_JARREORDER = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    74     build.tools.jarreorder.JarReorder
       
    75 
       
    76 TOOL_GENERATECHARACTER = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    77     build.tools.generatecharacter.GenerateCharacter
       
    78 
       
    79 TOOL_CHARACTERNAME = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    80     build.tools.generatecharacter.CharacterName
       
    81 
       
    82 TOOL_DTDBUILDER = $(JAVA) -Ddtd_home=$(JDK_TOPDIR)/make/data/dtdbuilder \
       
    83     -cp $(JDK_OUTPUTDIR)/btclasses build.tools.dtdbuilder.DTDBuilder
       
    84 
       
    85 TOOL_GENERATEBREAKITERATORDATA = $(JAVA) \
       
    86     -cp $(JDK_OUTPUTDIR)/btclasses \
       
    87     build.tools.generatebreakiteratordata.GenerateBreakIteratorData
       
    88 
       
    89 TOOL_GENERATECURRENCYDATA = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    90     build.tools.generatecurrencydata.GenerateCurrencyData
       
    91 
       
    92 TOOL_HASHER = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    93     build.tools.hasher.Hasher
       
    94 
       
    95 TOOL_TZDB = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
    96     build.tools.tzdb.TzdbZoneRulesCompiler
       
    97 
       
    98 
       
    99 # TODO: There are references to the jdwpgen.jar in jdk/make/netbeans/jdwpgen/build.xml
       
   100 # and nbproject/project.properties in the same dir. Needs to be looked at.
       
   101 TOOL_JDWPGEN = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses build.tools.jdwpgen.Main
       
   102 
       
   103 # TODO: Lots of files in jdk/make/tools/CharsetMapping dir
       
   104 TOOL_CHARSETMAPPING = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
   105     build.tools.charsetmapping.Main
       
   106 
       
   107 TOOL_SPP = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses build.tools.spp.Spp
       
   108 
       
   109 # Nimbus is used somewhere in the swing build.
       
   110 TOOL_GENERATENIMBUS = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
   111     build.tools.generatenimbus.Generator
       
   112 
       
   113 TOOL_WRAPPERGENERATOR = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
   114     WrapperGenerator
       
   115 
       
   116 TOOL_AWT_TOBIN = $(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \
       
   117     build.tools.icondata.awt.ToBin
       
   118 
       
   119 TOOL_OSX_TOBIN = $(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \
       
   120     build.tools.icondata.osxapp.ToBin
       
   121 
       
   122 TOOL_CLDRCONVERTER = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
   123     build.tools.cldrconverter.CLDRConverter
       
   124 
       
   125 TOOL_REMOVEMETHODS = $(JAVA) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
       
   126     -cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
       
   127     build.tools.classfile.RemoveMethods
       
   128 
       
   129 TOOL_CHECKDEPS = $(JAVA) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
       
   130     -cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
       
   131     build.tools.deps.CheckDeps
       
   132 
       
   133 TOOL_ADDTORESTRICTEDPKGS=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
       
   134  	build.tools.addtorestrictedpkgs.AddToRestrictedPkgs
       
   135 
       
   136 ##########################################################################################
       
   137 
       
   138 # Tools needed on solaris because OBJCOPY is broken.
       
   139 
       
   140 ifeq ($(OPENJDK_TARGET_OS), solaris)
       
   141 $(eval $(call SetupNativeCompilation,ADD_GNU_DEBUGLINK, \
       
   142     SRC := $(JDK_TOPDIR)/make/src/native/add_gnu_debuglink, \
       
   143     LANG := C, \
       
   144     CC := $(BUILD_CC), \
       
   145     LDEXE := $(BUILD_LD), \
       
   146     LDFLAGS := -lelf, \
       
   147     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/add_gnu_debuglink, \
       
   148     OUTPUT_DIR := $(JDK_OUTPUTDIR)/btbin, \
       
   149     PROGRAM := add_gnu_debuglink))
       
   150 
       
   151 $(eval $(call SetupNativeCompilation,FIX_EMPTY_SEC_HDR_FLAGS, \
       
   152     SRC := $(JDK_TOPDIR)/make/src/native/fix_empty_sec_hdr_flags, \
       
   153     LANG := C, \
       
   154     CC := $(BUILD_CC), \
       
   155     LDEXE := $(BUILD_LD), \
       
   156     LDFLAGS := -lelf, \
       
   157     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/fix_empty_sec_hdr_flags, \
       
   158     OUTPUT_DIR := $(JDK_OUTPUTDIR)/btbin, \
       
   159     PROGRAM := fix_empty_sec_hdr_flags))
       
   160 endif