## Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.## This code is free software; you can redistribute it and/or modify it# under the terms of the GNU General Public License version 2 only, as# published by the Free Software Foundation.## 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,# CA 95054 USA or visit www.sun.com if you need additional information or# have any questions.# ## Common rules/macros for the vm, adlc.# Tell make that .cpp is important.SUFFIXES: .cpp $(SUFFIXES)# For now. Other makefiles use CPP as the c++ compiler, but that should really# name the preprocessor.ifeq ($(CCC),)CCC = $(CPP)endifDEMANGLER = c++filtDEMANGLE = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@# $(CC) is the c compiler (cc/gcc), $(CCC) is the c++ compiler (CC/g++).C_COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS)CC_COMPILE = $(CCC) $(CPPFLAGS) $(CFLAGS)AS.S = $(AS) $(ASFLAGS)COMPILE.c = $(C_COMPILE) -cGENASM.c = $(C_COMPILE) -SLINK.c = $(CC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS)LINK_LIB.c = $(CC) $(LFLAGS) $(SHARED_FLAG)PREPROCESS.c = $(C_COMPILE) -ECOMPILE.CC = $(CC_COMPILE) -cGENASM.CC = $(CC_COMPILE) -SLINK.CC = $(CCC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS)LINK_NOPROF.CC = $(CCC) $(LFLAGS) $(AOUT_FLAGS)LINK_LIB.CC = $(CCC) $(LFLAGS) $(SHARED_FLAG)PREPROCESS.CC = $(CC_COMPILE) -E# Effect of REMOVE_TARGET is to delete out-of-date files during "gnumake -k".REMOVE_TARGET = rm -f $@# Synonyms.COMPILE.cpp = $(COMPILE.CC)GENASM.cpp = $(GENASM.CC)LINK.cpp = $(LINK.CC)LINK_LIB.cpp = $(LINK_LIB.CC)PREPROCESS.cpp = $(PREPROCESS.CC)# Note use of ALT_BOOTDIR to explicitly specify location of java and# javac; this is the same environment variable used in the J2SE build# process for overriding the default spec, which is BOOTDIR.# Note also that we fall back to using JAVA_HOME if neither of these is# specified.ifdef ALT_BOOTDIRRUN.JAVA = $(ALT_BOOTDIR)/bin/javaRUN.JAVAP = $(ALT_BOOTDIR)/bin/javapRUN.JAVAH = $(ALT_BOOTDIR)/bin/javahRUN.JAR = $(ALT_BOOTDIR)/bin/jarCOMPILE.JAVAC = $(ALT_BOOTDIR)/bin/javacCOMPILE.RMIC = $(ALT_BOOTDIR)/bin/rmicBOOT_JAVA_HOME = $(ALT_BOOTDIR)elseifdef BOOTDIRRUN.JAVA = $(BOOTDIR)/bin/javaRUN.JAVAP = $(BOOTDIR)/bin/javapRUN.JAVAH = $(BOOTDIR)/bin/javahRUN.JAR = $(BOOTDIR)/bin/jarCOMPILE.JAVAC = $(BOOTDIR)/bin/javacCOMPILE.RMIC = $(BOOTDIR)/bin/rmicBOOT_JAVA_HOME = $(BOOTDIR)elseifdef JAVA_HOMERUN.JAVA = $(JAVA_HOME)/bin/javaRUN.JAVAP = $(JAVA_HOME)/bin/javapRUN.JAVAH = $(JAVA_HOME)/bin/javahRUN.JAR = $(JAVA_HOME)/bin/jarCOMPILE.JAVAC = $(JAVA_HOME)/bin/javacCOMPILE.RMIC = $(JAVA_HOME)/bin/rmicBOOT_JAVA_HOME = $(JAVA_HOME)else# take from the PATH, if ALT_BOOTDIR, BOOTDIR and JAVA_HOME are not defined# note that this is to support hotspot build without SA. To build# SA along with hotspot, you need to define ALT_BOOTDIR, BOOTDIR or JAVA_HOMERUN.JAVA = javaRUN.JAVAP = javapRUN.JAVAH = javahRUN.JAR = jarCOMPILE.JAVAC = javacCOMPILE.RMIC = rmicendifendifendifSUM = /usr/bin/sum# 'gmake MAKE_VERBOSE=y' gives all the gory details.QUIETLY$(MAKE_VERBOSE) = @RUN.JAR$(MAKE_VERBOSE) += >/dev/null# With parallel makes, print a message at the end of compilation.ifeq ($(findstring j,$(MFLAGS)),j)COMPILE_DONE = && { echo Done with $<; }endif# A list of directories under which all source code are built without -KPIC/-Kpic# flag. Performance measurements show that compiling GC related code will# dramatically reduce the gc pause time. See bug 6454213 for more details.include $(GAMMADIR)/make/scm.makeNONPIC_DIRS = memory oops gc_implementation gc_interface NONPIC_DIRS := $(foreach dir,$(NONPIC_DIRS), $(GAMMADIR)/src/share/vm/$(dir))# Look for source code under NONPIC_DIRSNONPIC_FILES := $(foreach dir,$(NONPIC_DIRS),\ $(shell find $(dir) \( $(SCM_DIRS) \) -prune -o \ -name '*.cpp' -print))NONPIC_OBJ_FILES := $(notdir $(subst .cpp,.o,$(NONPIC_FILES)))# Sun compiler for 64 bit Solaris does not support building non-PIC object files.ifdef LP64%.o: %.cpp @echo Compiling $< $(QUIETLY) $(REMOVE_TARGET) $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)else%.o: %.cpp @echo Compiling $< $(QUIETLY) $(REMOVE_TARGET) $(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \ $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \ $(COMPILE.CC) -o $@ $< $(COMPILE_DONE))endif%.o: %.s @echo Assembling $< $(QUIETLY) $(REMOVE_TARGET) $(QUIETLY) $(AS.S) -o $@ $< $(COMPILE_DONE)%.s: %.cpp @echo Generating assembly for $< $(QUIETLY) $(GENASM.CC) -o $@ $< $(QUIETLY) $(DEMANGLE) $(COMPILE_DONE)# Intermediate files (for debugging macros)%.i: %.cpp @echo Preprocessing $< to $@ $(QUIETLY) $(PREPROCESS.CC) $< > $@ $(COMPILE_DONE)# Override gnumake built-in rules which do sccs get operations badly.# (They put the checked out code in the current directory, not in the# directory of the original file.) Since this is a symptom of a teamware# failure, and since not all problems can be detected by gnumake due# to incomplete dependency checking... just complain and stop.%:: s.% @echo "=========================================================" @echo File $@ @echo is out of date with respect to its SCCS file. @echo This file may be from an unresolved Teamware conflict. @echo This is also a symptom of a Teamware bringover/putback failure @echo in which SCCS files are updated but not checked out. @echo Check for other out of date files in your workspace. @echo "=========================================================" @exit 666%:: SCCS/s.% @echo "=========================================================" @echo File $@ @echo is out of date with respect to its SCCS file. @echo This file may be from an unresolved Teamware conflict. @echo This is also a symptom of a Teamware bringover/putback failure @echo in which SCCS files are updated but not checked out. @echo Check for other out of date files in your workspace. @echo "=========================================================" @exit 666.PHONY: default