#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Generic makefile for building executables.
#
# WARNING: This file is shared with other workspaces.
# So when it includes other files, it must use JDK_TOPDIR.
#
#
# If building programs, use a normal compile approach
#
# set the platform specific directory for macosx, also this platform shares
# substantial family ties with its siblings (solaris and linux), thus we add
# solaris src path to its compilation dependencies.
else # ! MACOSX
endif # MACOSX
ACTUAL_PROGRAM_DIR = $(BINDIR)
# Make sure the default rule is all
# Work-around for missing processor specific mapfiles
# reuse the mapfiles in the launcher's directory, the same should
# be applicable to the tool launchers as well.
#
# Create a dependency on libjli (Java Launcher Infrastructure)
#
# On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to
# do this reliably on Linux takes a different syntax than Solaris.
#
# On Windows, this is done by using the same directory as the executable
# itself, as with all the Windows libraries.
#
endif # ARCH
OTHER_LDLIBS += $(ZLIB_LIBS)
endif # SYSTEM_ZLIB
endif # PLATFORM
OTHER_LDLIBS += -ljli
else # ! ARCH_DATA_MODEL 64-bit
endif # ARCH_DATA_MODEL
endif # PLATFORM SOLARIS
LDFLAGS += $(LDFLAG_Z_ORIGIN)
endif # PLATFORM LINUX
endif # PLATFORM linux solaris
else # !STATIC_JLI
endif # STATIC_JLI
endif # PLATFORM
#
# Launcher specific files.
#
#
# Windows only
#
# JDK name required here
/D "JDK_FTYPE=0x1L"
endif # LOCAL_RESOURCE_FILE
endif # LOCAL_RESOURCE_FILE
STACK_SIZE=327680
else # !32 BIT
# We need more Stack for Windows 64bit
STACK_SIZE=1048576
endif # ARCH_DATA_MODEL
$(SED) 's%IMVERSION%$(IMVERSION)%g;s%PROGRAM%$(PROGRAM)%g' $< > $@
# We used a hand-crafted manifest file for all executables.
# It is tweaked to embed the build number and executable name.
# Use ";#2" for .dll and ";#1" for .exe in the MT command below:
$(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) $(OBJDIR)/$(PROGRAM).exe.manifest
@set -- $?; \
endif # MT
@$(call binary_file_verification,$@)
(set -e ; \
)
else # *NIXES
#
# Note that we have to link -lthread even when USE_PTHREADS is true.
# This is becuase checkForCorrectLibthread() croaks otherwise.
#
else # !USE_PTHREADS
THREADLIBS = $(LIBTHREAD)
endif # USE_PTHREADS
# Needed for linking the various launchers
# Default Info.plist file for the command line tools. This gets overridden by
# some of the jvmstat tools so that they have task_for_pid() privileges
endif # INFO_PLIST_FILE
endif # MACOSX
#
# This rule only applies on unix. It supports quantify and its ilk.
#
$(ACTUAL_PROGRAM):: $(FILES_o)
@set -- $?; \
-codesign -s openjdk_codesign $@
endif # INFO_PLIST_FILE
@$(call binary_file_verification,$@)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
# empty section headers until a fixed $(OBJCOPY) is available.
# An empty section header has sh_addr == 0 and sh_size == 0.
# This problem has only been seen on Solaris X64, but we call this tool
# on all Solaris builds just in case.
#
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
(set -e ; \
)
else # PLATFORM != solaris
(set -e ; \
)
endif # PLATFORM == solaris
$(STRIP) $@
else
$(STRIP) -x $@
else
# assume Linux
$(STRIP) -g $@
# implied else here is no stripping at all
(set -e ; \
)
# save ZIP'ed debug info with rest of the program's build artifacts
else
# save debug info with rest of the program's build artifacts
endif # PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS
endif # ENABLE_FULL_DEBUG_SYMBOLS
endif # PLATFORM-!macosx
endif # PLATFORM
clean::
else
clobber::
$(RM) $(ACTUAL_PROGRAM)
#
# Now include make dependencies (created during compilation, see Rules.gmk)
#
# Workaround: gnumake sometimes says files is empty when it shouldn't
# was: files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file))
endif # files
endif # INCREMENTAL_BUILD
endif # JAVA_ARGS
endif #RELEASE
endif #PLATFORM
HAVE_GETHRTIME=true
endif #PLATFORM
endif # SYSTEM_ZLIB
else # PLATFORM !MACOSX
-DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
$(VERSION_DEFINES) $<
#
# Default dependencies
#