#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Native C/C++ Compile Rules
#
#
# INCREMENTAL_BUILD: Record the #include file dependencies.
#
# NOTE: We build make include files with the suffix
# $(DEPEND_SUFFIX) on every compilation. These are initially
# created as temp files just in case a ^C kills it in the middle.
# Compiler is smart enough to handle ^C and not create the .o file, or
# is supposed to be that smart, but the .$(DEPEND_SUFFIX) file
# creation here isn't.
# These .$(DEPEND_SUFFIX) files are included by Library.gmk and
# Program.gmk, when they exist (Search for 'make dependencies').
#
$(OBJDIR)/%.$(DEPEND_SUFFIX): %.c
@$(ECHO) "Creating $@"
$(CC_DEPEND_FILTER) > $@.temp
@$(ECHO) "Creating $@"
$(CC_DEPEND_FILTER) > $@.temp
endif # INCREMENTAL_BUILD
#
# C, C++, asm files.
#
# Normal or parallel compile rule is the same, but batch compiles require
# we save up the sources files that use the same compile line so that we
# can do one compile line.
#
$(OBJDIR)/%.$(OBJECT_SUFFIX): %.c
@$(check-conventions)
@$(check-conventions)
else
#
# Batch compiling might be faster if the compiler was smart about recognizing
# optimization opportunities available when all files are being compiled
# the same way. Unfortunately this is rare.
# Automatic pre-compiled headers (pch) might be a possibility so we
# add any auto pch options here.
# So we save all the source files that have the same compile line as the
# first file. A normal compile pass is made after the batch compile
# to catch anything missed.
# If the compilers had a -o option that allowed us to direct where to
# write the object files to, then we would not need to save the object
# file list or move them from the make directory to the build directory.
#
# Source names
# Object file list
# The compile line
# The compile line for the current target
$(OBJDIR)/%.$(OBJECT_SUFFIX): %.c
@if [ ! -s $(COMPILE_BATCH.c) ] ; then \
$(ECHO) $< > $(COMPILE_LIST.c); \
= "" ] ; then \
$(ECHO) $< >> $(COMPILE_LIST.c); \
fi
@$(RM) $(THIS_COMPILE_BATCH.c)
@$(check-conventions)
@if [ ! -s $(COMPILE_BATCH.cpp) ] ; then \
$(ECHO) $< > $(COMPILE_LIST.cpp); \
= "" ] ; then \
$(ECHO) $< >> $(COMPILE_LIST.cpp); \
fi
@$(RM) $(THIS_COMPILE_BATCH.cpp)
@$(check-conventions)
batch_compile: $(FILES_o)
@$(ECHO) "Doing batch compilations"
@if [ -s $(COMPILE_LIST.c) ] ; then \
fi
@if [ -s $(COMPILE_LIST.cpp) ] ; then \
fi
# newer as does not handle c++ style comments
$(OBJDIR)/%.$(OBJECT_SUFFIX): %.s
$(COMPILE.s) $(CC_OBJECT_OUTPUT_FLAG)$@ $<
else
@$(check-conventions)
# Obj-C files (Mac OS X only).
$(OBJDIR)/%.$(OBJECT_SUFFIX): %.m
@$(check-conventions)
@$(check-conventions)
$(OBJDIR)/%.$(OBJECT_SUFFIX): %.c
@$(check-conventions)
endif # PLATFORM
#
# Quick hack for making the compiler generate just the assembly file.
#
$(OBJDIR)/%.s: %.c
$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ -S $<
@$(check-conventions)
# remove the intermediate files from the directories.
# (If VARIANT=OPT, this removes all debug and fastdebug files too)
#
# Lint support
# (The 'lint' rule below is an older rule not using the .$(LINT_SUFFIX) files)
#
$(OBJDIR)/%.$(LINT_SUFFIX): %.c
# Old rule