hotspot/make/solaris/makefiles/rules.make
author ohair
Tue, 27 May 2008 09:47:18 -0700
changeset 584 02175b2b64e6
parent 338 5cf9f61d76f4
child 744 88e28f2ccee4
child 670 ddf3e9583f2f
permissions -rw-r--r--
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles) Summary: Allows for building with SS12, no longer requires SS11, warns if not SS11 for now. Once SS12 is validated and performance measurements look ok, SS12 will be the validated compiler. Reviewed-by: sspitsyn, ikrylov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
# Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
# CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
# have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
# Common rules/macros for the vm, adlc.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
# Tell make that .cpp is important
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
.SUFFIXES: .cpp $(SUFFIXES)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
# For now.  Other makefiles use CPP as the c++ compiler, but that should really
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
# name the preprocessor.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
ifeq    ($(CCC),)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
CCC             = $(CPP)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
DEMANGLER       = c++filt
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
DEMANGLE        = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
# $(CC) is the c compiler (cc/gcc), $(CCC) is the c++ compiler (CC/g++).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
C_COMPILE       = $(CC) $(CPPFLAGS) $(CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
CC_COMPILE      = $(CCC) $(CPPFLAGS) $(CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
AS.S            = $(AS) $(ASFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
COMPILE.c       = $(C_COMPILE) -c
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
GENASM.c        = $(C_COMPILE) -S
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
LINK.c          = $(CC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
LINK_LIB.c      = $(CC) $(LFLAGS) $(SHARED_FLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
PREPROCESS.c    = $(C_COMPILE) -E
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
COMPILE.CC      = $(CC_COMPILE) -c
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
GENASM.CC       = $(CC_COMPILE) -S
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
LINK.CC         = $(CCC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
LINK_NOPROF.CC  = $(CCC) $(LFLAGS) $(AOUT_FLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
LINK_LIB.CC     = $(CCC) $(LFLAGS) $(SHARED_FLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
PREPROCESS.CC   = $(CC_COMPILE) -E
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
# Effect of REMOVE_TARGET is to delete out-of-date files during "gnumake -k".
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
REMOVE_TARGET   = rm -f $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
# Synonyms.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
COMPILE.cpp     = $(COMPILE.CC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
GENASM.cpp      = $(GENASM.CC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
LINK.cpp        = $(LINK.CC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
LINK_LIB.cpp    = $(LINK_LIB.CC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
PREPROCESS.cpp  = $(PREPROCESS.CC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
# Note use of ALT_BOOTDIR to explicitly specify location of java and
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
# javac; this is the same environment variable used in the J2SE build
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
# process for overriding the default spec, which is BOOTDIR.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
# Note also that we fall back to using JAVA_HOME if neither of these is
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
# specified.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
ifdef ALT_BOOTDIR
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
RUN.JAVA  = $(ALT_BOOTDIR)/bin/java
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
RUN.JAVAP = $(ALT_BOOTDIR)/bin/javap
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
RUN.JAVAH = $(ALT_BOOTDIR)/bin/javah
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
RUN.JAR   = $(ALT_BOOTDIR)/bin/jar
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
COMPILE.JAVAC = $(ALT_BOOTDIR)/bin/javac
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
COMPILE.RMIC = $(ALT_BOOTDIR)/bin/rmic
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
BOOT_JAVA_HOME = $(ALT_BOOTDIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
ifdef BOOTDIR
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
RUN.JAVA  = $(BOOTDIR)/bin/java
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
RUN.JAVAP = $(BOOTDIR)/bin/javap
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
RUN.JAVAH = $(BOOTDIR)/bin/javah
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
RUN.JAR   = $(BOOTDIR)/bin/jar
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
COMPILE.JAVAC = $(BOOTDIR)/bin/javac
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
COMPILE.RMIC  = $(BOOTDIR)/bin/rmic
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
BOOT_JAVA_HOME = $(BOOTDIR)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
ifdef JAVA_HOME
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
RUN.JAVA  = $(JAVA_HOME)/bin/java
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
RUN.JAVAP = $(JAVA_HOME)/bin/javap
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
RUN.JAVAH = $(JAVA_HOME)/bin/javah
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
RUN.JAR   = $(JAVA_HOME)/bin/jar
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
COMPILE.JAVAC = $(JAVA_HOME)/bin/javac
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
COMPILE.RMIC  = $(JAVA_HOME)/bin/rmic
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
BOOT_JAVA_HOME = $(JAVA_HOME)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
# take from the PATH, if ALT_BOOTDIR, BOOTDIR and JAVA_HOME are not defined
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
# note that this is to support hotspot build without SA. To build
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
# SA along with hotspot, you need to define ALT_BOOTDIR, BOOTDIR or JAVA_HOME
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
RUN.JAVA  = java
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
RUN.JAVAP = javap
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
RUN.JAVAH = javah
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
RUN.JAR   = jar
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
COMPILE.JAVAC = javac
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
COMPILE.RMIC  = rmic
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
SUM = /usr/bin/sum
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
# 'gmake MAKE_VERBOSE=y' gives all the gory details.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
QUIETLY$(MAKE_VERBOSE)  = @
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
RUN.JAR$(MAKE_VERBOSE) += >/dev/null
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
# With parallel makes, print a message at the end of compilation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
ifeq    ($(findstring j,$(MFLAGS)),j)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
COMPILE_DONE    = && { echo Done with $<; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
# A list of directories under which all source code are built without -KPIC/-Kpic
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
# flag. Performance measurements show that compiling GC related code will
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
# dramatically reduce the gc pause time. See bug 6454213 for more details.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
include $(GAMMADIR)/make/scm.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
NONPIC_DIRS  = memory oops gc_implementation gc_interface 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
NONPIC_DIRS  := $(foreach dir,$(NONPIC_DIRS), $(GAMMADIR)/src/share/vm/$(dir))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
# Look for source code under NONPIC_DIRS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
NONPIC_FILES := $(foreach dir,$(NONPIC_DIRS),\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
                 $(shell find $(dir) \( $(SCM_DIRS) \) -prune -o \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
		  -name '*.cpp' -print))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
NONPIC_OBJ_FILES := $(notdir $(subst .cpp,.o,$(NONPIC_FILES)))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
# Sun compiler for 64 bit Solaris does not support building non-PIC object files.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
ifdef LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
%.o: %.cpp
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
	@echo Compiling $<
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
	$(QUIETLY) $(REMOVE_TARGET)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
	$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
%.o: %.cpp
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
	@echo Compiling $<
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
	$(QUIETLY) $(REMOVE_TARGET)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
	$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
         $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
         $(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
%.o: %.s
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
	@echo Assembling $<
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
	$(QUIETLY) $(REMOVE_TARGET)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
	$(QUIETLY) $(AS.S) -o $@ $< $(COMPILE_DONE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
%.s: %.cpp
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
	@echo Generating assembly for $<
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
	$(QUIETLY) $(GENASM.CC) -o $@ $<
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
	$(QUIETLY) $(DEMANGLE) $(COMPILE_DONE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
# Intermediate files (for debugging macros)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
%.i: %.cpp
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
	@echo Preprocessing $< to $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
	$(QUIETLY) $(PREPROCESS.CC) $< > $@ $(COMPILE_DONE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
#  Override gnumake built-in rules which do sccs get operations badly.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
#  (They put the checked out code in the current directory, not in the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
#  directory of the original file.)  Since this is a symptom of a teamware
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
#  failure, and since not all problems can be detected by gnumake due
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
#  to incomplete dependency checking... just complain and stop.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
%:: s.%
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
	@echo "========================================================="
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
	@echo File $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
	@echo is out of date with respect to its SCCS file.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
	@echo This file may be from an unresolved Teamware conflict.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
	@echo This is also a symptom of a Teamware bringover/putback failure
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
	@echo in which SCCS files are updated but not checked out.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
	@echo Check for other out of date files in your workspace.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
	@echo "========================================================="
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
	@exit 666
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
%:: SCCS/s.%
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
	@echo "========================================================="
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
	@echo File $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
	@echo is out of date with respect to its SCCS file.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
	@echo This file may be from an unresolved Teamware conflict.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
	@echo This is also a symptom of a Teamware bringover/putback failure
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
	@echo in which SCCS files are updated but not checked out.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
	@echo Check for other out of date files in your workspace.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
	@echo "========================================================="
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
	@exit 666
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
.PHONY: default