author | rupashka |
Thu, 23 Dec 2010 17:39:18 +0300 | |
changeset 7785 | 23c1995f9bf7 |
parent 5830 | 3adf4782de94 |
child 7675 | b715439429dd |
permissions | -rw-r--r-- |
6 | 1 |
# |
5512 | 2 |
# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. |
6 | 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 |
|
5512 | 7 |
# published by the Free Software Foundation. Oracle designates this |
6 | 8 |
# particular file as subject to the "Classpath" exception as provided |
5512 | 9 |
# by Oracle in the LICENSE file that accompanied this code. |
6 | 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 |
# |
|
5512 | 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. |
|
6 | 24 |
# |
25 |
||
3879 | 26 |
# Makefile wrapper around Ant build.xml file |
6 | 27 |
|
28 |
# |
|
29 |
# On Solaris, the 'make' utility from Sun will not work with these makefiles. |
|
30 |
# This little rule is only understood by Sun's make, and is harmless |
|
31 |
# when seen by the GNU make tool. If using Sun's make, this causes the |
|
32 |
# make command to fail. |
|
33 |
# |
|
34 |
SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33 |
|
35 |
||
36 |
ifdef QUIET |
|
37 |
ANT_OPTIONS += -quiet |
|
38 |
endif |
|
39 |
||
40 |
ifdef VERBOSE |
|
41 |
ANT_OPTIONS += -verbose |
|
42 |
endif |
|
43 |
||
3879 | 44 |
ifeq ($(VARIANT), OPT) |
45 |
ifneq ($(DEBUG_CLASSFILES), true) |
|
6 | 46 |
ANT_OPTIONS += -Djavac.debug=false |
47 |
endif |
|
48 |
endif |
|
49 |
||
50 |
# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN) |
|
51 |
# and the somewhat misnamed CLASS_VERSION (-target NN) |
|
52 |
ifdef TARGET_CLASS_VERSION |
|
53 |
ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION) |
|
54 |
else |
|
55 |
ifdef JAVAC_TARGET_ARG |
|
56 |
ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG) |
|
57 |
endif |
|
3879 | 58 |
endif |
2966 | 59 |
|
60 |
ifdef SOURCE_LANGUAGE_VERSION |
|
61 |
ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION) |
|
62 |
else |
|
63 |
ifdef JAVAC_SOURCE_ARG |
|
64 |
ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG) |
|
65 |
endif |
|
66 |
endif |
|
6 | 67 |
|
5830
3adf4782de94
6955292: Workaround ant 1.7.1 package-info.java issue in ant scripts
ohair
parents:
5512
diff
changeset
|
68 |
# If downloads are allowed |
3adf4782de94
6955292: Workaround ant 1.7.1 package-info.java issue in ant scripts
ohair
parents:
5512
diff
changeset
|
69 |
ifeq ($(ALLOW_DOWNLOADS),true) |
3adf4782de94
6955292: Workaround ant 1.7.1 package-info.java issue in ant scripts
ohair
parents:
5512
diff
changeset
|
70 |
ANT_OPTIONS += -Dallow.downloads=true |
3adf4782de94
6955292: Workaround ant 1.7.1 package-info.java issue in ant scripts
ohair
parents:
5512
diff
changeset
|
71 |
endif |
3adf4782de94
6955292: Workaround ant 1.7.1 package-info.java issue in ant scripts
ohair
parents:
5512
diff
changeset
|
72 |
|
3879 | 73 |
# Figure out the platform we are using |
74 |
_SYSTEM_UNAME := $(shell uname) |
|
75 |
_PLATFORM_KIND = unix |
|
76 |
ifeq ($(_SYSTEM_UNAME), Windows_NT) |
|
77 |
_PLATFORM_KIND = windows |
|
78 |
endif |
|
79 |
ifneq (,$(findstring CYGWIN,$(_SYSTEM_UNAME))) |
|
80 |
_PLATFORM_KIND = windows |
|
6 | 81 |
endif |
82 |
||
3879 | 83 |
# Where is /java in case we need it |
84 |
ifdef ALT_SLASH_JAVA |
|
85 |
_SLASHJAVA = $(ALT_SLASH_JAVA) |
|
86 |
else |
|
87 |
ifeq ($(_PLATFORM_KIND), windows) |
|
88 |
_SLASHJAVA=J:/ |
|
89 |
else |
|
90 |
_SLASHJAVA=/java |
|
91 |
endif |
|
92 |
endif |
|
93 |
||
4133 | 94 |
# Do we have the drops already downloaded? |
95 |
# Check ALT_DROPS_DIR for a full path first, |
|
96 |
# before trying to use the devtools path, |
|
97 |
# either via ALT_JDK_DEVTOOLS_DIR or /java/devtools. |
|
98 |
ifdef ALT_DROPS_DIR |
|
99 |
DROPS_DIR = $(ALT_DROPS_DIR) |
|
3879 | 100 |
else |
4133 | 101 |
ifdef ALT_JDK_DEVTOOLS_DIR |
102 |
DROPS_DIR = $(ALT_JDK_DEVTOOLS_DIR)/share/jdk7-drops |
|
103 |
else |
|
104 |
DROPS_DIR = $(_SLASHJAVA)/devtools/share/jdk7-drops |
|
105 |
endif |
|
3879 | 106 |
endif |
107 |
||
4133 | 108 |
# Add in path to drops already downloaded |
109 |
ANT_OPTIONS += -Ddrops.dir=$(DROPS_DIR) |
|
3879 | 110 |
|
6 | 111 |
ifdef ALT_OUTPUTDIR |
112 |
OUTPUTDIR = $(ALT_OUTPUTDIR) |
|
3879 | 113 |
ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR) |
6 | 114 |
else |
115 |
OUTPUTDIR = .. |
|
116 |
endif |
|
117 |
||
118 |
ifdef ALT_LANGTOOLS_DIST |
|
3879 | 119 |
ifdef ALT_BOOTDIR |
120 |
ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR) |
|
4294
4b507ae0d54b
6900341: jaxp/jaxws ant scripts using ant runtime in classpath, needs to be explicit
ohair
parents:
4133
diff
changeset
|
121 |
ANT_OPTIONS += -Djdk.home=$(ALT_BOOTDIR) |
3879 | 122 |
endif |
6 | 123 |
ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap |
3879 | 124 |
else |
125 |
ifdef ALT_JDK_IMPORT_PATH |
|
126 |
ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH) |
|
4294
4b507ae0d54b
6900341: jaxp/jaxws ant scripts using ant runtime in classpath, needs to be explicit
ohair
parents:
4133
diff
changeset
|
127 |
ANT_OPTIONS += -Djdk.home=$(ALT_JDK_IMPORT_PATH) |
3879 | 128 |
endif |
6 | 129 |
endif |
130 |
||
131 |
ifdef ANT_HOME |
|
132 |
ANT = $(ANT_HOME)/bin/ant |
|
133 |
ifneq ($(shell test -x $(ANT); echo $$?), 0) |
|
134 |
$(error "$(ANT) not found; please update ANT_HOME") |
|
135 |
endif |
|
136 |
else |
|
137 |
ANT = ant |
|
138 |
ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0) |
|
139 |
$(error "\"ant\" not found; please set ANT_HOME or put \"ant\" on your PATH") |
|
140 |
endif |
|
141 |
endif |
|
142 |
||
143 |
# Default target and expected 'do everything' target |
|
3879 | 144 |
default: all |
6 | 145 |
|
146 |
# All ant targets of interest |
|
4131
c5661b1a888f
6894441: Add checksum checks, remove use of original sources in jax repositories, fix bundle logic
ohair
parents:
3879
diff
changeset
|
147 |
ANT_TARGETS = all source drop_included build dist clobber clean sanity |
6 | 148 |
|
149 |
# Create a make target for each |
|
150 |
$(ANT_TARGETS): |
|
4294
4b507ae0d54b
6900341: jaxp/jaxws ant scripts using ant runtime in classpath, needs to be explicit
ohair
parents:
4133
diff
changeset
|
151 |
cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) -version |
3879 | 152 |
cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@ |
153 |
||
154 |
# Help target |
|
155 |
define helpenvline |
|
156 |
@echo " $1";echo " $2" |
|
157 |
endef |
|
158 |
help: |
|
159 |
@echo "----------------------------------------------------------" |
|
160 |
@echo " " |
|
161 |
@echo "Help information for this Makefile:" |
|
162 |
@echo " " |
|
163 |
@echo " Targets (see ant project information for descriptions):" |
|
164 |
@echo " $(ANT_TARGETS)" |
|
165 |
@echo " " |
|
166 |
@echo " Environment or command line variables (all optional):" |
|
5830
3adf4782de94
6955292: Workaround ant 1.7.1 package-info.java issue in ant scripts
ohair
parents:
5512
diff
changeset
|
167 |
$(call helpenvline, ALT_DROPS_DIR,\ |
3adf4782de94
6955292: Workaround ant 1.7.1 package-info.java issue in ant scripts
ohair
parents:
5512
diff
changeset
|
168 |
"Directory that contains the drop source bundles i.e. drops.dir") |
3879 | 169 |
$(call helpenvline, ALT_BOOTDIR,\ |
170 |
"JAVA_HOME to use when running ant") |
|
171 |
$(call helpenvline, ALT_LANGTOOLS_DIST,\ |
|
172 |
"path to langtools repository dist directory") |
|
173 |
$(call helpenvline, ALT_OUTPUTDIR,\ |
|
174 |
"path to root of output") |
|
175 |
$(call helpenvline, DEBUG_CLASSFILES,\ |
|
176 |
"if set makes sure ant property javac.debug is true") |
|
177 |
$(call helpenvline, JAVAC_SOURCE_ARG,\ |
|
178 |
"if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source") |
|
179 |
$(call helpenvline, JAVAC_TARGET_ARG,\ |
|
180 |
"if TARGET_CLASS_VERSION not set uses this to set ant property javac.target") |
|
181 |
$(call helpenvline, SOURCE_LANGUAGE_VERSION,\ |
|
182 |
"if set uses this to set ant property javac.source") |
|
183 |
$(call helpenvline, QUIET,\ |
|
184 |
"if set will pass -quiet to ant") |
|
185 |
$(call helpenvline, TARGET_CLASS_VERSION,\ |
|
186 |
"JAVA_HOME to use when running ant") |
|
187 |
$(call helpenvline, VARIANT,\ |
|
188 |
"if set to OPT means optimized build will set javac.debug to false") |
|
189 |
$(call helpenvline, VERBOSE,\ |
|
190 |
"if set will pass -verbose to ant") |
|
191 |
@echo " " |
|
192 |
@echo "----------------------------------------------------------" |
|
193 |
@echo " " |
|
194 |
@echo "Ant project file help information:" |
|
195 |
@echo " " |
|
196 |
@$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p |
|
197 |
@echo " " |
|
198 |
@echo "----------------------------------------------------------" |
|
6 | 199 |
|
200 |
# Targets for Sun's internal JPRT build system |
|
153
510a9a867e27
6652588: Fix broken JPRT makefile target, no bundle saved
ohair
parents:
6
diff
changeset
|
201 |
JPRT_ARCHIVE_BUNDLE=$(OUTPUTDIR)/jprt.zip |
6 | 202 |
jprt_build_product jprt_build_debug jprt_build_fastdebug: all |
153
510a9a867e27
6652588: Fix broken JPRT makefile target, no bundle saved
ohair
parents:
6
diff
changeset
|
203 |
$(RM) $(JPRT_ARCHIVE_BUNDLE) |
510a9a867e27
6652588: Fix broken JPRT makefile target, no bundle saved
ohair
parents:
6
diff
changeset
|
204 |
( cd $(OUTPUTDIR)/dist && \ |
3879 | 205 |
zip -q -r $(JPRT_ARCHIVE_BUNDLE) . ) |
6 | 206 |
|
207 |
# Declare these phony (not filenames) |
|
3879 | 208 |
.PHONY: $(ANT_TARGETS) \ |
6 | 209 |
jprt_build_product jprt_build_debug jprt_build_fastdebug |