build/solaris/makefiles/adlc.make

Wed, 02 Apr 2008 12:09:59 -0700

author
jrose
date
Wed, 02 Apr 2008 12:09:59 -0700
changeset 535
c7c777385a15
parent 435
a61af66fc99e
permissions
-rw-r--r--

6667042: PrintAssembly option does not work without special plugin
Summary: remove old private plugin interface, simplify, rework old plugin to use unchanged Gnu sources
Reviewed-by: kvn, rasbold

     1 #
     2 # Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.
     8 #
     9 # This code is distributed in the hope that it will be useful, but WITHOUT
    10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    12 # version 2 for more details (a copy is included in the LICENSE file that
    13 # accompanied this code).
    14 #
    15 # You should have received a copy of the GNU General Public License version
    16 # 2 along with this work; if not, write to the Free Software Foundation,
    17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    18 #
    19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20 # CA 95054 USA or visit www.sun.com if you need additional information or
    21 # have any questions.
    22 #  
    23 #
    25 # This makefile (adlc.make) is included from the adlc.make in the
    26 # build directories.
    27 # It knows how to compile, link, and run the adlc.
    29 include $(GAMMADIR)/build/$(Platform_os_family)/makefiles/rules.make
    31 # #########################################################################
    33 # OUTDIR must be the same as AD_Dir = $(GENERATED)/adfiles in top.make:
    34 GENERATED = ../generated
    35 OUTDIR  = $(GENERATED)/adfiles
    37 ARCH = $(Platform_arch)
    38 OS = $(Platform_os_family)
    40 SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad 
    42 SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
    43 	     $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 
    45 Src_Dirs += $(GAMMADIR)/src/share/vm/adlc
    47 EXEC	= $(OUTDIR)/adlc
    49 # set VPATH so make knows where to look for source files
    50 Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls
    51 VPATH    += $(Src_Dirs_V:%=%:)
    53 # set INCLUDES for C preprocessor
    54 Src_Dirs_I = ${Src_Dirs} $(GENERATED)
    55 INCLUDES += $(Src_Dirs_I:%=-I%)
    57 # Force assertions on.
    58 SYSDEFS += -DASSERT
    59 CPPFLAGS = $(SYSDEFS) $(INCLUDES)
    61 ifndef USE_GCC
    62   # We need libCstd.so for adlc 
    63   CFLAGS += -library=Cstd -g
    64   LFLAGS += -library=Cstd -g
    65 endif
    67 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
    68 CFLAGS += $(CFLAGS_WARN)
    70 ifeq ("${Platform_compiler}", "sparcWorks")
    71 # Enable the following CFLAGS addition if you need to compare the
    72 # built ELF objects.
    73 #
    74 # The -g option makes static data global and the "-Qoption ccfe
    75 # -xglobalstatic" option tells the compiler to not globalize static
    76 # data using a unique globalization prefix. Instead force the use
    77 # of a static globalization prefix based on the source filepath so
    78 # the objects from two identical compilations are the same.
    79 #CFLAGS += -Qoption ccfe -xglobalstatic
    80 endif # Platform_compiler == sparcWorks
    82 OBJECTNAMES = \
    83 	adlparse.o \
    84 	archDesc.o \
    85 	arena.o \
    86 	dfa.o \
    87 	dict2.o \
    88 	filebuff.o \
    89 	forms.o \
    90 	formsopt.o \
    91 	formssel.o \
    92 	main.o \
    93 	adlc-opcodes.o \
    94 	output_c.o \
    95 	output_h.o \
    97 OBJECTS = $(OBJECTNAMES:%=$(OUTDIR)/%)
    99 GENERATEDNAMES = \
   100         ad_$(Platform_arch_model).cpp \
   101         ad_$(Platform_arch_model).hpp \
   102         ad_$(Platform_arch_model)_clone.cpp \
   103         ad_$(Platform_arch_model)_expand.cpp \
   104         ad_$(Platform_arch_model)_format.cpp \
   105         ad_$(Platform_arch_model)_gen.cpp \
   106         ad_$(Platform_arch_model)_misc.cpp \
   107         ad_$(Platform_arch_model)_peephole.cpp \
   108         ad_$(Platform_arch_model)_pipeline.cpp \
   109         adGlobals_$(Platform_arch_model).hpp \
   110         dfa_$(Platform_arch_model).cpp \
   112 GENERATEDFILES = $(GENERATEDNAMES:%=$(OUTDIR)/%)
   114 # #########################################################################
   116 all: $(EXEC)
   118 $(EXEC) : $(OBJECTS)
   119 	@echo Making adlc
   120 	$(QUIETLY) $(LINK_NOPROF.CC) -o $(EXEC) $(OBJECTS)
   122 # Random dependencies:
   123 $(OBJECTS): opcodes.hpp classes.hpp adlc.hpp adlcVMDeps.hpp adlparse.hpp archDesc.hpp arena.hpp dict2.hpp filebuff.hpp forms.hpp formsopt.hpp formssel.hpp
   125 # The source files refer to ostream.h, which sparcworks calls iostream.h
   126 $(OBJECTS): ostream.h
   128 ostream.h :
   129 	@echo >$@ '#include <iostream.h>'
   131 dump:
   132 	: OUTDIR=$(OUTDIR)
   133 	: OBJECTS=$(OBJECTS)
   134 	: products = $(GENERATEDFILES)
   136 all: $(GENERATEDFILES)
   138 $(GENERATEDFILES): refresh_adfiles
   140 # Get a unique temporary directory name, so multiple makes can run in parallel.
   141 # Note that product files are updated via "mv", which is atomic.
   142 TEMPDIR := $(OUTDIR)/mktmp$(shell echo $$$$)
   144 ADLCFLAGS = -q -T
   146 ifdef LP64
   147 ADLCFLAGS += -D_LP64
   148 else
   149 ADLCFLAGS += -U_LP64
   150 endif
   152 #
   153 # adlc_updater is a simple sh script, under sccs control. It is
   154 # used to selectively update generated adlc files. This should
   155 # provide a nice compilation speed improvement.
   156 #
   157 ADLC_UPDATER_DIRECTORY = $(GAMMADIR)/build/$(OS)
   158 ADLC_UPDATER = adlc_updater
   160 # This action refreshes all generated adlc files simultaneously.
   161 # The way it works is this:
   162 # 1) create a scratch directory to work in.
   163 # 2) if the current working directory does not have $(ADLC_UPDATER), copy it.
   164 # 3) run the compiled adlc executable. This will create new adlc files in the scratch directory.
   165 # 4) call $(ADLC_UPDATER) on each generated adlc file. It will selectively update changed or missing files.
   166 # 5) If we actually updated any files, echo a notice.
   167 #
   168 refresh_adfiles: $(EXEC) $(SOURCE.AD)
   169 	@rm -rf $(TEMPDIR); mkdir $(TEMPDIR)
   170 	$(QUIETLY) [ -f $(ADLC_UPDATER) ] || ( cp $(ADLC_UPDATER_DIRECTORY)/$(ADLC_UPDATER) . ; chmod +x $(ADLC_UPDATER) )
   171 	$(QUIETLY) $(EXEC) $(ADLCFLAGS) $(SOURCE.AD) \
   172  -c$(TEMPDIR)/ad_$(Platform_arch_model).cpp -h$(TEMPDIR)/ad_$(Platform_arch_model).hpp -a$(TEMPDIR)/dfa_$(Platform_arch_model).cpp -v$(TEMPDIR)/adGlobals_$(Platform_arch_model).hpp \
   173 	    || { rm -rf $(TEMPDIR); exit 1; }
   174 	$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
   175 	$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
   176 	$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_clone.cpp $(TEMPDIR) $(OUTDIR)
   177 	$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_expand.cpp $(TEMPDIR) $(OUTDIR)
   178 	$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_format.cpp $(TEMPDIR) $(OUTDIR)
   179 	$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_gen.cpp $(TEMPDIR) $(OUTDIR)
   180 	$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_misc.cpp $(TEMPDIR) $(OUTDIR)
   181 	$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_peephole.cpp $(TEMPDIR) $(OUTDIR)
   182 	$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_pipeline.cpp $(TEMPDIR) $(OUTDIR)
   183 	$(QUIETLY) ./$(ADLC_UPDATER) adGlobals_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
   184 	$(QUIETLY) ./$(ADLC_UPDATER) dfa_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
   185 	$(QUIETLY) [ -f $(TEMPDIR)/made-change ] \
   186 		|| echo "Rescanned $(SOURCE.AD) but encountered no changes."
   187 	$(QUIETLY) rm -rf $(TEMPDIR)
   190 # #########################################################################
   192 $(SOURCE.AD): $(SOURCES.AD)
   193 	$(QUIETLY) cat $(SOURCES.AD) > $(SOURCE.AD)
   195 $(OUTDIR)/%.o: %.cpp
   196 	@echo Compiling $<
   197 	$(QUIETLY) $(REMOVE_TARGET)
   198 	$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
   200 # Some object files are given a prefix, to disambiguate
   201 # them from objects of the same name built for the VM.
   202 $(OUTDIR)/adlc-%.o: %.cpp
   203 	@echo Compiling $<
   204 	$(QUIETLY) $(REMOVE_TARGET)
   205 	$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
   207 # #########################################################################
   209 clean	:
   210 	rm $(OBJECTS)
   212 cleanall :
   213 	rm $(OBJECTS) $(EXEC)
   215 # #########################################################################
   217 .PHONY: all dump refresh_adfiles clean cleanall

mercurial