1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/solaris/makefiles/adlc.make Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,217 @@ 1.4 +# 1.5 +# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. 1.11 +# 1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 +# version 2 for more details (a copy is included in the LICENSE file that 1.16 +# accompanied this code). 1.17 +# 1.18 +# You should have received a copy of the GNU General Public License version 1.19 +# 2 along with this work; if not, write to the Free Software Foundation, 1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 +# 1.22 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.23 +# CA 95054 USA or visit www.sun.com if you need additional information or 1.24 +# have any questions. 1.25 +# 1.26 +# 1.27 + 1.28 +# This makefile (adlc.make) is included from the adlc.make in the 1.29 +# build directories. 1.30 +# It knows how to compile, link, and run the adlc. 1.31 + 1.32 +include $(GAMMADIR)/build/$(Platform_os_family)/makefiles/rules.make 1.33 + 1.34 +# ######################################################################### 1.35 + 1.36 +# OUTDIR must be the same as AD_Dir = $(GENERATED)/adfiles in top.make: 1.37 +GENERATED = ../generated 1.38 +OUTDIR = $(GENERATED)/adfiles 1.39 + 1.40 +ARCH = $(Platform_arch) 1.41 +OS = $(Platform_os_family) 1.42 + 1.43 +SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad 1.44 + 1.45 +SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ 1.46 + $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 1.47 + 1.48 +Src_Dirs += $(GAMMADIR)/src/share/vm/adlc 1.49 + 1.50 +EXEC = $(OUTDIR)/adlc 1.51 + 1.52 +# set VPATH so make knows where to look for source files 1.53 +Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls 1.54 +VPATH += $(Src_Dirs_V:%=%:) 1.55 + 1.56 +# set INCLUDES for C preprocessor 1.57 +Src_Dirs_I = ${Src_Dirs} $(GENERATED) 1.58 +INCLUDES += $(Src_Dirs_I:%=-I%) 1.59 + 1.60 +# Force assertions on. 1.61 +SYSDEFS += -DASSERT 1.62 +CPPFLAGS = $(SYSDEFS) $(INCLUDES) 1.63 + 1.64 +ifndef USE_GCC 1.65 + # We need libCstd.so for adlc 1.66 + CFLAGS += -library=Cstd -g 1.67 + LFLAGS += -library=Cstd -g 1.68 +endif 1.69 + 1.70 +# CFLAGS_WARN holds compiler options to suppress/enable warnings. 1.71 +CFLAGS += $(CFLAGS_WARN) 1.72 + 1.73 +ifeq ("${Platform_compiler}", "sparcWorks") 1.74 +# Enable the following CFLAGS addition if you need to compare the 1.75 +# built ELF objects. 1.76 +# 1.77 +# The -g option makes static data global and the "-Qoption ccfe 1.78 +# -xglobalstatic" option tells the compiler to not globalize static 1.79 +# data using a unique globalization prefix. Instead force the use 1.80 +# of a static globalization prefix based on the source filepath so 1.81 +# the objects from two identical compilations are the same. 1.82 +#CFLAGS += -Qoption ccfe -xglobalstatic 1.83 +endif # Platform_compiler == sparcWorks 1.84 + 1.85 +OBJECTNAMES = \ 1.86 + adlparse.o \ 1.87 + archDesc.o \ 1.88 + arena.o \ 1.89 + dfa.o \ 1.90 + dict2.o \ 1.91 + filebuff.o \ 1.92 + forms.o \ 1.93 + formsopt.o \ 1.94 + formssel.o \ 1.95 + main.o \ 1.96 + adlc-opcodes.o \ 1.97 + output_c.o \ 1.98 + output_h.o \ 1.99 + 1.100 +OBJECTS = $(OBJECTNAMES:%=$(OUTDIR)/%) 1.101 + 1.102 +GENERATEDNAMES = \ 1.103 + ad_$(Platform_arch_model).cpp \ 1.104 + ad_$(Platform_arch_model).hpp \ 1.105 + ad_$(Platform_arch_model)_clone.cpp \ 1.106 + ad_$(Platform_arch_model)_expand.cpp \ 1.107 + ad_$(Platform_arch_model)_format.cpp \ 1.108 + ad_$(Platform_arch_model)_gen.cpp \ 1.109 + ad_$(Platform_arch_model)_misc.cpp \ 1.110 + ad_$(Platform_arch_model)_peephole.cpp \ 1.111 + ad_$(Platform_arch_model)_pipeline.cpp \ 1.112 + adGlobals_$(Platform_arch_model).hpp \ 1.113 + dfa_$(Platform_arch_model).cpp \ 1.114 + 1.115 +GENERATEDFILES = $(GENERATEDNAMES:%=$(OUTDIR)/%) 1.116 + 1.117 +# ######################################################################### 1.118 + 1.119 +all: $(EXEC) 1.120 + 1.121 +$(EXEC) : $(OBJECTS) 1.122 + @echo Making adlc 1.123 + $(QUIETLY) $(LINK_NOPROF.CC) -o $(EXEC) $(OBJECTS) 1.124 + 1.125 +# Random dependencies: 1.126 +$(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 1.127 + 1.128 +# The source files refer to ostream.h, which sparcworks calls iostream.h 1.129 +$(OBJECTS): ostream.h 1.130 + 1.131 +ostream.h : 1.132 + @echo >$@ '#include <iostream.h>' 1.133 + 1.134 +dump: 1.135 + : OUTDIR=$(OUTDIR) 1.136 + : OBJECTS=$(OBJECTS) 1.137 + : products = $(GENERATEDFILES) 1.138 + 1.139 +all: $(GENERATEDFILES) 1.140 + 1.141 +$(GENERATEDFILES): refresh_adfiles 1.142 + 1.143 +# Get a unique temporary directory name, so multiple makes can run in parallel. 1.144 +# Note that product files are updated via "mv", which is atomic. 1.145 +TEMPDIR := $(OUTDIR)/mktmp$(shell echo $$$$) 1.146 + 1.147 +ADLCFLAGS = -q -T 1.148 + 1.149 +ifdef LP64 1.150 +ADLCFLAGS += -D_LP64 1.151 +else 1.152 +ADLCFLAGS += -U_LP64 1.153 +endif 1.154 + 1.155 +# 1.156 +# adlc_updater is a simple sh script, under sccs control. It is 1.157 +# used to selectively update generated adlc files. This should 1.158 +# provide a nice compilation speed improvement. 1.159 +# 1.160 +ADLC_UPDATER_DIRECTORY = $(GAMMADIR)/build/$(OS) 1.161 +ADLC_UPDATER = adlc_updater 1.162 + 1.163 +# This action refreshes all generated adlc files simultaneously. 1.164 +# The way it works is this: 1.165 +# 1) create a scratch directory to work in. 1.166 +# 2) if the current working directory does not have $(ADLC_UPDATER), copy it. 1.167 +# 3) run the compiled adlc executable. This will create new adlc files in the scratch directory. 1.168 +# 4) call $(ADLC_UPDATER) on each generated adlc file. It will selectively update changed or missing files. 1.169 +# 5) If we actually updated any files, echo a notice. 1.170 +# 1.171 +refresh_adfiles: $(EXEC) $(SOURCE.AD) 1.172 + @rm -rf $(TEMPDIR); mkdir $(TEMPDIR) 1.173 + $(QUIETLY) [ -f $(ADLC_UPDATER) ] || ( cp $(ADLC_UPDATER_DIRECTORY)/$(ADLC_UPDATER) . ; chmod +x $(ADLC_UPDATER) ) 1.174 + $(QUIETLY) $(EXEC) $(ADLCFLAGS) $(SOURCE.AD) \ 1.175 + -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 \ 1.176 + || { rm -rf $(TEMPDIR); exit 1; } 1.177 + $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR) 1.178 + $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR) 1.179 + $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_clone.cpp $(TEMPDIR) $(OUTDIR) 1.180 + $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_expand.cpp $(TEMPDIR) $(OUTDIR) 1.181 + $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_format.cpp $(TEMPDIR) $(OUTDIR) 1.182 + $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_gen.cpp $(TEMPDIR) $(OUTDIR) 1.183 + $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_misc.cpp $(TEMPDIR) $(OUTDIR) 1.184 + $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_peephole.cpp $(TEMPDIR) $(OUTDIR) 1.185 + $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_pipeline.cpp $(TEMPDIR) $(OUTDIR) 1.186 + $(QUIETLY) ./$(ADLC_UPDATER) adGlobals_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR) 1.187 + $(QUIETLY) ./$(ADLC_UPDATER) dfa_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR) 1.188 + $(QUIETLY) [ -f $(TEMPDIR)/made-change ] \ 1.189 + || echo "Rescanned $(SOURCE.AD) but encountered no changes." 1.190 + $(QUIETLY) rm -rf $(TEMPDIR) 1.191 + 1.192 + 1.193 +# ######################################################################### 1.194 + 1.195 +$(SOURCE.AD): $(SOURCES.AD) 1.196 + $(QUIETLY) cat $(SOURCES.AD) > $(SOURCE.AD) 1.197 + 1.198 +$(OUTDIR)/%.o: %.cpp 1.199 + @echo Compiling $< 1.200 + $(QUIETLY) $(REMOVE_TARGET) 1.201 + $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE) 1.202 + 1.203 +# Some object files are given a prefix, to disambiguate 1.204 +# them from objects of the same name built for the VM. 1.205 +$(OUTDIR)/adlc-%.o: %.cpp 1.206 + @echo Compiling $< 1.207 + $(QUIETLY) $(REMOVE_TARGET) 1.208 + $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE) 1.209 + 1.210 +# ######################################################################### 1.211 + 1.212 +clean : 1.213 + rm $(OBJECTS) 1.214 + 1.215 +cleanall : 1.216 + rm $(OBJECTS) $(EXEC) 1.217 + 1.218 +# ######################################################################### 1.219 + 1.220 +.PHONY: all dump refresh_adfiles clean cleanall