author | prr |
Mon, 09 Nov 2009 14:23:49 -0800 | |
changeset 4252 | 0e645080f74b |
parent 3871 | 3d528461f61d |
child 5555 | b2b5ed3f0d0d |
permissions | -rw-r--r-- |
4 | 1 |
# |
3291 | 2 |
# Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. |
4 | 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 |
# |
|
27 |
# Makefile for building the corba workspace. |
|
28 |
# |
|
29 |
||
30 |
BUILDDIR=. |
|
31 |
include $(BUILDDIR)/common/Defs.gmk |
|
32 |
include $(BUILDDIR)/common/CancelImplicits.gmk |
|
33 |
||
34 |
#----- commands |
|
35 |
||
36 |
CHMOD = chmod |
|
37 |
CP = cp |
|
38 |
ECHO = echo # FIXME |
|
39 |
FIND = find |
|
40 |
MKDIR = mkdir |
|
41 |
SED = sed |
|
42 |
ZIP = zip |
|
43 |
||
44 |
#----- locations and deliverables |
|
45 |
||
46 |
TOPDIR=.. |
|
47 |
SRC_BIN_DIR = $(TOPDIR)/src/share/bin |
|
48 |
SRC_CLASSES_DIR = $(TOPDIR)/src/share/classes |
|
49 |
||
50 |
ifdef ALT_OUTPUTDIR |
|
51 |
OUTPUTDIR = $(ALT_OUTPUTDIR) |
|
52 |
BUILD_DIR = $(ALT_OUTPUTDIR) |
|
53 |
DIST_DIR = $(ALT_OUTPUTDIR)/dist |
|
54 |
else |
|
55 |
OUTPUTDIR = .. |
|
56 |
BUILD_DIR = $(TOPDIR)/build/$(PLATFORM)-$(ARCH) |
|
57 |
DIST_DIR = $(TOPDIR)/dist |
|
58 |
endif |
|
59 |
ABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR)) |
|
60 |
||
61 |
CLASSES_DIR = $(BUILD_DIR)/classes |
|
62 |
GENSRC_DIR = $(BUILD_DIR)/gensrc |
|
63 |
||
64 |
BIN_DIR = $(DIST_DIR)/bin |
|
65 |
LIB_DIR = $(DIST_DIR)/lib |
|
66 |
||
67 |
#----- |
|
68 |
||
69 |
ifndef JDK_MAJOR_VERSION |
|
70 |
JDK_MAJOR_VERSION = 1 |
|
71 |
endif |
|
72 |
||
73 |
ifndef JDK_MINOR_VERSION |
|
74 |
JDK_MINOR_VERSION = 7 |
|
75 |
endif |
|
76 |
||
77 |
ifndef JDK_MICRO_VERSION |
|
78 |
JDK_MICRO_VERSION = 0 |
|
79 |
endif |
|
80 |
||
81 |
ifndef JDK_VERSION |
|
82 |
JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) |
|
83 |
endif |
|
84 |
||
85 |
ifndef MILESTONE |
|
86 |
MILESTONE = internal |
|
87 |
endif |
|
88 |
||
89 |
# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set |
|
90 |
ifneq ($(MILESTONE),fcs) |
|
91 |
RELEASE = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE) |
|
92 |
else |
|
93 |
RELEASE = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE) |
|
94 |
endif |
|
95 |
||
96 |
# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set |
|
97 |
ifdef BUILD_NUMBER |
|
98 |
FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER) |
|
99 |
else |
|
100 |
BUILD_NUMBER = b00 |
|
101 |
USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`) |
|
102 |
FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER) |
|
103 |
endif |
|
104 |
||
105 |
#----- useful macros |
|
106 |
||
107 |
SOURCE_LEVEL = 5 |
|
108 |
BOOTSTRAP_TARGET_LEVEL = 5 |
|
2961 | 109 |
|
110 |
ifdef TARGET_CLASS_VERSION |
|
111 |
TARGET_LEVEL = $(TARGET_CLASS_VERSION) |
|
112 |
else |
|
3357
554aac3029bc
6854244: change source/target used to compile JDK to 7
jjg
parents:
2961
diff
changeset
|
113 |
TARGET_LEVEL = 7 |
2961 | 114 |
endif |
4 | 115 |
|
116 |
ifndef TARGET_JAVA |
|
117 |
TARGET_JAVA = java |
|
118 |
endif |
|
119 |
||
120 |
SELF = $(lastword $(MAKEFILE_LIST)) |
|
121 |
||
122 |
# for jdk, we generate the following: |
|
123 |
# dist/lib/classes.jar: |
|
124 |
# corba recompiled to run on the target JDK, |
|
125 |
# ready for inclusion in rt.jar |
|
126 |
# dist/lib/src.zip |
|
127 |
# .properties and .java files for classes in classes.jar, |
|
128 |
# ready for jdk src.zip |
|
129 |
# dist/lib/bin.zip |
|
130 |
# corba specific binaries: orb.idl, ir.idl |
|
131 |
||
132 |
# Default target |
|
133 |
default: all |
|
134 |
||
135 |
#----- classes.jar |
|
136 |
||
137 |
CLASSES_JAR = $(LIB_DIR)/classes.jar |
|
138 |
$(CLASSES_JAR): |
|
139 |
$(MKDIR) -p $(@D) |
|
140 |
$(BOOT_JAR_CMD) -cf $@ -C $(CLASSES_DIR) . |
|
141 |
||
142 |
#----- src.zip |
|
143 |
||
3871
3d528461f61d
6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents:
3359
diff
changeset
|
144 |
SRC_ZIP_FILES = $(shell $(FIND) $(SRC_CLASSES_DIR) \( -name \*-template \) -prune -o -type f -print ) |
4 | 145 |
|
146 |
SRC_ZIP = $(LIB_DIR)/src.zip |
|
147 |
$(SRC_ZIP): $(SRC_ZIP_FILES) |
|
148 |
abs_src_zip=`cd $(@D) ; pwd`/$(@F) ; \ |
|
3871
3d528461f61d
6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents:
3359
diff
changeset
|
149 |
( cd $(SRC_CLASSES_DIR) ; $(FIND) . \( -name \*-template \) -prune -o -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; \ |
4 | 150 |
( cd $(GENSRC_DIR) ; $(FIND) . -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; |
151 |
||
152 |
#----- bin.zip |
|
153 |
||
154 |
BIN_ZIP_FILES = $(BUILD_DIR/lib/orb.idl $(BUILD_DIR)/lib/ir.idl |
|
155 |
||
156 |
BIN_ZIP = $(LIB_DIR)/bin.zip |
|
157 |
$(BIN_ZIP): $(BIN_ZIP_FILES) |
|
158 |
abs_bin_zip=`cd $(@D) ; pwd`/$(@F) ; \ |
|
159 |
( cd $(BUILD_DIR) ; $(FIND) lib -name "*.idl" -print | $(ZIP) -q $$abs_bin_zip -@ ) ; |
|
160 |
||
161 |
# |
|
162 |
# CORBA |
|
163 |
# |
|
164 |
SUBDIRS = tools javax org sun com |
|
165 |
||
166 |
build: |
|
167 |
$(SUBDIRS-loop) |
|
168 |
||
169 |
all : build $(CLASSES_JAR) $(SRC_ZIP) $(BIN_ZIP) |
|
170 |
||
171 |
clean clobber: |
|
172 |
$(RM) -r $(BUILD_DIR) |
|
173 |
$(RM) -r $(DIST_DIR) |
|
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 |
||
191 |
# |
|
192 |
# Phonies to avoid accidents. |
|
193 |
# |
|
194 |
.PHONY: all build clean clobber debug jprt_build_product jprt_build_debug jprt_build_fastdebug |