author | jjg |
Wed, 20 May 2009 13:36:23 -0700 | |
changeset 2982 | 090c71af18f6 |
parent 1650 | 980a667baa29 |
child 2988 | 094272984b53 |
permissions | -rw-r--r-- |
10 | 1 |
# |
2 |
# Copyright 2007 Sun Microsystems, Inc. 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. Sun designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
# have any questions. |
|
24 |
# |
|
25 |
||
26 |
# Makefile for langtools: wrapper around Ant build.xml file |
|
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 |
# |
|
37 |
# Minimal platform defs |
|
38 |
# Need FullPath because we can't rely on gnumake abspath, until we use v3.81 |
|
39 |
# |
|
40 |
||
41 |
SYSTEM_UNAME := $(shell uname) |
|
42 |
||
43 |
ifeq ($(SYSTEM_UNAME), Windows_NT) |
|
44 |
DEV_NULL = NUL |
|
45 |
else |
|
46 |
ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME))) |
|
47 |
DEV_NULL = NUL |
|
48 |
USING_CYGWIN = true |
|
49 |
else |
|
50 |
DEV_NULL = /dev/null |
|
51 |
endif |
|
52 |
endif |
|
53 |
||
54 |
ifdef USING_CYGWIN |
|
55 |
define FullPath |
|
56 |
$(shell cygpath -a -s -m $1 2> $(DEV_NULL)) |
|
57 |
endef |
|
58 |
else |
|
59 |
define FullPath |
|
60 |
$(shell cd $1 2> $(DEV_NULL) && pwd) |
|
61 |
endef |
|
62 |
endif |
|
63 |
||
64 |
# |
|
65 |
# Makefile args |
|
66 |
# |
|
67 |
||
68 |
ifdef QUIET |
|
69 |
ANT_OPTIONS += -quiet |
|
70 |
endif |
|
71 |
||
72 |
ifdef VERBOSE |
|
73 |
ANT_OPTIONS += -verbose -diagnostics |
|
74 |
endif |
|
75 |
||
76 |
ifdef JDK_VERSION |
|
77 |
ANT_OPTIONS += -Djdk.version=$(JDK_VERSION) |
|
78 |
endif |
|
79 |
||
80 |
ifdef FULL_VERSION |
|
81 |
ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces |
|
82 |
endif |
|
83 |
||
84 |
ifdef MILESTONE |
|
1650
980a667baa29
6778493: Fix (langtools) ant build to honor fcs MILESTONE setting
jjg
parents:
10
diff
changeset
|
85 |
ifneq ($(MILESTONE),fcs) |
10 | 86 |
ANT_OPTIONS += -Dmilestone=$(MILESTONE) |
1650
980a667baa29
6778493: Fix (langtools) ant build to honor fcs MILESTONE setting
jjg
parents:
10
diff
changeset
|
87 |
else |
980a667baa29
6778493: Fix (langtools) ant build to honor fcs MILESTONE setting
jjg
parents:
10
diff
changeset
|
88 |
ANT_OPTIONS += -Drelease=$(JDK_VERSION) |
980a667baa29
6778493: Fix (langtools) ant build to honor fcs MILESTONE setting
jjg
parents:
10
diff
changeset
|
89 |
endif |
10 | 90 |
endif |
91 |
||
92 |
ifdef BUILD_NUMBER |
|
93 |
ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER) |
|
94 |
else |
|
95 |
ifdef JDK_BUILD_NUMBER |
|
96 |
ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER) |
|
97 |
endif |
|
98 |
endif |
|
99 |
||
100 |
ifeq ($(VARIANT), DBG) |
|
101 |
ANT_OPTIONS += -Djavac.debug=true |
|
102 |
else |
|
103 |
ifeq ($(VARIANT), OPT) |
|
104 |
ANT_OPTIONS += -Djavac.debug=false |
|
105 |
endif |
|
106 |
endif |
|
107 |
||
108 |
# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN) |
|
109 |
# and the somewhat misnamed CLASS_VERSION (-target NN) |
|
110 |
ifdef TARGET_CLASS_VERSION |
|
111 |
ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION) |
|
112 |
else |
|
113 |
ifdef JAVAC_TARGET_ARG |
|
114 |
ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG) |
|
115 |
endif |
|
116 |
endif |
|
117 |
||
2982 | 118 |
ifdef SOURCE_LANGUAGE_VERSION |
119 |
ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION) |
|
120 |
else |
|
121 |
ifdef JAVAC_SOURCE_ARG |
|
122 |
ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG) |
|
123 |
endif |
|
124 |
endif |
|
125 |
||
10 | 126 |
ifdef ALT_BOOTDIR |
127 |
ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR) |
|
128 |
ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR) |
|
129 |
endif |
|
130 |
||
131 |
ifdef ALT_OUTPUTDIR |
|
132 |
OUTPUTDIR = $(ALT_OUTPUTDIR) |
|
133 |
ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build |
|
134 |
ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist |
|
135 |
else |
|
136 |
OUTPUTDIR = .. |
|
137 |
endif |
|
138 |
#ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR)) |
|
139 |
ABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR)) |
|
140 |
||
141 |
ANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp |
|
142 |
ANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)' |
|
143 |
||
144 |
ifdef FINDBUGS_HOME |
|
145 |
ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME) |
|
146 |
endif |
|
147 |
||
148 |
ifdef ANT_HOME |
|
149 |
ANT = $(ANT_HOME)/bin/ant |
|
150 |
ifneq ($(shell test -x $(ANT) && echo OK), OK) |
|
151 |
$(error $(ANT) not found -- please update ANT_HOME) |
|
152 |
endif |
|
153 |
else |
|
154 |
ANT = ant |
|
155 |
ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK) |
|
156 |
$(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH) |
|
157 |
endif |
|
158 |
endif |
|
159 |
||
160 |
# Default target and expected 'do everything' target |
|
161 |
all: build |
|
162 |
||
163 |
# Standard make clobber target |
|
164 |
clobber: clean |
|
165 |
||
166 |
# All ant targets of interest |
|
167 |
ANT_TARGETS = build clean sanity post-sanity diagnostics # for now |
|
168 |
||
169 |
# Create a make target for each |
|
170 |
$(ANT_TARGETS): |
|
171 |
@ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR) |
|
172 |
$(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $(OUTPUTDIR)/build/ant-diagnostics.log |
|
173 |
$(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@ |
|
174 |
||
175 |
#------------------------------------------------------------------- |
|
176 |
# |
|
177 |
# Targets for Sun's internal JPRT build system |
|
178 |
||
179 |
CD = cd |
|
180 |
ZIP = zip |
|
181 |
||
182 |
JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip |
|
183 |
||
184 |
jprt_build_product jprt_build_debug jprt_build_fastdebug: all |
|
185 |
( $(CD) $(OUTPUTDIR) && \ |
|
186 |
$(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist ) |
|
187 |
||
188 |
#------------------------------------------------------------------- |
|
189 |
||
190 |
# Declare these phony (not filenames) |
|
191 |
.PHONY: $(ANT_TARGETS) all clobber \ |
|
192 |
jprt_build_product jprt_build_debug jprt_build_fastdebug |