Library.gmk revision 2362
2362N/A# Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A# This code is free software; you can redistribute it and/or modify it 0N/A# under the terms of the GNU General Public License version 2 only, as 2362N/A# published by the Free Software Foundation. Oracle designates this 0N/A# particular file as subject to the "Classpath" exception as provided 2362N/A# by Oracle in the LICENSE file that accompanied this code. 0N/A# This code is distributed in the hope that it will be useful, but WITHOUT 0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A# version 2 for more details (a copy is included in the LICENSE file that 0N/A# accompanied this code). 0N/A# You should have received a copy of the GNU General Public License version 0N/A# 2 along with this work; if not, write to the Free Software Foundation, 0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A# Generic makefile for building shared libraries. 0N/A# WARNING: This file is shared with other workspaces. 0N/A# So when it includes other files, it must use JDK_TOPDIR. 0N/A# in order to override the values defined inthat makefile. 0N/A# List of all lint files, one for each .c file (only for C) 0N/A# C++ libraries must be linked with CC. 0N/A# FIXUP: unpack needs the zip .o files. So we must build zip? 0N/A# If a Makefile has specified a pre-compiled closed src lib, just copy it. 0N/A# We either need to import (copy) libraries in, or build them 0N/A# COMPILE_APPROACH: Different approaches to compile up the native object 0N/A# files as quickly as possible. 0N/A# The setting of parallel works best on Unix, batch on Windows. 0N/A# COMPILE_APPROACH=parallel: Will trigger compilations (just compilations) to 0N/A# happen in parallel. Greatly decreases Unix build time, even on single CPU 0N/A# machines, more so on multiple CPU machines. Default is 2 compiles 0N/A# at a time, but can be adjusted with ALT_PARALLEL_COMPILE_JOBS. 0N/A# Note that each .d file will also be dependent on it's .o file, see 0N/A# Note this does not depend on Rules.gmk to work like batch (below) 0N/A# and this technique doesn't seem to help Windows build time nor does 0N/A# it work very well, it's possible the Windows Visual Studio compilers 0N/A# don't work well in a parallel situation, this needs investigation. 0N/A# COMPILE_APPROACH=batch: Will trigger compilations (just compilations) to 0N/A# happen in batch mode. Greatly decreases Windows build time. 0N/A# See logic in Rules.gmk for how compiles happen, the $(MAKE) in 0N/A# library_batch_compile below triggers the actions in Rules.gmk. 0N/A# Note that each .d file will also be dependent on it's .o file, see 0N/A# Library building rules. 0N/A# build it into $(OBJDIR) so that the other generated files get put 0N/A# there, then copy just the DLL (and MAP file) to the requested directory. 795N/A# In VS2005 or VS2008 the link command creates a .manifest file that we want 795N/A# to insert into the linked artifact so we do not need to track it separately. 795N/A# Use ";#2" for .dll and ";#1" for .exe in the MT command below: 0N/A# Install a .lib file if required. 0N/A# On Solaris, use mcs to write the version into the comment section of 0N/A# the shared library. On other platforms set this to false at the 0N/A @
$(ECHO) "Rebuilding $@ because of $?" 0N/A# Cross check all linted files against each other 0N/A# OpenJDK rule is first so any lib is preferentially copied from that location. 0N/A# In this case we are just copying the file. 0N/A# Copies in the file from the JDK_IMPORT_PATH area 0N/A# Class libraries with JNI native methods get a include to the package. 0N/A# INCREMENTAL_BUILD means that this workspace will be built over and over 0N/A# possibly incrementally. This means tracking the object file dependencies 0N/A# on include files so that sources get re-compiled when the include files 0N/A# change. When building from scratch and doing a one time build (like 0N/A# release engineering or nightly builds) set INCREMENTAL_BUILD=false. 0N/A# Workaround: gnumake sometimes says files is empty when it shouldn't 0N/A# was: files := $(foreach file, $(wildcard $(OBJDIR)/*.$(DEPEND_SUFFIX)), $(file)) 0N/A# Only include these files if we have any. 0N/A# Default dependencies