4632N/A# Copyright (c) 1999, 2009, Oracle
and/or its affiliates. All rights reserved.
4632N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4632N/A# This code is free software; you can redistribute it
and/or modify it
4632N/A# under the terms of the GNU General Public License version 2 only, as
4632N/A# published by the Free Software Foundation.
4632N/A# This code is distributed in the hope that it will be useful, but WITHOUT
4632N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4632N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4632N/A# version 2 for more details (a copy is included in the LICENSE file that
4632N/A# You should have received a copy of the GNU General Public License version
4632N/A# 2 along with this work; if not, write to the Free Software Foundation,
4632N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4632N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4632N/A# It knows how to compile, link, and run the adlc.
4632N/A# #########################################################################
4632N/A# OUTDIR must be the same as AD_Dir = $(GENERATED)/adfiles in
top.make:
4632N/AOUTDIR = $(GENERATED)/adfiles
4632N/A# set VPATH so make knows where to look for source files
4632N/ASrc_Dirs_V = ${Src_Dirs} $(GENERATED)/incls
4632N/A# set INCLUDES for C preprocessor
4632N/ASrc_Dirs_I = ${Src_Dirs} $(GENERATED)
4632N/AINCLUDES += $(Src_Dirs_I:%=-I%)
4632N/A# set flags for adlc compilation
4632N/ACPPFLAGS = $(SYSDEFS) $(INCLUDES)
4632N/A# Compiler warnings are treated as errors
4632N/AOBJECTS = $(OBJECTNAMES:%=$(OUTDIR)/%)
4632N/A ad_$(Platform_arch_model).cpp \
4632N/A ad_$(Platform_arch_model).hpp \
4632N/A adGlobals_$(Platform_arch_model).hpp \
4632N/A dfa_$(Platform_arch_model).cpp \
4632N/AGENERATEDFILES = $(GENERATEDNAMES:%=$(OUTDIR)/%)
4632N/A# #########################################################################
4632N/A : products = $(GENERATEDFILES)
4632N/A$(GENERATEDFILES): refresh_adfiles
4632N/A# Get a unique temporary directory name, so multiple makes can run in parallel.
4632N/A# Note that product files are updated via "mv", which is atomic.
4632N/ATEMPDIR := $(OUTDIR)/mktmp$(shell echo $$$$)
4632N/A# Normally, debugging is done directly on the ad_<arch>*.cpp files.
4632N/A# But -g will put #line directives in those files pointing back to <arch>.ad.
4632N/A# Some builds of gcc 3.2 have a bug that gets tickled by the extra #line directives
4632N/A# so skip it for 3.2 and ealier.
4632N/Aifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
4632N/A# adlc_updater is a simple sh script, under sccs control. It is
4632N/A# used to selectively update generated adlc files. This should
4632N/A# provide a nice compilation speed improvement.
4632N/AADLC_UPDATER_DIRECTORY = $(GAMMADIR)/make/$(OS)
4632N/A$(ADLC_UPDATER): $(ADLC_UPDATER_DIRECTORY)/$(ADLC_UPDATER)
4632N/A $(QUIETLY) cp $< $@; chmod +x $@
4632N/A# This action refreshes all generated adlc files simultaneously.
4632N/A# 1) create a scratch directory to work in.
4632N/A# 2) if the current working directory does not have $(ADLC_UPDATER), copy it.
4632N/A# 3) run the compiled adlc executable. This will create new adlc files in the scratch directory.
4632N/A# 4) call $(ADLC_UPDATER) on each generated adlc file. It will selectively update changed or missing files.
4632N/A# 5) If we actually updated any files, echo a notice.
4632N/A @rm -rf $(TEMPDIR); mkdir $(TEMPDIR)
4632N/A -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 \
4632N/A || { rm -rf $(TEMPDIR); exit 1; }
4632N/A $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
4632N/A $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
4632N/A $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)
_clone.cpp $(TEMPDIR) $(OUTDIR)
4632N/A $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)
_expand.cpp $(TEMPDIR) $(OUTDIR)
4632N/A $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)
_format.cpp $(TEMPDIR) $(OUTDIR)
4632N/A $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)
_gen.cpp $(TEMPDIR) $(OUTDIR)
4632N/A $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)
_misc.cpp $(TEMPDIR) $(OUTDIR)
4632N/A $(QUIETLY) ./$(ADLC_UPDATER) adGlobals_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
4632N/A $(QUIETLY) ./$(ADLC_UPDATER) dfa_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
4632N/A $(QUIETLY) [ -f $(TEMPDIR)/made-change ] \
4632N/A $(QUIETLY) rm -rf $(TEMPDIR)
4632N/A# #########################################################################
4632N/A# Pass through #line directives, in case user enables -g option above:
4632N/A if (CUR_FN != FILENAME) { CUR_FN=FILENAME; NR_BASE=NR-1; need_lineno=1 } \
4632N/A if (need_lineno && $$0 !~ /\/\//) \
4632N/A { print "\n\n\#line " (NR-NR_BASE) " \"" FILENAME "\""; need_lineno=0 }; \
4632N/A $(QUIETLY) $(REMOVE_TARGET)
4632N/A# Some object files are given a prefix, to disambiguate
4632N/A# them from objects of the same name built for the VM.
4632N/A $(QUIETLY) $(REMOVE_TARGET)
4632N/A# #########################################################################
4632N/A# #########################################################################
4632N/A.PHONY: all dump refresh_adfiles clean cleanall