source: trunk/openjdk/jaxp/make/Makefile@ 150

Last change on this file since 150 was 72, checked in by dmik, 15 years ago

jaxp/jaxws: Adoptes makefiles for OS/2.

File size: 6.5 KB
Line 
1#
2# Copyright 2007-2009 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 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#
34SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
35
36ifdef QUIET
37 ANT_OPTIONS += -quiet
38endif
39
40ifdef VERBOSE
41 ANT_OPTIONS += -verbose
42endif
43
44ifeq ($(VARIANT), OPT)
45 ifneq ($(DEBUG_CLASSFILES), true)
46 ANT_OPTIONS += -Djavac.debug=false
47 endif
48endif
49
50# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
51# and the somewhat misnamed CLASS_VERSION (-target NN)
52ifdef TARGET_CLASS_VERSION
53 ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
54else
55 ifdef JAVAC_TARGET_ARG
56 ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
57 endif
58endif
59
60ifdef SOURCE_LANGUAGE_VERSION
61 ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
62else
63 ifdef JAVAC_SOURCE_ARG
64 ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
65 endif
66endif
67
68# Figure out the platform we are using
69_SYSTEM_UNAME := $(shell uname)
70_PLATFORM_KIND = unix
71ifeq ($(_SYSTEM_UNAME), Windows_NT)
72 _PLATFORM_KIND = windows
73endif
74ifneq (,$(findstring CYGWIN,$(_SYSTEM_UNAME)))
75 _PLATFORM_KIND = windows
76endif
77ifeq ($(_SYSTEM_UNAME), OS/2)
78 _PLATFORM_KIND = os2
79endif
80
81# Where is /java in case we need it
82ifdef ALT_SLASH_JAVA
83 _SLASHJAVA = $(ALT_SLASH_JAVA)
84else
85 ifeq ($(filter-out windows os2, $(_PLATFORM_KIND)),)
86 _SLASHJAVA=J:/
87 else
88 _SLASHJAVA=/java
89 endif
90endif
91
92# Do we have the drops already downloaded?
93# Check ALT_DROPS_DIR for a full path first,
94# before trying to use the devtools path,
95# either via ALT_JDK_DEVTOOLS_DIR or /java/devtools.
96ifdef ALT_DROPS_DIR
97 DROPS_DIR = $(ALT_DROPS_DIR)
98else
99 ifdef ALT_JDK_DEVTOOLS_DIR
100 DROPS_DIR = $(ALT_JDK_DEVTOOLS_DIR)/share/jdk6-drops
101 else
102 DROPS_DIR = $(_SLASHJAVA)/devtools/share/jdk6-drops
103 endif
104endif
105
106# Add in path to drops already downloaded
107ANT_OPTIONS += -Ddrops.dir=$(DROPS_DIR)
108
109ifdef ALT_OUTPUTDIR
110 OUTPUTDIR = $(ALT_OUTPUTDIR)
111 ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR)
112else
113 OUTPUTDIR = ..
114endif
115
116ifdef ALT_LANGTOOLS_DIST
117 ifdef ALT_BOOTDIR
118 ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR)
119 ANT_OPTIONS += -Djdk.home=$(ALT_BOOTDIR)
120 endif
121 ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap
122else
123 ifdef ALT_JDK_IMPORT_PATH
124 ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH)
125 ANT_OPTIONS += -Djdk.home=$(ALT_JDK_IMPORT_PATH)
126 endif
127endif
128
129ifdef ANT_HOME
130 ifeq ($(PLATFORM), windows)
131 ANT = $(subst \,/,$(ANT_HOME))/bin/ant.bat
132 else
133 ifeq ($(PLATFORM), os2)
134 ANT = $(subst \,/,$(ANT_HOME))/bin/ant.cmd
135 else
136 ANT = $(ANT_HOME)/bin/ant
137 endif
138 endif
139 ifneq ($(shell test -x $(ANT); echo $$?), 0)
140 $(error $(ANT) not found -- please update ANT_HOME)
141 endif
142else
143 ANT = ant
144 ifneq ($(shell which $(ANT) > /dev/null; echo $$?), 0)
145 $(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH)
146 endif
147endif
148
149# Default target and expected 'do everything' target
150default: all
151
152# All ant targets of interest
153ANT_TARGETS = all source drop_included build dist clobber clean sanity
154
155# Create a make target for each
156$(ANT_TARGETS):
157 cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) -version
158 cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
159
160# Help target
161define helpenvline
162@echo " $1";echo " $2"
163endef
164help:
165 @echo "----------------------------------------------------------"
166 @echo " "
167 @echo "Help information for this Makefile:"
168 @echo " "
169 @echo " Targets (see ant project information for descriptions):"
170 @echo " $(ANT_TARGETS)"
171 @echo " "
172 @echo " Environment or command line variables (all optional):"
173 $(call helpenvline, ALT_BOOTDIR,\
174 "JAVA_HOME to use when running ant")
175 $(call helpenvline, ALT_LANGTOOLS_DIST,\
176 "path to langtools repository dist directory")
177 $(call helpenvline, ALT_OUTPUTDIR,\
178 "path to root of output")
179 $(call helpenvline, DEBUG_CLASSFILES,\
180 "if set makes sure ant property javac.debug is true")
181 $(call helpenvline, JAVAC_SOURCE_ARG,\
182 "if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source")
183 $(call helpenvline, JAVAC_TARGET_ARG,\
184 "if TARGET_CLASS_VERSION not set uses this to set ant property javac.target")
185 $(call helpenvline, SOURCE_LANGUAGE_VERSION,\
186 "if set uses this to set ant property javac.source")
187 $(call helpenvline, QUIET,\
188 "if set will pass -quiet to ant")
189 $(call helpenvline, TARGET_CLASS_VERSION,\
190 "JAVA_HOME to use when running ant")
191 $(call helpenvline, VARIANT,\
192 "if set to OPT means optimized build will set javac.debug to false")
193 $(call helpenvline, VERBOSE,\
194 "if set will pass -verbose to ant")
195 @echo " "
196 @echo "----------------------------------------------------------"
197 @echo " "
198 @echo "Ant project file help information:"
199 @echo " "
200 @$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p
201 @echo " "
202 @echo "----------------------------------------------------------"
203
204# Targets for Sun's internal JPRT build system
205JPRT_ARCHIVE_BUNDLE=$(OUTPUTDIR)/jprt.zip
206jprt_build_product jprt_build_debug jprt_build_fastdebug: all
207 $(RM) $(JPRT_ARCHIVE_BUNDLE)
208 ( cd $(OUTPUTDIR)/dist && \
209 zip -q -r $(JPRT_ARCHIVE_BUNDLE) . )
210
211# Declare these phony (not filenames)
212.PHONY: $(ANT_TARGETS) \
213 jprt_build_product jprt_build_debug jprt_build_fastdebug
Note: See TracBrowser for help on using the repository browser.