Tools.gmk 6.8 KB
Newer Older
1
#
2
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code 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.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code 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 in the LICENSE file that
# accompanied this code).
#
# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

26
# Cache all finds needed for this file. Only used on windows.
I
ihse 已提交
27
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/make/src/classes))
28

I
ihse 已提交
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 34
endif

35
# The exception handling of swing beaninfo which have the own tool directory
36 37 38 39 40
ifeq (, $(BUILD_TOOLS))
  $(eval $(call SetupJavaCompilation,BUILD_TOOLS, \
      SETUP := GENERATE_OLDBYTECODE, \
      SRC := $(TOOLS_SRC), \
      BIN := $(JDK_OUTPUTDIR)/btclasses))
41 42
endif

43 44
$(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/%.template: \
    $(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

I
ihse 已提交
49 50 51
# Resource used by CheckDeps tool
$(JDK_OUTPUTDIR)/btclasses/build/tools/deps/refs.allowed: \
    $(JDK_TOPDIR)/make/data/checkdeps/refs.allowed
52
	$(call install-file)
53 54 55

BUILD_TOOLS += $(JDK_OUTPUTDIR)/btclasses/build/tools/deps/refs.allowed

56
# Add a checksum ("jsum") to the end of a text file. Prevents trivial tampering with class lists.
E
erikj 已提交
57
TOOL_ADDJSUM = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
58
    build.tools.addjsum.AddJsum
59 60

# The buildmetaindex tool creates a meta-index to make core class loaders lazier.
E
erikj 已提交
61
TOOL_BUILDMETAINDEX = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
62
    build.tools.buildmetaindex.BuildMetaIndex
63

E
erikj 已提交
64
TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
65
    build.tools.compilefontconfig.CompileFontConfig
66

E
erikj 已提交
67
TOOL_COMPILEPROPERTIES = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
68
    build.tools.compileproperties.CompileProperties
69

E
erikj 已提交
70
TOOL_STRIPPROPERTIES = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
71
    build.tools.stripproperties.StripProperties
72

E
erikj 已提交
73
TOOL_JARREORDER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
74
    build.tools.jarreorder.JarReorder
75

E
erikj 已提交
76
TOOL_GENERATECHARACTER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
77
    build.tools.generatecharacter.GenerateCharacter
78

E
erikj 已提交
79
TOOL_CHARACTERNAME = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
80
    build.tools.generatecharacter.CharacterName
81

E
erikj 已提交
82
TOOL_DTDBUILDER = $(JAVA_SMALL) -Ddtd_home=$(JDK_TOPDIR)/make/data/dtdbuilder \
83
    -Djava.awt.headless=true \
84
    -cp $(JDK_OUTPUTDIR)/btclasses build.tools.dtdbuilder.DTDBuilder
85

E
erikj 已提交
86
TOOL_GENERATEBREAKITERATORDATA = $(JAVA_SMALL) \
87 88
    -cp $(JDK_OUTPUTDIR)/btclasses \
    build.tools.generatebreakiteratordata.GenerateBreakIteratorData
89

E
erikj 已提交
90
TOOL_GENERATECURRENCYDATA = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
91
    build.tools.generatecurrencydata.GenerateCurrencyData
92

E
erikj 已提交
93
TOOL_HASHER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
94
    build.tools.hasher.Hasher
95

E
erikj 已提交
96
TOOL_TZDB = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
97
    build.tools.tzdb.TzdbZoneRulesCompiler
S
sherman 已提交
98 99


100
# TODO: There are references to the jdwpgen.jar in jdk/make/netbeans/jdwpgen/build.xml
101
# and nbproject/project.properties in the same dir. Needs to be looked at.
E
erikj 已提交
102
TOOL_JDWPGEN = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses build.tools.jdwpgen.Main
103 104

# TODO: Lots of files in jdk/make/tools/CharsetMapping dir
E
erikj 已提交
105
TOOL_CHARSETMAPPING = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
106
    build.tools.charsetmapping.Main
107

E
erikj 已提交
108
TOOL_SPP = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses build.tools.spp.Spp
109 110

# Nimbus is used somewhere in the swing build.
E
erikj 已提交
111
TOOL_GENERATENIMBUS = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
112
    build.tools.generatenimbus.Generator
113

E
erikj 已提交
114
TOOL_WRAPPERGENERATOR = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
115
    WrapperGenerator
116

E
erikj 已提交
117
TOOL_AWT_TOBIN = $(JAVA_SMALL) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \
I
ihse 已提交
118
    build.tools.icondata.awt.ToBin
119

E
erikj 已提交
120
TOOL_OSX_TOBIN = $(JAVA_SMALL) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \
I
ihse 已提交
121
    build.tools.icondata.osxapp.ToBin
O
ohair 已提交
122

E
erikj 已提交
123
TOOL_CLDRCONVERTER = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
124
    build.tools.cldrconverter.CLDRConverter
125

126 127 128
TOOL_GENERATELSREQUIVMAPS = $(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
    build.tools.generatelsrequivmaps.EquivMapsGenerator

E
erikj 已提交
129
TOOL_REMOVEMETHODS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
130
    -cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
131
    build.tools.classfile.RemoveMethods
132

E
erikj 已提交
133
TOOL_CHECKDEPS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
134
    -cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
135
    build.tools.deps.CheckDeps
136

E
erikj 已提交
137
TOOL_ADDTORESTRICTEDPKGS=$(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
138 139 140 141
    build.tools.customizesecurityfile.AddToRestrictedPkgs

TOOL_CRYPTOLEVEL=$(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
    build.tools.customizesecurityfile.CryptoLevel
142

143 144 145 146
##########################################################################################

# Tools needed on solaris because OBJCOPY is broken.

147
ifeq ($(OPENJDK_TARGET_OS), solaris)
148
$(eval $(call SetupNativeCompilation,ADD_GNU_DEBUGLINK, \
I
ihse 已提交
149
    SRC := $(JDK_TOPDIR)/make/src/native/add_gnu_debuglink, \
150 151 152 153 154 155 156 157 158
    LANG := C, \
    CC := $(BUILD_CC), \
    LDEXE := $(BUILD_LD), \
    LDFLAGS := -lelf, \
    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/add_gnu_debuglink, \
    OUTPUT_DIR := $(JDK_OUTPUTDIR)/btbin, \
    PROGRAM := add_gnu_debuglink))

$(eval $(call SetupNativeCompilation,FIX_EMPTY_SEC_HDR_FLAGS, \
I
ihse 已提交
159
    SRC := $(JDK_TOPDIR)/make/src/native/fix_empty_sec_hdr_flags, \
160 161 162 163 164 165 166
    LANG := C, \
    CC := $(BUILD_CC), \
    LDEXE := $(BUILD_LD), \
    LDFLAGS := -lelf, \
    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/fix_empty_sec_hdr_flags, \
    OUTPUT_DIR := $(JDK_OUTPUTDIR)/btbin, \
    PROGRAM := fix_empty_sec_hdr_flags))
167
endif