Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/aix/makefiles/adlc.make
32284 views
#1# Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#22#2324# This makefile (adlc.make) is included from the adlc.make in the25# build directories.26# It knows how to compile, link, and run the adlc.2728include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/rules.make2930# #########################################################################3132# OUTDIR must be the same as AD_Dir = $(GENERATED)/adfiles in top.make:33GENERATED = ../generated34OUTDIR = $(GENERATED)/adfiles3536ARCH = $(Platform_arch)37OS = $(Platform_os_family)3839SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad4041ifeq ("${Platform_arch_model}", "${Platform_arch}")42SOURCES.AD = \43$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad)44else45SOURCES.AD = \46$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \47$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad)48endif4950EXEC = $(OUTDIR)/adlc5152# set VPATH so make knows where to look for source files53Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc54VPATH += $(Src_Dirs_V:%=%:)5556# set INCLUDES for C preprocessor57Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED)58INCLUDES += $(Src_Dirs_I:%=-I%)5960# set flags for adlc compilation61CXXFLAGS = $(SYSDEFS) $(INCLUDES)6263# Force assertions on.64CXXFLAGS += -DASSERT6566# CFLAGS_WARN holds compiler options to suppress/enable warnings.67# Suppress warnings (for now)68CFLAGS_WARN = -w69CFLAGS += $(CFLAGS_WARN)7071OBJECTNAMES = \72adlparse.o \73archDesc.o \74arena.o \75dfa.o \76dict2.o \77filebuff.o \78forms.o \79formsopt.o \80formssel.o \81main.o \82adlc-opcodes.o \83output_c.o \84output_h.o \8586OBJECTS = $(OBJECTNAMES:%=$(OUTDIR)/%)8788GENERATEDNAMES = \89ad_$(Platform_arch_model).cpp \90ad_$(Platform_arch_model).hpp \91ad_$(Platform_arch_model)_clone.cpp \92ad_$(Platform_arch_model)_expand.cpp \93ad_$(Platform_arch_model)_format.cpp \94ad_$(Platform_arch_model)_gen.cpp \95ad_$(Platform_arch_model)_misc.cpp \96ad_$(Platform_arch_model)_peephole.cpp \97ad_$(Platform_arch_model)_pipeline.cpp \98adGlobals_$(Platform_arch_model).hpp \99dfa_$(Platform_arch_model).cpp \100101GENERATEDFILES = $(GENERATEDNAMES:%=$(OUTDIR)/%)102103# #########################################################################104105all: $(EXEC)106107$(EXEC) : $(OBJECTS)108@echo Making adlc109$(QUIETLY) $(HOST.LINK_NOPROF.CXX) -o $(EXEC) $(OBJECTS)110111# Random dependencies:112$(OBJECTS): opcodes.hpp classes.hpp adlc.hpp adlcVMDeps.hpp adlparse.hpp archDesc.hpp arena.hpp dict2.hpp filebuff.hpp forms.hpp formsopt.hpp formssel.hpp113114# The source files refer to ostream.h, which sparcworks calls iostream.h115$(OBJECTS): ostream.h116117ostream.h :118@echo >$@ '#include <iostream.h>'119120dump:121: OUTDIR=$(OUTDIR)122: OBJECTS=$(OBJECTS)123: products = $(GENERATEDFILES)124125all: $(GENERATEDFILES)126127$(GENERATEDFILES): refresh_adfiles128129# Get a unique temporary directory name, so multiple makes can run in parallel.130# Note that product files are updated via "mv", which is atomic.131TEMPDIR := $(OUTDIR)/mktmp$(shell echo $$$$)132133# Debuggable by default134CFLAGS += -g135136# Pass -D flags into ADLC.137ADLCFLAGS += $(SYSDEFS)138139# Note "+="; it is a hook so flags.make can add more flags, like -g or -DFOO.140ADLCFLAGS += -q -T141142ADLCFLAGS += -g143144ifdef LP64145ADLCFLAGS += -D_LP64146else147ADLCFLAGS += -U_LP64148endif149150#151# adlc_updater is a simple sh script, under sccs control. It is152# used to selectively update generated adlc files. This should153# provide a nice compilation speed improvement.154#155ADLC_UPDATER_DIRECTORY = $(GAMMADIR)/make/$(OS)156ADLC_UPDATER = adlc_updater157$(ADLC_UPDATER): $(ADLC_UPDATER_DIRECTORY)/$(ADLC_UPDATER)158$(QUIETLY) cp $< $@; chmod +x $@159160# 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#168refresh_adfiles: $(EXEC) $(SOURCE.AD) $(ADLC_UPDATER)169@rm -rf $(TEMPDIR); mkdir $(TEMPDIR)170$(QUIETLY) $(EXEC) $(ADLCFLAGS) $(SOURCE.AD) \171-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 \172|| { rm -rf $(TEMPDIR); exit 1; }173$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)174$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)175$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_clone.cpp $(TEMPDIR) $(OUTDIR)176$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_expand.cpp $(TEMPDIR) $(OUTDIR)177$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_format.cpp $(TEMPDIR) $(OUTDIR)178$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_gen.cpp $(TEMPDIR) $(OUTDIR)179$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_misc.cpp $(TEMPDIR) $(OUTDIR)180$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_peephole.cpp $(TEMPDIR) $(OUTDIR)181$(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_pipeline.cpp $(TEMPDIR) $(OUTDIR)182$(QUIETLY) ./$(ADLC_UPDATER) adGlobals_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)183$(QUIETLY) ./$(ADLC_UPDATER) dfa_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)184$(QUIETLY) [ -f $(TEMPDIR)/made-change ] \185|| echo "Rescanned $(SOURCE.AD) but encountered no changes."186$(QUIETLY) rm -rf $(TEMPDIR)187188189# #########################################################################190191$(SOURCE.AD): $(SOURCES.AD)192$(QUIETLY) $(PROCESS_AD_FILES) $(SOURCES.AD) > $(SOURCE.AD)193194#PROCESS_AD_FILES = cat195# Pass through #line directives, in case user enables -g option above:196PROCESS_AD_FILES = awk '{ \197if (CUR_FN != FILENAME) { CUR_FN=FILENAME; NR_BASE=NR-1; need_lineno=1 } \198if (need_lineno && $$0 !~ /\/\//) \199{ print "\n\n\#line " (NR-NR_BASE) " \"" FILENAME "\""; need_lineno=0 }; \200print }'201202$(OUTDIR)/%.o: %.cpp203@echo Compiling $<204$(QUIETLY) $(REMOVE_TARGET)205$(QUIETLY) $(HOST.COMPILE.CXX) -o $@ $< $(COMPILE_DONE)206207# Some object files are given a prefix, to disambiguate208# them from objects of the same name built for the VM.209$(OUTDIR)/adlc-%.o: %.cpp210@echo Compiling $<211$(QUIETLY) $(REMOVE_TARGET)212$(QUIETLY) $(HOST.COMPILE.CXX) -o $@ $< $(COMPILE_DONE)213214# #########################################################################215216clean:217rm $(OBJECTS)218219cleanall:220rm $(OBJECTS) $(EXEC)221222# #########################################################################223224.PHONY: all dump refresh_adfiles clean cleanall225226227