author | jmelvin |
Mon, 16 Apr 2012 18:09:53 -0400 | |
changeset 12538 | 211d6e82fe51 |
parent 12433 | ac48511f8b50 |
child 12853 | 7bdaa5aefd3d |
permissions | -rw-r--r-- |
2 | 1 |
# |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
2 |
# Copyright (c) 1995, 2012, 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 |
||
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
41 |
# set the platform specific directory for macosx, also this platform shares |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
42 |
# substantial family ties with its siblings (solaris and linux), thus we add |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
43 |
# solaris src path to its compilation dependencies. |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
44 |
ifeq ($(PLATFORM), macosx) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
45 |
LAUNCHER_PLATFORM_SRC = $(BUILDDIR)/../src/macosx |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
46 |
LAUNCHER_SOLARIS_PLATFORM_SRC = $(BUILDDIR)/../src/solaris |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
47 |
else |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
48 |
LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC) |
2 | 49 |
endif |
50 |
||
51 |
ifndef LAUNCHER_SHARE_SRC |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
52 |
LAUNCHER_SHARE_SRC = $(SHARE_SRC) |
2 | 53 |
endif |
54 |
||
55 |
ACTUAL_PROGRAM_NAME = $(PROGRAM)$(EXE_SUFFIX) |
|
56 |
ACTUAL_PROGRAM_DIR = $(BINDIR) |
|
57 |
ACTUAL_PROGRAM = $(ACTUAL_PROGRAM_DIR)/$(ACTUAL_PROGRAM_NAME) |
|
58 |
||
59 |
# Make sure the default rule is all |
|
60 |
program_default_rule: all |
|
61 |
||
62 |
program: $(ACTUAL_PROGRAM) |
|
63 |
||
9455
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
64 |
# Work-around for missing processor specific mapfiles |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
65 |
ifndef CROSS_COMPILE_ARCH |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
66 |
# 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
|
67 |
# be applicable to the tool launchers as well. |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
68 |
FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH) |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
69 |
include $(BUILDDIR)/common/Mapfile-vers.gmk |
5675b83ad5eb
7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents:
9275
diff
changeset
|
70 |
endif |
9241
e77024585d01
7033954: (launcher) Launchers not built with mapfiles
ksrini
parents:
8796
diff
changeset
|
71 |
|
2 | 72 |
include $(JDK_TOPDIR)/make/common/Rules.gmk |
73 |
||
74 |
ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
75 |
OTHER_CPPFLAGS += -DNEVER_ACT_AS_SERVER_CLASS_MACHINE |
2 | 76 |
endif |
77 |
||
78 |
# |
|
79 |
# Create a dependency on libjli (Java Launcher Infrastructure) |
|
80 |
# |
|
81 |
# On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to |
|
82 |
# do this reliably on Linux takes a different syntax than Solaris. |
|
83 |
# |
|
84 |
# On Windows, this is done by using the same directory as the executable |
|
85 |
# itself, as with all the Windows libraries. |
|
86 |
# |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
87 |
ifeq ($(PLATFORM), macosx) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
88 |
ifneq ($(ARCH), universal) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
89 |
LDFLAGS += -Wl,-all_load |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
90 |
endif |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
91 |
LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
92 |
|
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
93 |
ifeq ($(SYSTEM_ZLIB),true) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
94 |
OTHER_LDLIBS += -lz |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
95 |
endif |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
96 |
endif |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
97 |
|
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
98 |
ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
99 |
LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
100 |
OTHER_LDLIBS += -ljli |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
101 |
ifeq ($(PLATFORM), solaris) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
102 |
ifeq ($(ARCH_DATA_MODEL), 32) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
103 |
LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
104 |
LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
105 |
else |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
106 |
LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)/jli |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
107 |
LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)/jli |
2 | 108 |
endif |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
109 |
endif |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
110 |
ifeq ($(PLATFORM), linux) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
111 |
LDFLAGS += $(LDFLAG_Z_ORIGIN) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
112 |
LDFLAGS += -Wl,--allow-shlib-undefined |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
113 |
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
114 |
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
115 |
endif |
2 | 116 |
endif |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
117 |
|
2 | 118 |
ifeq ($(PLATFORM), windows) |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
119 |
JLI_LCF = $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/jli.lcf |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
120 |
ifdef STATIC_JLI |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
121 |
LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
122 |
else |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
123 |
LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
124 |
endif |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
125 |
OTHER_LDLIBS += jli.lib |
2 | 126 |
endif |
127 |
||
128 |
# |
|
129 |
# Launcher specific files. |
|
130 |
# |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
131 |
FILES_o = $(OBJDIR)/main.$(OBJECT_SUFFIX) |
2 | 132 |
|
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
133 |
$(ACTUAL_PROGRAM):: classes $(INIT) |
2 | 134 |
|
135 |
# |
|
136 |
# Windows only |
|
137 |
# |
|
138 |
ifeq ($(PLATFORM), windows) |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
139 |
# JDK name required here |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
140 |
RC_FLAGS += /D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \ |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
141 |
/D "JDK_INTERNAL_NAME=$(PROGRAM)" \ |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
142 |
/D "JDK_FTYPE=0x1L" |
2 | 143 |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
144 |
$(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE) |
2 | 145 |
@$(prep-target) |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
146 |
ifndef LOCAL_RESOURCE_FILE |
2 | 147 |
$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE) |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
148 |
endif |
2 | 149 |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
150 |
$(OBJDIR)/$(PROGRAM).lcf: $(OBJDIR)/$(PROGRAM).res $(FILES_o) |
2 | 151 |
@$(prep-target) |
152 |
@$(ECHO) $(FILES_o) > $@ |
|
153 |
ifndef LOCAL_RESOURCE_FILE |
|
154 |
@$(ECHO) $(OBJDIR)/$(PROGRAM).res >> $@ |
|
155 |
endif |
|
156 |
@$(ECHO) setargv.obj >> $@ |
|
157 |
@$(ECHO) Created $@ |
|
158 |
||
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
159 |
$(ACTUAL_PROGRAM):: $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX) |
2 | 160 |
@$(install-file) |
161 |
||
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
162 |
ifeq ($(ARCH_DATA_MODEL), 32) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
163 |
STACK_SIZE=327680 |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
164 |
else |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
165 |
# We need more Stack for Windows 64bit |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
166 |
STACK_SIZE=1048576 |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
167 |
endif |
2 | 168 |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
169 |
IMVERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
170 |
$(OBJDIR)/$(PROGRAM).exe.manifest: $(JDK_TOPDIR)/src/windows/resource/java.manifest |
7945 | 171 |
@$(prep-target) |
172 |
$(SED) 's%IMVERSION%$(IMVERSION)%g;s%PROGRAM%$(PROGRAM)%g' $< > $@ |
|
173 |
||
12307
b34445ac110f
7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents:
12047
diff
changeset
|
174 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
b34445ac110f
7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents:
12047
diff
changeset
|
175 |
MAP_OPTION="-map:$(OBJDIR)/$(PROGRAM).map" |
b34445ac110f
7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents:
12047
diff
changeset
|
176 |
endif |
b34445ac110f
7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents:
12047
diff
changeset
|
177 |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
178 |
# We used a hand-crafted manifest file for all executables. |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
179 |
# It is tweaked to embed the build number and executable name. |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
180 |
# Use ";#2" for .dll and ";#1" for .exe in the MT command below: |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
181 |
$(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) $(OBJDIR)/$(PROGRAM).exe.manifest |
2 | 182 |
@$(prep-target) |
183 |
@set -- $?; \ |
|
184 |
$(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...}; |
|
185 |
$(LINK) -out:$@ /STACK:$(STACK_SIZE) \ |
|
12307
b34445ac110f
7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents:
12047
diff
changeset
|
186 |
$(MAP_OPTION) $(LFLAGS) $(LDFLAGS) \ |
2 | 187 |
@$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS) |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
188 |
ifdef MT |
1776
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
2
diff
changeset
|
189 |
$(MT) /manifest $(OBJDIR)/$(PROGRAM).exe.manifest /outputresource:$@;#1 |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
190 |
endif |
8008
753c38f4af83
6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents:
7668
diff
changeset
|
191 |
@$(call binary_file_verification,$@) |
12427 | 192 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
193 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
|
194 |
(set -e ; \ |
|
195 |
$(CD) $(OBJDIR) ; \ |
|
196 |
$(ZIPEXE) -q $(PROGRAM).diz $(PROGRAM).map $(PROGRAM).pdb ; \ |
|
197 |
$(RM) $(PROGRAM).map $(PROGRAM).pdb ; \ |
|
198 |
) |
|
199 |
endif |
|
200 |
endif |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
201 |
else |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
202 |
# |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
203 |
# Note that we have to link -lthread even when USE_PTHREADS is true. |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
204 |
# This is becuase checkForCorrectLibthread() croaks otherwise. |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
205 |
# |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
206 |
LIBTHREAD = -lthread |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
207 |
ifeq ($(USE_PTHREADS),true) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
208 |
THREADLIBS = -lpthread $(LIBTHREAD) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
209 |
else |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
210 |
THREADLIBS = $(LIBTHREAD) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
211 |
endif |
2 | 212 |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
213 |
ifeq ($(PLATFORM), macosx) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
214 |
THREADLIBS = -pthread |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
215 |
# Needed for linking the various launchers |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
216 |
LDFLAGS += -framework Cocoa -framework Security \ |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
217 |
-framework ApplicationServices |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
218 |
OTHER_CPPFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"' |
2 | 219 |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
220 |
# Default Info.plist file for the command line tools. This gets overridden by |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
221 |
# some of the jvmstat tools so that they have task_for_pid() privileges |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
222 |
ifndef INFO_PLIST_FILE |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
223 |
INFO_PLIST_FILE = Info-cmdline.plist |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
224 |
endif |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
225 |
LDFLAGS += -sectcreate __TEXT __info_plist $(LAUNCHER_PLATFORM_SRC)/lib/$(INFO_PLIST_FILE) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
226 |
else |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
227 |
INFO_PLIST_FILE= |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
228 |
endif |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
229 |
|
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
230 |
# |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
231 |
# This rule only applies on unix. It supports quantify and its ilk. |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
232 |
# |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
233 |
$(ACTUAL_PROGRAM):: $(FILES_o) |
2 | 234 |
@$(prep-target) |
235 |
@set -- $?; \ |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
236 |
$(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...}; |
2 | 237 |
@$(MKDIR) -p $(TEMPDIR) |
238 |
$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \ |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
239 |
$(FILES_o) $(THREADLIBS) $(LDLIBS) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
240 |
ifeq ($(findstring privileged, $(INFO_PLIST_FILE)), privileged) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
241 |
-codesign -s openjdk_codesign $@ |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
242 |
endif |
8008
753c38f4af83
6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents:
7668
diff
changeset
|
243 |
@$(call binary_file_verification,$@) |
12427 | 244 |
ifneq ($(PLATFORM), macosx) |
245 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
|
246 |
ifeq ($(PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS),1) |
|
247 |
(set -e ; \ |
|
248 |
$(CD) $(@D) ; \ |
|
249 |
$(OBJCOPY) --only-keep-debug $(@F) $(@F).debuginfo ; \ |
|
250 |
$(OBJCOPY) --add-gnu-debuglink=$(@F).debuginfo $(@F) ; \ |
|
251 |
) |
|
252 |
ifeq ($(STRIP_POLICY),all_strip) |
|
253 |
$(STRIP) $@ |
|
254 |
else |
|
255 |
ifeq ($(STRIP_POLICY),min_strip) |
|
256 |
ifeq ($(PLATFORM), solaris) |
|
257 |
$(STRIP) -x $@ |
|
258 |
else |
|
259 |
# assume Linux |
|
260 |
$(STRIP) -g $@ |
|
261 |
endif |
|
262 |
# implied else here is no stripping at all |
|
263 |
endif |
|
264 |
endif |
|
265 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
|
266 |
(set -e ; \ |
|
267 |
$(CD) $(@D) ; \ |
|
268 |
$(ZIPEXE) -q $(@F).diz $(@F).debuginfo ; \ |
|
269 |
$(RM) $(@F).debuginfo ; \ |
|
270 |
) |
|
12433
ac48511f8b50
7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents:
12427
diff
changeset
|
271 |
# save ZIP'ed debug info with rest of the program's build artifacts |
ac48511f8b50
7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents:
12427
diff
changeset
|
272 |
$(MV) $@.diz $(OBJDIR) |
ac48511f8b50
7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents:
12427
diff
changeset
|
273 |
else |
ac48511f8b50
7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents:
12427
diff
changeset
|
274 |
# save debug info with rest of the program's build artifacts |
ac48511f8b50
7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents:
12427
diff
changeset
|
275 |
$(MV) $@.debuginfo $(OBJDIR) |
12427 | 276 |
endif |
277 |
endif # PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS |
|
278 |
endif # ENABLE_FULL_DEBUG_SYMBOLS |
|
279 |
endif # PLATFORM-!macosx |
|
2 | 280 |
endif # PLATFORM |
281 |
||
282 |
clean:: |
|
283 |
ifeq ($(PLATFORM), windows) |
|
284 |
$(RM) $(OBJDIR)/$(PROGRAM).rc |
|
285 |
$(RM) $(OBJDIR)/$(PROGRAM).ico |
|
286 |
$(RM) $(OBJDIR)/$(PROGRAM).lcf |
|
287 |
$(RM) $(OBJDIR)/$(PROGRAM).map |
|
12427 | 288 |
$(RM) $(OBJDIR)/$(PROGRAM).pdb |
2 | 289 |
$(RM) $(OBJDIR)/$(PROGRAM).exp |
290 |
$(RM) $(OBJDIR)/$(PROGRAM).lib |
|
291 |
$(RM) $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX) |
|
292 |
$(RM) $(OBJDIR)/$(PROGRAM).ilk |
|
293 |
$(RM) *.pdb |
|
12427 | 294 |
else |
295 |
$(RM) $(OBJDIR)/$(PROGRAM).debuginfo |
|
2 | 296 |
endif |
12427 | 297 |
$(RM) $(OBJDIR)/$(PROGRAM).diz |
2 | 298 |
|
299 |
||
300 |
clobber:: |
|
301 |
$(RM) $(ACTUAL_PROGRAM) |
|
302 |
||
303 |
# |
|
304 |
# Now include make dependencies (created during compilation, see Rules.gmk) |
|
305 |
# |
|
306 |
ifeq ($(INCREMENTAL_BUILD),true) |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
307 |
# Workaround: gnumake sometimes says files is empty when it shouldn't |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
308 |
# was: files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file)) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
309 |
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
310 |
ifneq ($(strip $(files)),) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
311 |
include $(files) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
312 |
endif |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
313 |
endif |
2 | 314 |
|
315 |
ifdef JAVA_ARGS |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
316 |
OTHER_CPPFLAGS += -DJAVA_ARGS='$(JAVA_ARGS)' |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
317 |
OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' |
2 | 318 |
endif |
319 |
||
320 |
ifeq ($(PLATFORM), windows) |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
321 |
ifdef RELEASE |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
322 |
OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"' |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
323 |
endif |
2 | 324 |
endif |
325 |
||
326 |
||
327 |
ifneq ($(PLATFORM), windows) |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
328 |
HAVE_GETHRTIME=true |
2 | 329 |
endif |
330 |
||
331 |
ifeq ($(HAVE_GETHRTIME),true) |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
332 |
OTHER_CPPFLAGS += -DHAVE_GETHRTIME |
2 | 333 |
endif |
334 |
||
335 |
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
336 |
ifeq ($(PLATFORM), macosx) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
337 |
OTHER_INCLUDES += -I$(LAUNCHER_SOLARIS_PLATFORM_SRC)/bin |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
338 |
ifneq ($(SYSTEM_ZLIB), true) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
339 |
OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
340 |
endif |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
341 |
else |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
342 |
OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
343 |
endif |
2 | 344 |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
345 |
OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"' |
2 | 346 |
VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"' |
347 |
||
348 |
VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \ |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
9455
diff
changeset
|
349 |
-DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' |
2 | 350 |
|
351 |
||
352 |
||
353 |
$(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c |
|
354 |
@$(prep-target) |
|
355 |
$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \ |
|
356 |
$(VERSION_DEFINES) $< |
|
357 |
||
358 |
# |
|
359 |
# Default dependencies |
|
360 |
# |
|
361 |
||
362 |
all: build |
|
363 |
||
364 |
build: program |
|
365 |
||
366 |
debug: |
|
367 |
$(MAKE) VARIANT=DBG build |
|
368 |
||
369 |
fastdebug: |
|
370 |
$(MAKE) VARIANT=DBG FASTDEBUG=true build |
|
371 |
||
372 |
.PHONY: all build program clean clobber debug fastdebug |