author | rupashka |
Wed, 22 Feb 2012 14:31:13 +0400 | |
changeset 11980 | da6a2d56e693 |
parent 9455 | 5675b83ad5eb |
child 12047 | 320a714614e9 |
permissions | -rw-r--r-- |
2 | 1 |
# |
9035
1255eb81cc2f
7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents:
8796
diff
changeset
|
2 |
# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
# published by the Free Software Foundation. Oracle designates this |
2 | 8 |
# particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
# by Oracle in the LICENSE file that accompanied this code. |
2 | 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 |
# |
|
5506 | 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. |
|
2 | 24 |
# |
25 |
||
26 |
# |
|
27 |
# Generic makefile for building executables. |
|
28 |
# |
|
29 |
||
30 |
# WARNING: This file is shared with other workspaces. |
|
31 |
# So when it includes other files, it must use JDK_TOPDIR. |
|
32 |
# |
|
33 |
||
34 |
# |
|
35 |
# If building programs, use a normal compile approach |
|
36 |
# |
|
37 |
ifeq ($(COMPILE_APPROACH),batch) |
|
38 |
override COMPILE_APPROACH = normal |
|
39 |
endif |
|
40 |
||
41 |
ifndef LAUNCHER_PLATFORM_SRC |
|
42 |
LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC) |
|
43 |
endif |
|
44 |
||
45 |
ifndef LAUNCHER_SHARE_SRC |
|
46 |
LAUNCHER_SHARE_SRC = $(SHARE_SRC) |
|
47 |
endif |
|
48 |
||
49 |
ACTUAL_PROGRAM_NAME = $(PROGRAM)$(EXE_SUFFIX) |
|
50 |
ACTUAL_PROGRAM_DIR = $(BINDIR) |
|
51 |
ACTUAL_PROGRAM = $(ACTUAL_PROGRAM_DIR)/$(ACTUAL_PROGRAM_NAME) |
|
52 |
||
53 |
# Make sure the default rule is all |
|
54 |
program_default_rule: all |
|
55 |
||
56 |
program: $(ACTUAL_PROGRAM) |
|
57 |
||
9455
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
58 |
# Work-around for missing processor specific mapfiles |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
59 |
ifndef CROSS_COMPILE_ARCH |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
60 |
# reuse the mapfiles in the launcher's directory, the same should |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
61 |
# be applicable to the tool launchers as well. |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
62 |
FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH) |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
63 |
include $(BUILDDIR)/common/Mapfile-vers.gmk |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
64 |
endif |
9241
e77024585d01
7033954: (launcher) Launchers not built with mapfiles
ksrini
parents:
8796
diff
changeset
|
65 |
|
2 | 66 |
include $(JDK_TOPDIR)/make/common/Rules.gmk |
67 |
||
68 |
ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE |
|
69 |
OTHER_CPPFLAGS += -DNEVER_ACT_AS_SERVER_CLASS_MACHINE |
|
70 |
endif |
|
71 |
||
72 |
# |
|
73 |
# Create a dependency on libjli (Java Launcher Infrastructure) |
|
74 |
# |
|
75 |
# On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to |
|
76 |
# do this reliably on Linux takes a different syntax than Solaris. |
|
77 |
# |
|
78 |
# On Windows, this is done by using the same directory as the executable |
|
79 |
# itself, as with all the Windows libraries. |
|
80 |
# |
|
81 |
ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems |
|
82 |
LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli |
|
83 |
OTHER_LDLIBS += -ljli |
|
84 |
ifeq ($(PLATFORM), solaris) |
|
85 |
ifeq ($(ARCH_DATA_MODEL), 32) |
|
86 |
LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli |
|
87 |
LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli |
|
88 |
else |
|
89 |
LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)/jli |
|
90 |
LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)/jli |
|
91 |
endif |
|
92 |
endif |
|
93 |
ifeq ($(PLATFORM), linux) |
|
8796
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8583
diff
changeset
|
94 |
LDFLAGS += $(LDFLAG_Z_ORIGIN) |
2 | 95 |
LDFLAGS += -Wl,--allow-shlib-undefined |
96 |
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli |
|
97 |
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli |
|
98 |
endif |
|
99 |
endif |
|
100 |
ifeq ($(PLATFORM), windows) |
|
101 |
JLI_LCF = $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/jli.lcf |
|
102 |
ifdef STATIC_JLI |
|
103 |
LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static |
|
104 |
else |
|
105 |
LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME) |
|
106 |
endif |
|
107 |
OTHER_LDLIBS += jli.lib |
|
108 |
endif |
|
109 |
||
110 |
# |
|
111 |
# Launcher specific files. |
|
112 |
# |
|
113 |
FILES_o = \ |
|
114 |
$(OBJDIR)/main.$(OBJECT_SUFFIX) |
|
115 |
||
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
116 |
$(ACTUAL_PROGRAM):: classes $(INIT) |
2 | 117 |
|
118 |
# |
|
119 |
# Windows only |
|
120 |
# |
|
121 |
ifeq ($(PLATFORM), windows) |
|
122 |
||
3111
fefdeafb7ab9
6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents:
1776
diff
changeset
|
123 |
# JDK name required here |
fefdeafb7ab9
6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents:
1776
diff
changeset
|
124 |
RC_FLAGS += /D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \ |
fefdeafb7ab9
6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents:
1776
diff
changeset
|
125 |
/D "JDK_INTERNAL_NAME=$(PROGRAM)" \ |
fefdeafb7ab9
6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents:
1776
diff
changeset
|
126 |
/D "JDK_FTYPE=0x1L" |
2 | 127 |
|
128 |
$(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE) |
|
129 |
@$(prep-target) |
|
130 |
ifndef LOCAL_RESOURCE_FILE |
|
131 |
$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE) |
|
132 |
endif |
|
133 |
||
134 |
$(OBJDIR)/$(PROGRAM).lcf: $(OBJDIR)/$(PROGRAM).res $(FILES_o) |
|
135 |
@$(prep-target) |
|
136 |
@$(ECHO) $(FILES_o) > $@ |
|
137 |
ifndef LOCAL_RESOURCE_FILE |
|
138 |
@$(ECHO) $(OBJDIR)/$(PROGRAM).res >> $@ |
|
139 |
endif |
|
140 |
@$(ECHO) setargv.obj >> $@ |
|
141 |
@$(ECHO) Created $@ |
|
142 |
||
143 |
$(ACTUAL_PROGRAM):: $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX) |
|
144 |
@$(install-file) |
|
145 |
||
146 |
ifeq ($(ARCH_DATA_MODEL), 32) |
|
147 |
STACK_SIZE=327680 |
|
148 |
else |
|
149 |
# We need more Stack for Windows 64bit |
|
150 |
STACK_SIZE=1048576 |
|
151 |
endif |
|
152 |
||
7945 | 153 |
IMVERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER) |
154 |
$(OBJDIR)/$(PROGRAM).exe.manifest: $(JDK_TOPDIR)/src/windows/resource/java.manifest |
|
155 |
@$(prep-target) |
|
156 |
$(SED) 's%IMVERSION%$(IMVERSION)%g;s%PROGRAM%$(PROGRAM)%g' $< > $@ |
|
157 |
||
158 |
# We used a hand-crafted manifest file for all executables. |
|
159 |
# It is tweaked to embed the build number and executable name. |
|
1776
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
2
diff
changeset
|
160 |
# Use ";#2" for .dll and ";#1" for .exe in the MT command below: |
7945 | 161 |
$(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) $(OBJDIR)/$(PROGRAM).exe.manifest |
2 | 162 |
@$(prep-target) |
163 |
@set -- $?; \ |
|
164 |
$(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...}; |
|
165 |
$(LINK) -out:$@ /STACK:$(STACK_SIZE) \ |
|
166 |
-map:$(OBJDIR)/$(PROGRAM).map $(LFLAGS) $(LDFLAGS) \ |
|
167 |
@$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS) |
|
1776
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
2
diff
changeset
|
168 |
ifdef MT |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
2
diff
changeset
|
169 |
$(MT) /manifest $(OBJDIR)/$(PROGRAM).exe.manifest /outputresource:$@;#1 |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
2
diff
changeset
|
170 |
endif |
8008
753c38f4af83
6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents:
7668
diff
changeset
|
171 |
@$(call binary_file_verification,$@) |
2 | 172 |
|
173 |
else # PLATFORM |
|
174 |
||
175 |
# |
|
176 |
# Note that we have to link -lthread even when USE_PTHREADS is true. |
|
177 |
# This is becuase checkForCorrectLibthread() croaks otherwise. |
|
178 |
# |
|
179 |
LIBTHREAD = -lthread |
|
180 |
ifeq ($(USE_PTHREADS),true) |
|
181 |
THREADLIBS = -lpthread $(LIBTHREAD) |
|
182 |
else # USE_PTHREADS |
|
183 |
THREADLIBS = $(LIBTHREAD) |
|
184 |
endif # USE_PTHREADS |
|
185 |
||
186 |
# |
|
187 |
# This rule only applies on unix. It supports quantify and its ilk. |
|
188 |
# |
|
189 |
$(ACTUAL_PROGRAM):: $(FILES_o) |
|
190 |
@$(prep-target) |
|
191 |
@set -- $?; \ |
|
192 |
$(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...}; |
|
193 |
@$(MKDIR) -p $(TEMPDIR) |
|
194 |
$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \ |
|
195 |
$(FILES_o) $(THREADLIBS) $(LDLIBS) |
|
8008
753c38f4af83
6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents:
7668
diff
changeset
|
196 |
@$(call binary_file_verification,$@) |
2 | 197 |
|
198 |
endif # PLATFORM |
|
199 |
||
200 |
clean:: |
|
201 |
ifeq ($(PLATFORM), windows) |
|
202 |
$(RM) $(OBJDIR)/$(PROGRAM).rc |
|
203 |
$(RM) $(OBJDIR)/$(PROGRAM).ico |
|
204 |
$(RM) $(OBJDIR)/$(PROGRAM).lcf |
|
205 |
$(RM) $(OBJDIR)/$(PROGRAM).map |
|
206 |
$(RM) $(OBJDIR)/$(PROGRAM).exp |
|
207 |
$(RM) $(OBJDIR)/$(PROGRAM).lib |
|
208 |
$(RM) $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX) |
|
209 |
$(RM) $(OBJDIR)/$(PROGRAM).ilk |
|
210 |
$(RM) *.pdb |
|
211 |
endif |
|
212 |
||
213 |
||
214 |
clobber:: |
|
215 |
$(RM) $(ACTUAL_PROGRAM) |
|
216 |
||
217 |
# |
|
218 |
# Now include make dependencies (created during compilation, see Rules.gmk) |
|
219 |
# |
|
220 |
ifeq ($(INCREMENTAL_BUILD),true) |
|
221 |
# Workaround: gnumake sometimes says files is empty when it shouldn't |
|
222 |
# was: files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file)) |
|
223 |
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null) |
|
224 |
ifneq ($(strip $(files)),) |
|
225 |
include $(files) |
|
226 |
endif # files |
|
227 |
endif # INCREMENTAL_BUILD |
|
228 |
||
229 |
ifdef JAVA_ARGS |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
4111
diff
changeset
|
230 |
OTHER_CPPFLAGS += -DJAVA_ARGS='$(JAVA_ARGS)' |
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
4111
diff
changeset
|
231 |
OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' |
2 | 232 |
endif |
233 |
||
234 |
ifeq ($(PLATFORM), windows) |
|
235 |
ifdef RELEASE |
|
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
4111
diff
changeset
|
236 |
OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"' |
2 | 237 |
endif |
238 |
endif |
|
239 |
||
240 |
||
241 |
ifneq ($(PLATFORM), windows) |
|
242 |
HAVE_GETHRTIME=true |
|
243 |
endif |
|
244 |
||
245 |
ifeq ($(HAVE_GETHRTIME),true) |
|
246 |
OTHER_CPPFLAGS += -DHAVE_GETHRTIME |
|
247 |
endif |
|
248 |
||
249 |
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin |
|
250 |
OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 |
|
251 |
||
252 |
OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"' |
|
253 |
VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"' |
|
254 |
||
255 |
VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \ |
|
256 |
-DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' |
|
257 |
||
258 |
||
259 |
||
260 |
$(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c |
|
261 |
@$(prep-target) |
|
262 |
$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \ |
|
263 |
$(VERSION_DEFINES) $< |
|
264 |
||
265 |
# |
|
266 |
# Default dependencies |
|
267 |
# |
|
268 |
||
269 |
all: build |
|
270 |
||
271 |
build: program |
|
272 |
||
273 |
debug: |
|
274 |
$(MAKE) VARIANT=DBG build |
|
275 |
||
276 |
fastdebug: |
|
277 |
$(MAKE) VARIANT=DBG FASTDEBUG=true build |
|
278 |
||
279 |
.PHONY: all build program clean clobber debug fastdebug |