jdk/make/common/Library.gmk
author dcubed
Wed, 11 Apr 2012 07:26:35 -0700
changeset 12427 116544b5a04c
parent 12307 b34445ac110f
child 12853 7bdaa5aefd3d
permissions -rw-r--r--
7071907: JDK: Full Debug Symbols Summary: Add initial FDS support to some libraries and programs. Reviewed-by: kamg, fparain, sspitsyn, dsamersoff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
12307
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
     2
# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Generic makefile for building shared libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# WARNING: This file is shared with other workspaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#          So when it includes other files, it must use JDK_TOPDIR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
include $(JDK_TOPDIR)/make/common/Classes.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
# It is important to define these *after* including Classes.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
# in order to override the values defined inthat makefile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
ifeq ($(LIBRARY), fdlibm)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
ifeq ($(PLATFORM),windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(FDDLIBM_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
ACTUAL_LIBRARY_DIR = $(OBJDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
else # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(ARCH).$(FDDLIBM_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
ACTUAL_LIBRARY_DIR = $(OBJDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
endif #PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
else # LIBRARY
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
ACTUAL_LIBRARY_DIR = $(LIB_LOCATION)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
ACTUAL_LIBRARY = $(ACTUAL_LIBRARY_DIR)/$(ACTUAL_LIBRARY_NAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
library:: $(ACTUAL_LIBRARY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
FILES_o   = $(patsubst %.c,   %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
FILES_o  += $(patsubst %.s,   %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_s))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
FILES_o  += $(patsubst %.cpp, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
    61
ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
    62
FILES_o  += $(patsubst %.m,   %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_objc))))
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
    63
FILES_o  += $(patsubst %.mm,  %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_objcpp))))
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
    64
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
    65
INCREMENTAL_BUILD=false
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
    66
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
    67
endif # PLATFORM
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
    68
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
ifeq ($(INCREMENTAL_BUILD),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
FILES_d   = $(patsubst %.c,   %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
FILES_d  += $(patsubst %.cpp, %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
endif # INCREMENTAL_BUILD
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
ifeq ($(PLATFORM),solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
# List of all lint files, one for each .c file (only for C)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
FILES_ln   = $(patsubst %.c,   %.$(LINT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
# C++ libraries must be linked with CC.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
ifdef CPLUSPLUSLIBRARY
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
LINKER=$(LINK.cc)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
LINKER=$(LINK.c)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
$(ACTUAL_LIBRARY):: $(INIT) $(TEMPDIR) $(LIBDIR) $(BINDIR) $(EXTDIR) classheaders
8993
9076d969ffdf 7025066: Build systems changes to support SE Embedded Integration
dholmes
parents: 8583
diff changeset
    89
	@$(ECHO) Building lib:$(ACTUAL_LIBRARY) 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
# COMPILE_APPROACH: Different approaches to compile up the native object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
#   files as quickly as possible.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#   The setting of parallel works best on Unix, batch on Windows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
COMPILE_FILES_o = $(OBJDIR)/.files_compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
$(COMPILE_FILES_o): $(FILES_d) $(FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
	@$(ECHO) "$<" >> $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
clean::
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
	$(RM) $(COMPILE_FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
# COMPILE_APPROACH=parallel: Will trigger compilations (just compilations) to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
#   happen in parallel. Greatly decreases Unix build time, even on single CPU
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
#   machines, more so on multiple CPU machines. Default is 2 compiles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
#   at a time, but can be adjusted with ALT_PARALLEL_COMPILE_JOBS.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
#   Note that each .d file will also be dependent on it's .o file, see
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
#   Rules.gmk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
#   Note this does not depend on Rules.gmk to work like batch (below)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#   and this technique doesn't seem to help Windows build time nor does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
#   it work very well, it's possible the Windows Visual Studio compilers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
#   don't work well in a parallel situation, this needs investigation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
ifeq ($(COMPILE_APPROACH),parallel)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
.PHONY: library_parallel_compile
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
library_parallel_compile:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
	@$(ECHO) "Begin parallel compiles: $(shell $(PWD))"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
	@$(MAKE) -j $(PARALLEL_COMPILE_JOBS) $(COMPILE_FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
	@$(ECHO) "Done with parallel compiles: $(shell $(PWD))"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
$(ACTUAL_LIBRARY):: library_parallel_compile
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
# COMPILE_APPROACH=batch: Will trigger compilations (just compilations) to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#   happen in batch mode. Greatly decreases Windows build time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
#   See logic in Rules.gmk for how compiles happen, the $(MAKE) in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#   library_batch_compile below triggers the actions in Rules.gmk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#   Note that each .d file will also be dependent on it's .o file, see
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
#   Rules.gmk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
ifeq ($(COMPILE_APPROACH),batch)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
.PHONY: library_batch_compile
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
library_batch_compile:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
	@$(ECHO) "Begin BATCH compiles: $(shell $(PWD))"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
	$(MAKE) $(COMPILE_FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
	$(MAKE) batch_compile
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
	@$(ECHO) "Done with BATCH compiles: $(shell $(PWD))"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
	$(MAKE) COMPILE_APPROACH=normal $(COMPILE_FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
$(ACTUAL_LIBRARY):: library_batch_compile
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
# Library building rules.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
$(LIBRARY).lib:: $(OBJDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
ifeq ($(LIBRARY), fdlibm)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
$(ACTUAL_LIBRARY):: $(OBJDIR)/$(LIBRARY).lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
$(OBJDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lcf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
	$(LIBEXE) -NODEFAULTLIB:MSVCRT -out:$@ -nologo \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
		@$(OBJDIR)/$(LIBRARY).lcf $(OTHER_LCF) $(LDLIBS_COMMON)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
else # LIBRARY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
# build it into $(OBJDIR) so that the other generated files get put 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
# there, then copy just the DLL (and MAP file) to the requested directory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
#
12307
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   170
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   171
  MAP_OPTION="-map:$(OBJDIR)/$(LIBRARY).map"
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   172
endif
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   173
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
$(ACTUAL_LIBRARY):: $(OBJDIR)/$(LIBRARY).lcf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
	@$(MKDIR) -p $(OBJDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
	$(LINK) -dll -out:$(OBJDIR)/$(@F) \
12307
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   178
	  $(MAP_OPTION) \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
	  $(LFLAGS) @$(OBJDIR)/$(LIBRARY).lcf \
10798
413b731e1818 7103549: Remove dependencies on libjava and libjvm from security libraries
chegar
parents: 9050
diff changeset
   180
	  $(OTHER_LCF) $(LDLIBS)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
	$(CP) $(OBJDIR)/$(@F) $@
8008
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7668
diff changeset
   182
	@$(call binary_file_verification,$@)
12307
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   183
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   184
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   185
	(set -e ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   186
	 $(CD) $(OBJDIR) ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   187
	 $(ZIPEXE) -q $(LIBRARY).diz $(LIBRARY).map $(LIBRARY).pdb ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   188
	)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   189
	$(CP) $(OBJDIR)/$(LIBRARY).diz $(@D)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   190
	$(RM) $(OBJDIR)/$(LIBRARY).map $(OBJDIR)/$(LIBRARY).pdb
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   191
  else
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
	$(CP) $(OBJDIR)/$(LIBRARY).map $(@D)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
	$(CP) $(OBJDIR)/$(LIBRARY).pdb $(@D)
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   194
  endif
12307
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   195
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
endif # LIBRARY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
$(OBJDIR)/$(LIBRARY).lcf: $(OBJDIR)/$(LIBRARY).res $(COMPILE_FILES_o) $(FILES_m)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
	@$(MKDIR) -p $(TEMPDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
	@$(ECHO) $(FILES_o) > $@ 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
ifndef LOCAL_RESOURCE_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
	@$(ECHO) $(OBJDIR)/$(LIBRARY).res >> $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
	@$(ECHO) Created $@ 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
3111
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 1776
diff changeset
   208
# JDK name required here
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 1776
diff changeset
   209
RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 1776
diff changeset
   210
            /D "JDK_INTERNAL_NAME=$(LIBRARY)" \
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 1776
diff changeset
   211
            /D "JDK_FTYPE=0x2L"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
$(OBJDIR)/$(LIBRARY).res: $(VERSIONINFO_RESOURCE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
ifndef LOCAL_RESOURCE_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
# Install a .lib file if required.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
ifeq ($(INSTALL_DOT_LIB), true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
$(ACTUAL_LIBRARY):: $(LIBDIR)/$(LIBRARY).lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
	-$(RM) $(LIBDIR)/$(LIBRARY).lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
$(LIBDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
$(LIBDIR)/$(LIBRARY).dll:: $(OBJDIR)/$(LIBRARY).dll
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
endif # INSTALL_DOT_LIB
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
else # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
# On Solaris, use mcs to write the version into the comment section of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
# the shared library.  On other platforms set this to false at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
# make command line.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
#
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
   243
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
   244
ifneq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
   245
  ARFLAGS = -r
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
   246
endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
   247
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
$(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
	@$(prep-target)
917
75261da60fff 6729772: 64-bit build with SS12 compiler: SIGSEGV (0xb) at pc=0x0000000000000048, pid=14826, tid=2
ohair
parents: 2
diff changeset
   250
	@$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), OPTIMIZATION_LEVEL=$(OPTIMIZATION_LEVEL)"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
	@$(ECHO) "Rebuilding $@ because of $?"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
ifeq ($(LIBRARY), fdlibm)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 10798
diff changeset
   253
	$(AR) $(ARFLAGS) $@ $(FILES_o)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
else # LIBRARY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
	$(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS)
8008
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7668
diff changeset
   256
	@$(call binary_file_verification,$@)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
ifeq ($(WRITE_LIBVERSION),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
	$(MCS) -d -a "$(FULL_VERSION)" $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
endif # WRITE_LIBVERSION
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   260
  ifneq ($(PLATFORM), macosx)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   261
    ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   262
      ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   263
	(set -e ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   264
	 $(CD) $(@D) ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   265
	 $(OBJCOPY) --only-keep-debug $(@F) $(LIBRARY).debuginfo ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   266
	 $(OBJCOPY) --add-gnu-debuglink=$(LIBRARY).debuginfo $(@F) ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   267
	)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   268
        ifeq ($(STRIP_POLICY),all_strip)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   269
	  $(STRIP) $@
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   270
        else
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   271
          ifeq ($(STRIP_POLICY),min_strip)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   272
            ifeq ($(PLATFORM), solaris)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   273
	      $(STRIP) -x $@
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   274
            else
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   275
              # assume Linux
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   276
	      $(STRIP) -g $@
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   277
            endif
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   278
          # implied else here is no stripping at all
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   279
          endif
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   280
        endif
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   281
        ifeq ($(ZIP_DEBUGINFO_FILES),1)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   282
	  (set -e ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   283
	   $(CD) $(@D) ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   284
	   $(ZIPEXE) -q $(LIBRARY).diz $(LIBRARY).debuginfo ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   285
	   $(RM) $(LIBRARY).debuginfo ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   286
	  )
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   287
        endif
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   288
      endif # LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   289
    endif # ENABLE_FULL_DEBUG_SYMBOLS
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   290
  endif # PLATFORM-!macosx
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
endif # LIBRARY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
# Cross check all linted files against each other
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
ifeq ($(PLATFORM),solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
lint.errors : $(FILES_ln)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
	$(LINT.c) $(FILES_ln) $(LDLIBS) 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
# Class libraries with JNI native methods get a include to the package.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
ifdef PACKAGE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
OTHER_INCLUDES += -I$(SHARE_SRC)/native/common -I$(PLATFORM_SRC)/native/common
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
OTHER_INCLUDES += -I$(SHARE_SRC)/native/$(PKGDIR) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
		  -I$(PLATFORM_SRC)/native/$(PKGDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
# Clean/clobber rules
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
clean::
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
	$(RM) -r $(ACTUAL_LIBRARY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
clobber:: clean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
# INCREMENTAL_BUILD means that this workspace will be built over and over
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
#   possibly incrementally. This means tracking the object file dependencies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
#   on include files so that sources get re-compiled when the include files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
#   change. When building from scratch and doing a one time build (like
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
#   release engineering or nightly builds) set INCREMENTAL_BUILD=false.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
ifeq ($(INCREMENTAL_BUILD),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
# Workaround: gnumake sometimes says files is empty when it shouldn't
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
#    was:  files := $(foreach file, $(wildcard $(OBJDIR)/*.$(DEPEND_SUFFIX)), $(file))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
# Only include these files if we have any.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
ifneq ($(strip $(files)),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
include $(files)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
endif # files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
endif # INCREMENTAL_BUILD
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
# Default dependencies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
all: build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
build: library
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
debug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
	$(MAKE) VARIANT=DBG build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
fastdebug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
	$(MAKE) VARIANT=DBG FASTDEBUG=true build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
openjdk:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
	$(MAKE) OPENJDK=true build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3111
diff changeset
   366
FORCE:
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 3111
diff changeset
   367
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
.PHONY: all build debug fastdebug
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369