duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 1 | # |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 2 | # Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 7 | # published by the Free Software Foundation. Oracle designates this |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 8 | # particular file as subject to the "Classpath" exception as provided |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 9 | # by Oracle in the LICENSE file that accompanied this code. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 | # |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 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. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 41 | # set the platform specific directory for macosx, also this platform shares |
| 42 | # substantial family ties with its siblings (solaris and linux), thus we add |
| 43 | # solaris src path to its compilation dependencies. |
| 44 | ifeq ($(PLATFORM), macosx) |
| 45 | LAUNCHER_PLATFORM_SRC = $(BUILDDIR)/../src/macosx |
| 46 | LAUNCHER_SOLARIS_PLATFORM_SRC = $(BUILDDIR)/../src/solaris |
| 47 | else |
| 48 | LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 49 | endif |
| 50 | |
| 51 | ifndef LAUNCHER_SHARE_SRC |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 52 | LAUNCHER_SHARE_SRC = $(SHARE_SRC) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 59 | # Make sure the default rule is all |
| 60 | program_default_rule: all |
| 61 | |
| 62 | program: $(ACTUAL_PROGRAM) |
| 63 | |
dholmes | 5e4d33b | 2011-05-04 22:16:28 -0400 | [diff] [blame] | 64 | # Work-around for missing processor specific mapfiles |
| 65 | ifndef CROSS_COMPILE_ARCH |
| 66 | # reuse the mapfiles in the launcher's directory, the same should |
| 67 | # be applicable to the tool launchers as well. |
| 68 | FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH) |
| 69 | include $(BUILDDIR)/common/Mapfile-vers.gmk |
| 70 | endif |
ksrini | 896eddf | 2011-04-06 19:31:30 -0700 | [diff] [blame] | 71 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 72 | include $(JDK_TOPDIR)/make/common/Rules.gmk |
| 73 | |
| 74 | ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 75 | OTHER_CPPFLAGS += -DNEVER_ACT_AS_SERVER_CLASS_MACHINE |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 | # |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 87 | ifeq ($(PLATFORM), macosx) |
| 88 | ifneq ($(ARCH), universal) |
| 89 | LDFLAGS += -Wl,-all_load |
| 90 | endif |
| 91 | LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a |
| 92 | |
| 93 | ifeq ($(SYSTEM_ZLIB),true) |
| 94 | OTHER_LDLIBS += -lz |
| 95 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 96 | endif |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 97 | |
| 98 | ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems |
| 99 | LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli |
| 100 | OTHER_LDLIBS += -ljli |
| 101 | ifeq ($(PLATFORM), solaris) |
| 102 | ifeq ($(ARCH_DATA_MODEL), 32) |
| 103 | LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli |
| 104 | LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli |
| 105 | else |
| 106 | LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)/jli |
| 107 | LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)/jli |
| 108 | endif |
| 109 | endif |
| 110 | ifeq ($(PLATFORM), linux) |
| 111 | LDFLAGS += $(LDFLAG_Z_ORIGIN) |
| 112 | LDFLAGS += -Wl,--allow-shlib-undefined |
| 113 | LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli |
| 114 | LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli |
| 115 | endif |
| 116 | endif |
| 117 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 118 | ifeq ($(PLATFORM), windows) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 119 | JLI_LCF = $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/jli.lcf |
| 120 | ifdef STATIC_JLI |
| 121 | LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static |
| 122 | else |
| 123 | LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME) |
| 124 | endif |
| 125 | OTHER_LDLIBS += jli.lib |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 126 | endif |
| 127 | |
| 128 | # |
| 129 | # Launcher specific files. |
| 130 | # |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 131 | FILES_o = $(OBJDIR)/main.$(OBJECT_SUFFIX) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 132 | |
mchung | 3baa2d6 | 2010-01-07 08:14:48 -0800 | [diff] [blame] | 133 | $(ACTUAL_PROGRAM):: classes $(INIT) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 134 | |
| 135 | # |
| 136 | # Windows only |
| 137 | # |
| 138 | ifeq ($(PLATFORM), windows) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 139 | # JDK name required here |
| 140 | RC_FLAGS += /D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \ |
| 141 | /D "JDK_INTERNAL_NAME=$(PROGRAM)" \ |
| 142 | /D "JDK_FTYPE=0x1L" |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 143 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 144 | $(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 145 | @$(prep-target) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 146 | ifndef LOCAL_RESOURCE_FILE |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 147 | $(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 148 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 149 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 150 | $(OBJDIR)/$(PROGRAM).lcf: $(OBJDIR)/$(PROGRAM).res $(FILES_o) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 159 | $(ACTUAL_PROGRAM):: $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 160 | @$(install-file) |
| 161 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 162 | ifeq ($(ARCH_DATA_MODEL), 32) |
| 163 | STACK_SIZE=327680 |
| 164 | else |
| 165 | # We need more Stack for Windows 64bit |
| 166 | STACK_SIZE=1048576 |
| 167 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 168 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 169 | IMVERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER) |
| 170 | $(OBJDIR)/$(PROGRAM).exe.manifest: $(JDK_TOPDIR)/src/windows/resource/java.manifest |
prr | 1a77cbc | 2011-01-19 17:07:51 -0800 | [diff] [blame] | 171 | @$(prep-target) |
| 172 | $(SED) 's%IMVERSION%$(IMVERSION)%g;s%PROGRAM%$(PROGRAM)%g' $< > $@ |
| 173 | |
dcubed | b896fcf | 2012-04-03 12:57:47 -0700 | [diff] [blame] | 174 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
| 175 | MAP_OPTION="-map:$(OBJDIR)/$(PROGRAM).map" |
| 176 | endif |
| 177 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 178 | # We used a hand-crafted manifest file for all executables. |
| 179 | # It is tweaked to embed the build number and executable name. |
| 180 | # Use ";#2" for .dll and ";#1" for .exe in the MT command below: |
| 181 | $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) $(OBJDIR)/$(PROGRAM).exe.manifest |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 182 | @$(prep-target) |
| 183 | @set -- $?; \ |
| 184 | $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...}; |
| 185 | $(LINK) -out:$@ /STACK:$(STACK_SIZE) \ |
dcubed | b896fcf | 2012-04-03 12:57:47 -0700 | [diff] [blame] | 186 | $(MAP_OPTION) $(LFLAGS) $(LDFLAGS) \ |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 187 | @$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 188 | ifdef MT |
tbell | fc2a6fe | 2009-01-14 21:35:03 -0800 | [diff] [blame] | 189 | $(MT) /manifest $(OBJDIR)/$(PROGRAM).exe.manifest /outputresource:$@;#1 |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 190 | endif |
ohair | 67e0bbf | 2011-01-05 14:28:58 -0800 | [diff] [blame] | 191 | @$(call binary_file_verification,$@) |
dcubed | 7fe35f3 | 2012-04-11 07:26:35 -0700 | [diff] [blame] | 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 |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 201 | else |
| 202 | # |
| 203 | # Note that we have to link -lthread even when USE_PTHREADS is true. |
| 204 | # This is becuase checkForCorrectLibthread() croaks otherwise. |
| 205 | # |
| 206 | LIBTHREAD = -lthread |
| 207 | ifeq ($(USE_PTHREADS),true) |
| 208 | THREADLIBS = -lpthread $(LIBTHREAD) |
| 209 | else |
| 210 | THREADLIBS = $(LIBTHREAD) |
| 211 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 212 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 213 | ifeq ($(PLATFORM), macosx) |
| 214 | THREADLIBS = -pthread |
| 215 | # Needed for linking the various launchers |
| 216 | LDFLAGS += -framework Cocoa -framework Security \ |
| 217 | -framework ApplicationServices |
| 218 | OTHER_CPPFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"' |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 219 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 220 | # Default Info.plist file for the command line tools. This gets overridden by |
| 221 | # some of the jvmstat tools so that they have task_for_pid() privileges |
| 222 | ifndef INFO_PLIST_FILE |
| 223 | INFO_PLIST_FILE = Info-cmdline.plist |
| 224 | endif |
| 225 | LDFLAGS += -sectcreate __TEXT __info_plist $(LAUNCHER_PLATFORM_SRC)/lib/$(INFO_PLIST_FILE) |
| 226 | else |
| 227 | INFO_PLIST_FILE= |
| 228 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 229 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 230 | # |
| 231 | # This rule only applies on unix. It supports quantify and its ilk. |
| 232 | # |
dcubed | a054bf4 | 2012-05-25 08:20:12 -0700 | [diff] [blame^] | 233 | |
| 234 | ifeq ($(PLATFORM), solaris) |
| 235 | ifeq ($(PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS),1) |
| 236 | $(ACTUAL_PROGRAM):: $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) |
| 237 | endif |
| 238 | endif |
| 239 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 240 | $(ACTUAL_PROGRAM):: $(FILES_o) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 241 | @$(prep-target) |
| 242 | @set -- $?; \ |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 243 | $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...}; |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 244 | @$(MKDIR) -p $(TEMPDIR) |
| 245 | $(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \ |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 246 | $(FILES_o) $(THREADLIBS) $(LDLIBS) |
| 247 | ifeq ($(findstring privileged, $(INFO_PLIST_FILE)), privileged) |
| 248 | -codesign -s openjdk_codesign $@ |
| 249 | endif |
ohair | 67e0bbf | 2011-01-05 14:28:58 -0800 | [diff] [blame] | 250 | @$(call binary_file_verification,$@) |
dcubed | 7fe35f3 | 2012-04-11 07:26:35 -0700 | [diff] [blame] | 251 | ifneq ($(PLATFORM), macosx) |
| 252 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
| 253 | ifeq ($(PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS),1) |
dcubed | a054bf4 | 2012-05-25 08:20:12 -0700 | [diff] [blame^] | 254 | ifeq ($(PLATFORM), solaris) |
| 255 | # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. |
| 256 | # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from |
| 257 | # empty section headers until a fixed $(OBJCOPY) is available. |
| 258 | # An empty section header has sh_addr == 0 and sh_size == 0. |
| 259 | # This problem has only been seen on Solaris X64, but we call this tool |
| 260 | # on all Solaris builds just in case. |
| 261 | # |
| 262 | # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
| 263 | # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. |
| 264 | (set -e ; \ |
| 265 | $(CD) $(@D) ; \ |
| 266 | $(FIX_EMPTY_SEC_HDR_FLAGS) $(@F) ; \ |
| 267 | $(OBJCOPY) --only-keep-debug $(@F) $(@F).debuginfo ; \ |
| 268 | $(ADD_GNU_DEBUGLINK) $(@F).debuginfo $(@F) ; \ |
| 269 | ) |
| 270 | else # PLATFORM != solaris |
dcubed | 7fe35f3 | 2012-04-11 07:26:35 -0700 | [diff] [blame] | 271 | (set -e ; \ |
| 272 | $(CD) $(@D) ; \ |
| 273 | $(OBJCOPY) --only-keep-debug $(@F) $(@F).debuginfo ; \ |
| 274 | $(OBJCOPY) --add-gnu-debuglink=$(@F).debuginfo $(@F) ; \ |
| 275 | ) |
dcubed | a054bf4 | 2012-05-25 08:20:12 -0700 | [diff] [blame^] | 276 | endif # PLATFORM == solaris |
dcubed | 7fe35f3 | 2012-04-11 07:26:35 -0700 | [diff] [blame] | 277 | ifeq ($(STRIP_POLICY),all_strip) |
| 278 | $(STRIP) $@ |
| 279 | else |
| 280 | ifeq ($(STRIP_POLICY),min_strip) |
| 281 | ifeq ($(PLATFORM), solaris) |
| 282 | $(STRIP) -x $@ |
| 283 | else |
| 284 | # assume Linux |
| 285 | $(STRIP) -g $@ |
| 286 | endif |
| 287 | # implied else here is no stripping at all |
| 288 | endif |
| 289 | endif |
| 290 | ifeq ($(ZIP_DEBUGINFO_FILES),1) |
| 291 | (set -e ; \ |
| 292 | $(CD) $(@D) ; \ |
| 293 | $(ZIPEXE) -q $(@F).diz $(@F).debuginfo ; \ |
| 294 | $(RM) $(@F).debuginfo ; \ |
| 295 | ) |
dcubed | 2ee5be9 | 2012-04-12 16:23:24 -0700 | [diff] [blame] | 296 | # save ZIP'ed debug info with rest of the program's build artifacts |
| 297 | $(MV) $@.diz $(OBJDIR) |
| 298 | else |
| 299 | # save debug info with rest of the program's build artifacts |
| 300 | $(MV) $@.debuginfo $(OBJDIR) |
dcubed | 7fe35f3 | 2012-04-11 07:26:35 -0700 | [diff] [blame] | 301 | endif |
| 302 | endif # PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS |
| 303 | endif # ENABLE_FULL_DEBUG_SYMBOLS |
| 304 | endif # PLATFORM-!macosx |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 305 | endif # PLATFORM |
| 306 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 307 | clean:: |
| 308 | ifeq ($(PLATFORM), windows) |
| 309 | $(RM) $(OBJDIR)/$(PROGRAM).rc |
| 310 | $(RM) $(OBJDIR)/$(PROGRAM).ico |
| 311 | $(RM) $(OBJDIR)/$(PROGRAM).lcf |
| 312 | $(RM) $(OBJDIR)/$(PROGRAM).map |
dcubed | 7fe35f3 | 2012-04-11 07:26:35 -0700 | [diff] [blame] | 313 | $(RM) $(OBJDIR)/$(PROGRAM).pdb |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 314 | $(RM) $(OBJDIR)/$(PROGRAM).exp |
| 315 | $(RM) $(OBJDIR)/$(PROGRAM).lib |
| 316 | $(RM) $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX) |
| 317 | $(RM) $(OBJDIR)/$(PROGRAM).ilk |
| 318 | $(RM) *.pdb |
dcubed | 7fe35f3 | 2012-04-11 07:26:35 -0700 | [diff] [blame] | 319 | else |
| 320 | $(RM) $(OBJDIR)/$(PROGRAM).debuginfo |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 321 | endif |
dcubed | 7fe35f3 | 2012-04-11 07:26:35 -0700 | [diff] [blame] | 322 | $(RM) $(OBJDIR)/$(PROGRAM).diz |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 323 | |
| 324 | |
| 325 | clobber:: |
| 326 | $(RM) $(ACTUAL_PROGRAM) |
| 327 | |
| 328 | # |
| 329 | # Now include make dependencies (created during compilation, see Rules.gmk) |
| 330 | # |
| 331 | ifeq ($(INCREMENTAL_BUILD),true) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 332 | # Workaround: gnumake sometimes says files is empty when it shouldn't |
| 333 | # was: files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file)) |
| 334 | files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null) |
| 335 | ifneq ($(strip $(files)),) |
| 336 | include $(files) |
| 337 | endif |
| 338 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 339 | |
| 340 | ifdef JAVA_ARGS |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 341 | OTHER_CPPFLAGS += -DJAVA_ARGS='$(JAVA_ARGS)' |
| 342 | OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 343 | endif |
| 344 | |
| 345 | ifeq ($(PLATFORM), windows) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 346 | ifdef RELEASE |
| 347 | OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"' |
| 348 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 349 | endif |
| 350 | |
| 351 | |
| 352 | ifneq ($(PLATFORM), windows) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 353 | HAVE_GETHRTIME=true |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 354 | endif |
| 355 | |
| 356 | ifeq ($(HAVE_GETHRTIME),true) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 357 | OTHER_CPPFLAGS += -DHAVE_GETHRTIME |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 358 | endif |
| 359 | |
| 360 | OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 361 | ifeq ($(PLATFORM), macosx) |
| 362 | OTHER_INCLUDES += -I$(LAUNCHER_SOLARIS_PLATFORM_SRC)/bin |
| 363 | ifneq ($(SYSTEM_ZLIB), true) |
| 364 | OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 |
| 365 | endif |
| 366 | else |
| 367 | OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 |
| 368 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 369 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 370 | OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"' |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 371 | VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"' |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 372 | |
| 373 | VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \ |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 374 | -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 375 | |
| 376 | |
| 377 | |
| 378 | $(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c |
| 379 | @$(prep-target) |
| 380 | $(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \ |
| 381 | $(VERSION_DEFINES) $< |
| 382 | |
| 383 | # |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 384 | # Default dependencies |
| 385 | # |
| 386 | |
| 387 | all: build |
| 388 | |
| 389 | build: program |
| 390 | |
| 391 | debug: |
| 392 | $(MAKE) VARIANT=DBG build |
| 393 | |
| 394 | fastdebug: |
| 395 | $(MAKE) VARIANT=DBG FASTDEBUG=true build |
| 396 | |
| 397 | .PHONY: all build program clean clobber debug fastdebug |