325N/A#
325N/A# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
325N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A#
325N/A# This code is free software; you can redistribute it and/or modify it
325N/A# under the terms of the GNU General Public License version 2 only, as
325N/A# published by the Free Software Foundation.
325N/A#
325N/A# This code is distributed in the hope that it will be useful, but WITHOUT
325N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A# version 2 for more details (a copy is included in the LICENSE file that
325N/A# accompanied this code).
325N/A#
325N/A# You should have received a copy of the GNU General Public License version
325N/A# 2 along with this work; if not, write to the Free Software Foundation,
325N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A#
325N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A# or visit www.oracle.com if you need additional information or have any
325N/A# questions.
325N/A#
325N/A#
325N/A
325N/A# The cscope.out file is generated in the current directory. The old cscope.out
325N/A# file is *not* removed because cscope is smart enough to only build what has
325N/A# changed. cscope can be confused if files are renamed or removed, so it may be
325N/A# necessary to remove cscope.out (gmake cscope.clean) if a lot of reorganization
325N/A# has occurred.
325N/A
325N/Ainclude $(GAMMADIR)/make/scm.make
325N/A
325N/ARM = rm -f
325N/AHG = hg
325N/ACS_TOP = $(GAMMADIR)
325N/A
325N/ACSDIRS = $(CS_TOP)/src $(CS_TOP)/make
325N/ACSINCS = $(CSDIRS:%=-I%)
325N/A
325N/ACSCOPE = cscope
325N/ACSCOPE_OUT = cscope.out
325N/ACSCOPE_FLAGS = -b
325N/A
325N/A# Allow .java files to be added from the environment (CSCLASSES=yes).
325N/Aifdef CSCLASSES
325N/AADDCLASSES= -o -name '*.java'
325N/Aendif
325N/A
325N/A# Adding CClassHeaders also pushes the file count of a full workspace up about
325N/A# 200 files (these files also don't exist in a new workspace, and thus will
325N/A# cause the recreation of the database as they get created, which might seem
325N/A# a little confusing). Thus allow these files to be added from the environment
325N/A# (CSHEADERS=yes).
325N/Aifndef CSHEADERS
325N/ARMCCHEADERS= -o -name CClassHeaders
325N/Aendif
325N/A
325N/A# Ignore build products.
325N/ACS_PRUNE_GENERATED = -o -name '${OSNAME}_*_core' -o \
325N/A -name '${OSNAME}_*_compiler?'
325N/A
325N/A# O/S-specific files for all systems are included by default. Set CS_OS to a
325N/A# space-separated list of identifiers to include only those systems.
325N/Aifdef CS_OS
325N/ACS_PRUNE_OS = $(patsubst %,-o -name '*%*',\
325N/A $(filter-out ${CS_OS},bsd linux macos solaris windows))
325N/Aendif
325N/A
325N/A# CPU-specific files for all processors are included by default. Set CS_CPU
325N/A# space-separated list identifiers to include only those CPUs.
325N/Aifdef CS_CPU
325N/ACS_PRUNE_CPU = $(patsubst %,-o -name '*%*',\
325N/A $(filter-out ${CS_CPU},arm ppc sparc x86 zero))
325N/Aendif
325N/A
325N/A# What files should we include? A simple rule might be just those files under
325N/A# SCCS control, however this would miss files we create like the opcodes and
325N/A# CClassHeaders. The following attempts to find everything that is *useful*.
325N/A# (.del files are created by sccsrm, demo directories contain many .java files
325N/A# that probably aren't useful for development, and the pkgarchive may contain
325N/A# duplicates of files within the source hierarchy).
325N/A
325N/A# Directories to exclude.
325N/ACS_PRUNE_STD = $(SCM_DIRS) \
325N/A -o -name '.del-*' \
325N/A -o -name '*demo' \
325N/A -o -name pkgarchive
325N/A
325N/A# Placeholder for user-defined excludes.
325N/ACS_PRUNE_EX =
325N/A
325N/ACS_PRUNE = $(CS_PRUNE_STD) \
325N/A $(CS_PRUNE_OS) \
325N/A $(CS_PRUNE_CPU) \
325N/A $(CS_PRUNE_GENERATED) \
325N/A $(CS_PRUNE_EX) \
325N/A $(RMCCHEADERS)
325N/A
325N/A# File names to include.
325N/ACSFILENAMES = -name '*.[ch]pp' \
325N/A -o -name '*.[Ccshlxy]' \
325N/A $(CS_ADD_GENERATED) \
325N/A -o -name '*.d' \
325N/A -o -name '*.il' \
325N/A -o -name '*.cc' \
325N/A -o -name '*[Mm]akefile*' \
325N/A -o -name '*.gmk' \
325N/A -o -name '*.make' \
325N/A -o -name '*.ad' \
325N/A $(ADDCLASSES)
325N/A
325N/A.PHONY: cscope cscope.clean cscope.scratch TAGS.clean FORCE
325N/A.PRECIOUS: cscope.out
325N/A
325N/Acscope $(CSCOPE_OUT): cscope.files FORCE
325N/A $(CSCOPE) -f $(CSCOPE_OUT) $(CSCOPE_FLAGS)
325N/A
325N/Acscope.clean:
325N/A $(QUIETLY) $(RM) $(CSCOPE_OUT) cscope.files
325N/A
325N/Acscope.scratch: cscope.clean cscope
325N/A
325N/A# The raw list is reordered so cscope displays the most relevant files first.
325N/Acscope.files:
325N/A $(QUIETLY) \
325N/A raw=cscope.$$$$; \
325N/A find $(CSDIRS) -type d \( $(CS_PRUNE) \) -prune -o \
325N/A -type f \( $(CSFILENAMES) \) -print > $$raw; \
325N/A { \
325N/A echo "$(CSINCS)"; \
325N/A egrep -v "\.java|/make/" $$raw; \
325N/A fgrep ".java" $$raw; \
325N/A fgrep "/make/" $$raw; \
325N/A } > $@; \
325N/A rm -f $$raw
325N/A
325N/ATAGS: cscope.files FORCE
325N/A egrep -v '^-|^$$' $< | etags --members -
325N/A
325N/ATAGS.clean:
325N/A $(RM) TAGS
325N/A