langtools/make/Makefile-classic
author duke
Wed, 05 Jul 2017 18:09:07 +0200
changeset 12463 a3b1ce50a059
parent 11864 116173ff7d77
child 14870 1a2371de04d8
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
#
11864
116173ff7d77 7041249: Remove apt tool and API from the JDK
darcy
parents: 5848
diff changeset
     2
# Copyright (c) 2007, 2012 Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
#
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
#
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    23
# questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
# Makefile for building the langtools workspace.
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
#
5848
c5a4ce47e780 6960407: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    31
# On Solaris, the standard 'make' utility will not work with these makefiles.
c5a4ce47e780 6960407: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    32
#    This little rule is only understood by Solaris make, and is harmless
c5a4ce47e780 6960407: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    33
#    when seen by the GNU make tool. If using Solaris make, this causes the
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
#    make command to fail.
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
#----- cancel implicit rules
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
%: %.o
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
%: %.obj
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
%: %.dll
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
%: %.c
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
%: %.cc
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
%: %.C
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
%: %.p
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
%: %.f
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
%: %.s
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
%: %.F
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
%: %.r
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
%: %.S
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
%: %.mod
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
%: %.sh
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
%: %,v
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
%: RCS/%,v
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
#----- imports
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
ifdef ALT_BOOT_JAVA_HOME
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
  BOOT_JAVA_HOME = $(ALT_BOOT_JAVA_HOME)
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
else 
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
  ifdef ALT_BOOTDIR
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    BOOT_JAVA_HOME = $(ALT_BOOTDIR)
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
  else
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    BOOT_JAVA_HOME=/java/re/jdk/1.5.0/archive/fcs/binaries/solaris-sparc
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
  endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
BOOT_JAVA=$(BOOT_JAVA_HOME)/bin/java
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
BOOT_JAVAC=$(BOOT_JAVA_HOME)/bin/javac
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
BOOTJAR=$(BOOT_JAVA_HOME)/bin/jar
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
ifdef ALT_TESTJAVA_HOME
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
  TESTJAVA_HOME = $(ALT_TESTJAVA_HOME)
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
else
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
  TESTJAVA_HOME=/java/re/jdk/1.6.0/archive/fcs/binaries/solaris-sparc
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
TESTJAVA=$(TESTJAVA_HOME)/bin/java
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
ifdef ALT_FINDBUGS_HOME
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
  FINDBUGS_HOME = $(ALT_FINDBUGS_HOME)
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
else
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
  FINDBUGS_HOME = /java/devtools/share/findbugs/1.1.2-rc4
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
#----- commands
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
CHMOD = chmod
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
CP = cp
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
ECHO = echo # FIXME
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
FIND = find
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
MKDIR = mkdir
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
SED = sed
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
ZIP = zip
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
#-----  locations and deliverables
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
TOPDIR = ..
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
SRC_BIN_DIR = $(TOPDIR)/src/share/bin
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
SRC_CLASSES_DIR = $(TOPDIR)/src/share/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
BUILD_DIR = $(TOPDIR)/build
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
CLASSES_DIR = $(BUILD_DIR)/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
GENSRC_DIR = $(BUILD_DIR)/gensrc
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
DIST_DIR = $(TOPDIR)/dist
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
BIN_DIR = $(DIST_DIR)/bin
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
LIB_DIR = $(DIST_DIR)/lib
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
JAVAC_JAR = $(LIB_DIR)/javac.jar
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
JAVADOC_JAR = $(LIB_DIR)/javadoc.jar
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
JAVAH_JAR = $(LIB_DIR)/javah.jar
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
JAVAP_JAR = $(LIB_DIR)/javap.jar
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
CLASSES_JAR = $(DIST_DIR)/classes.jar
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
SRC_ZIP = $(DIST_DIR)/src.zip
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
BUILDTOOLSRC_DIR = tools
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
BUILDTOOLCLASSES_DIR = $(BUILD_DIR)/toolclasses
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
#-----
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
ifndef JDK_MAJOR_VERSION
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
  JDK_MAJOR_VERSION = 1
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
ifndef JDK_MINOR_VERSION
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
  JDK_MINOR_VERSION = 7
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
ifndef JDK_MICRO_VERSION
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
  JDK_MICRO_VERSION = 0
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
ifndef JDK_VERSION
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
  JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
ifndef MILESTONE
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
  MILESTONE = internal
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
ifneq ($(MILESTONE),fcs)
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
  RELEASE      = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE)
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
else
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
  RELEASE      = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE)
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
ifdef BUILD_NUMBER
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
  FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER)
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
else
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
  BUILD_NUMBER = b00
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
  USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`)
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
  FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
#----- useful macros
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
11864
116173ff7d77 7041249: Remove apt tool and API from the JDK
darcy
parents: 5848
diff changeset
   165
TOOLS =  javac javadoc javah javap
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
SOURCE_LEVEL = 5
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
BOOTSTRAP_TARGET_LEVEL = 5
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
TARGET_LEVEL = 6
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
ifndef TARGET_JAVA
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
  TARGET_JAVA = java
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
SELF = $(lastword $(MAKEFILE_LIST))
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
#-----
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
# the default is to generate the following:
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
# dist/{bin,lib}: 
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
# 	lang tools compiled to run on the target JDK
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
default:  
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
	$(MAKE) -f $(SELF) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
		MILESTONE=bootstrap \
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
		TARGET_LEVEL=$(BOOTSTRAP_TARGET_LEVEL) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
		TARGET_JAVA=$(BOOT_JAVA_HOME)/bin/java \
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
		GENSRC_DIR=$(BUILD_DIR)/bootstrap/gensrc \
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
		CLASSES_DIR=$(BUILD_DIR)/bootstrap/classes \
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
		BIN_DIR=$(BUILD_DIR)/bootstrap/bin \
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
		LIB_DIR=$(BUILD_DIR)/bootstrap/lib \
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
		$(BUILD_DIR)/bootstrap/lib/javac.jar \
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
		$(BUILD_DIR)/bootstrap/bin/javac
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
	$(MAKE) -f $(SELF) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
		BOOT_JAVAC=$(BUILD_DIR)/bootstrap/bin/javac \
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
		tools
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
# for jdk, we generate the following:
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
# dist/bootstrap/{bin,lib}:
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
#	lang tools compiled to run on the boot JDK
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
# dist/lib/classes.jar:
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
#	lang tools recompiled to run on the target JDK,
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
#	ready for inclusion in rt.jar and tools.jar
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
# dist/lib/src.zip
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
#	.properties and .java files for classes in classes.jar,
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
#	ready for jdk src.zip 
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
jdk:
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
	$(MAKE) -f $(SELF) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
		MILESTONE=bootstrap \
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
		TARGET_LEVEL=$(BOOTSTRAP_TARGET_LEVEL) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
		TARGET_JAVA=$(BOOT_JAVA_HOME)/bin/java \
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
		GENSRC_DIR=$(BUILD_DIR)/bootstrap/gensrc \
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
		CLASSES_DIR=$(BUILD_DIR)/bootstrap/classes \
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
		BIN_DIR=$(DIST_DIR)/bootstrap/bin \
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
		LIB_DIR=$(DIST_DIR)/bootstrap/lib \
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
		tools
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
	$(MAKE) -f $(SELF) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
		BOOT_JAVAC=$(DIST_DIR)/bootstrap/bin/javac \
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
		LIB_DIR=$(BUILD_DIR)/jdk/lib \
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
		$(DIST_DIR)/lib/classes.jar \
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
		$(DIST_DIR)/lib/src.zip
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
tools: $(TOOLS:%=$(LIB_DIR)/%.jar) $(TOOLS:%=$(BIN_DIR)/%)
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
clean:
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
	$(RM) -r $(BUILD_DIR)
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
really-clean: clean
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
	$(RM) -r $(DIST_DIR)
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
jprt_product_build \
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
jprt_debug_build \
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
jprt_fastdebug_build: lib
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
#-----  javac
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
JAVAC_DIRS = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
	javax/annotation/processing \
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
	javax/lang/model \
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
	javax/tools \
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
	com/sun/source \
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
	com/sun/tools/javac 
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
JAVAC_RESOURCE_FILES = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
	$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAC_DIRS)) -name SCCS -prune -o -name \*.properties -print )
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
JAVAC_JAVA_FILES = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
	$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAC_DIRS)) -name SCCS -prune -o -name \*.java -print ) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
	$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAC_RESOURCE_FILES)) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
	$(GENSRC_DIR)/com/sun/tools/javac/resources/version.java
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
$(JAVAC_JAR): $(JAVAC_JAVA_FILES)
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
	$(MKDIR) -p $(CLASSES_DIR) $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
	$(BOOT_JAVAC) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(NO_PROPRIETARY_API_WARNINGS) $(JAVAC_JAVA_FILES)
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
	( $(ECHO) Main-Class: com.sun.tools.javac.Main ) > $(BUILD_DIR)/javac.mf
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
	$(BOOTJAR) -cfm $@ $(BUILD_DIR)/javac.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVAC_DIRS))
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
#----- javadoc
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
### FIXME -- javadoc has a couple of extra non-property resource files
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
### that need to be included
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
JAVADOC_DIRS = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
	com/sun/javadoc \
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
	com/sun/tools/doclets \
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
	com/sun/tools/javadoc
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
JAVADOC_RESOURCE_FILES = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
	$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVADOC_DIRS)) -name SCCS -prune -o -name \*.properties -print )
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
JAVADOC_JAVA_FILES = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
	$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVADOC_DIRS)) -name SCCS -prune -o -name \*.java -print ) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
	$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVADOC_RESOURCE_FILES))
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
 
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
$(JAVADOC_JAR): $(JAVADOC_JAVA_FILES) $(JAVAC_JAR)
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
	$(MKDIR) -p $(CLASSES_DIR) $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
	$(BOOT_JAVAC) -sourcepath "" -classpath $(JAVAC_JAR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(JAVADOC_JAVA_FILES)
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
	( $(ECHO) Main-Class: com.sun.tools.javadoc.Main ; $(ECHO) Class-Path: javac.jar ) > $(BUILD_DIR)/javadoc.mf
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
	$(BOOTJAR) -cfm $@ $(BUILD_DIR)/javadoc.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVADOC_DIRS))
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
#----- javah
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
JAVAH_DIRS = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
	com/sun/tools/javah
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
JAVAH_RESOURCE_FILES = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
	$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAH_DIRS)) -name SCCS -prune -o -name \*.properties -print )
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
JAVAH_JAVA_FILES = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
	$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAH_DIRS)) -name SCCS -prune -o -name \*.java -print ) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
	$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAH_RESOURCE_FILES))
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
 
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
$(JAVAH_JAR): $(JAVAH_JAVA_FILES) $(JAVADOC_JAR)
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
	$(MKDIR) -p $(CLASSES_DIR) $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
	$(BOOT_JAVAC) -sourcepath "" -classpath $(CLASSES_DIR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(JAVAH_JAVA_FILES)
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
	( $(ECHO) Main-Class: com.sun.tools.javah.Main ; $(ECHO) Class-Path: javadoc.jar ) > $(BUILD_DIR)/javah.mf
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
	$(BOOTJAR) -cfm $@ $(BUILD_DIR)/javah.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVAH_DIRS))
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
#----- javap
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
JAVAP_DIRS = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
	sun/tools/javap
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
JAVAP_RESOURCE_FILES = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
	$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAP_DIRS)) -name SCCS -prune -o -name \*.properties -print )
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
JAVAP_JAVA_FILES = \
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
	$(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAP_DIRS)) -name SCCS -prune -o -name \*.java -print ) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
	$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAP_RESOURCE_FILES))
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
 
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
$(JAVAP_JAR): $(JAVAP_JAVA_FILES) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
		$(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAP_RESOURCE_FILES))
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
	$(MKDIR) -p $(CLASSES_DIR)
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
	$(BOOT_JAVAC) -sourcepath "" -classpath $(CLASSES_DIR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(JAVAP_JAVA_FILES)
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
	( $(ECHO) Main-Class: sun.tools.javap.Main ) > $(BUILD_DIR)/javap.mf
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
	$(BOOTJAR) -cfm $@ $(BUILD_DIR)/javap.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVAP_DIRS))
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
#-----
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
build-tools: $(BUILDTOOLCLASSES_DIR)/CompileProperties/CompileProperties.class
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
$(GENSRC_DIR)/%.java: $(SRC_CLASSES_DIR)/%.properties $(BUILDTOOLCLASSES_DIR)/CompileProperties/CompileProperties.class
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
	$(BOOT_JAVA) -cp $(BUILDTOOLCLASSES_DIR)/CompileProperties CompileProperties $< $(patsubst $(CLASSES_DIR)/%.class,$(GENSRC_DIR)/%.java,$@)
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
$(GENSRC_DIR)/%.java: $(GENSRC_DIR)/%.properties $(BUILDTOOLCLASSES_DIR)/CompileProperties/CompileProperties.class
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
	$(BOOT_JAVA) -cp $(BUILDTOOLCLASSES_DIR)/CompileProperties CompileProperties $< $(patsubst $(CLASSES_DIR)/%.class,$(GENSRC_DIR)/%.java,$@)
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
$(GENSRC_DIR)/%.properties: $(SRC_CLASSES_DIR)/%.properties-template
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
	$(SED)  -e 's/$$(JDK_VERSION)/$(JDK_VERSION)/'  \
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
		-e 's/$$(FULL_VERSION)/$(FULL_VERSION)/' \
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
		-e 's/$$(RELEASE)/$(RELEASE)/' \
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
		< $< > $@
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
$(BUILDTOOLCLASSES_DIR)/%.class : $(BUILDTOOLSRC_DIR)/%.java
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
	$(BOOT_JAVAC) -d $(@D) $<
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
#----- all classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
11864
116173ff7d77 7041249: Remove apt tool and API from the JDK
darcy
parents: 5848
diff changeset
   346
$(DIST_DIR)/%/classes.jar: $(JAVAC_JAR) $(JAVADOC_JAR) $(JAVAH_JAR) $(JAVAP_JAR)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
	$(BOOTJAR) -cf $@ -C $(CLASSES_DIR) .
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
#----- src.zip
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
SRC_ZIP_FILES = $(shell $(FIND) $(SRC_CLASSES_DIR) \( -name SCCS -o -name \*-template \) -prune -o -type f -print )
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
$(DIST_DIR)/%/src.zip: $(SRC_ZIP_FILES)
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
	abs_src_zip=`cd $(@D) ; pwd`/$(@F) ; \
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
	( cd $(SRC_CLASSES_DIR) ; $(FIND) . \( -name SCCS -o -name \*-template \) -prune -o -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; \
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
	( cd $(SRC_CLASSES_DIR) ; $(FIND) . -name SCCS -prune -o -name \*-template -print | $(SED) -e 's/-template//' ) | ( cd $(GENSRC_DIR) ; $(ZIP) -q $$abs_src_zip -@ ) 
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
#----- bin files
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
$(BIN_DIR)/%: $(SRC_BIN_DIR)/launcher.sh-template
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
	$(SED) -e 's|#PROGRAM#|$(@F)|' -e 's|#TARGET_JAVA#|$(TARGET_JAVA)|' $< > $@
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
	$(CHMOD) +x $@
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
#-----
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
findbugs: $(BUILD_DIR)/findbugs.txt
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
06bc494ca11e Initial load
duke
parents:
diff changeset
   370
$(BUILD_DIR)/findbugs.txt: $(CLASSES_JAR)
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
	$(FINDBUGS) -textui -javahome $(BOOT_JAVA_HOME) -high -emacs -outputFile $@ $<
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
#-----
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
quick-check: $(patsubst %, $(DIST_LIB_DIR)/%.jar, $(TOOLS))
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
	$(TESTJAVA) -jar $(JAVAC_JAR) -version
06bc494ca11e Initial load
duke
parents:
diff changeset
   378
	- $(TESTJAVA) -jar $(JAVADOC_JAR) -version
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
	$(TESTJAVA) -jar $(JAVAH_JAR) -version
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
	- $(TESTJAVA) -jar $(JAVAP_JAR) -version
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
#-----
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
.PHONY: \
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
	all \
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
	build \
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
	build-tools \
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
	clean \
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
	default \
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
	findbugs \
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
	jprt_product_build \
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
	jprt_debug_build \
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
	jprt_fastdebug_build \
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
	tools
06bc494ca11e Initial load
duke
parents:
diff changeset
   395