Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/cscope.make
32281 views
#1# Copyright (c) 2000, 2008, 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# The cscope.out file is generated in the current directory. The old cscope.out25# file is *not* removed because cscope is smart enough to only build what has26# changed. cscope can be confused if files are renamed or removed, so it may be27# necessary to remove cscope.out (gmake cscope.clean) if a lot of reorganization28# has occurred.2930include $(GAMMADIR)/make/scm.make3132RM = rm -f33HG = hg34CS_TOP = $(GAMMADIR)3536CSDIRS = $(CS_TOP)/src $(CS_TOP)/make37CSINCS = $(CSDIRS:%=-I%)3839CSCOPE = cscope40CSCOPE_OUT = cscope.out41CSCOPE_FLAGS = -b4243# Allow .java files to be added from the environment (CSCLASSES=yes).44ifdef CSCLASSES45ADDCLASSES= -o -name '*.java'46endif4748# Adding CClassHeaders also pushes the file count of a full workspace up about49# 200 files (these files also don't exist in a new workspace, and thus will50# cause the recreation of the database as they get created, which might seem51# a little confusing). Thus allow these files to be added from the environment52# (CSHEADERS=yes).53ifndef CSHEADERS54RMCCHEADERS= -o -name CClassHeaders55endif5657# Ignore build products.58CS_PRUNE_GENERATED = -o -name '${OSNAME}_*_core' -o \59-name '${OSNAME}_*_compiler?'6061# O/S-specific files for all systems are included by default. Set CS_OS to a62# space-separated list of identifiers to include only those systems.63ifdef CS_OS64CS_PRUNE_OS = $(patsubst %,-o -name '*%*',\65$(filter-out ${CS_OS},bsd linux macos solaris windows))66endif6768# CPU-specific files for all processors are included by default. Set CS_CPU69# space-separated list identifiers to include only those CPUs.70ifdef CS_CPU71CS_PRUNE_CPU = $(patsubst %,-o -name '*%*',\72$(filter-out ${CS_CPU},arm ppc sparc x86 zero))73endif7475# What files should we include? A simple rule might be just those files under76# SCCS control, however this would miss files we create like the opcodes and77# CClassHeaders. The following attempts to find everything that is *useful*.78# (.del files are created by sccsrm, demo directories contain many .java files79# that probably aren't useful for development, and the pkgarchive may contain80# duplicates of files within the source hierarchy).8182# Directories to exclude.83CS_PRUNE_STD = $(SCM_DIRS) \84-o -name '.del-*' \85-o -name '*demo' \86-o -name pkgarchive8788# Placeholder for user-defined excludes.89CS_PRUNE_EX =9091CS_PRUNE = $(CS_PRUNE_STD) \92$(CS_PRUNE_OS) \93$(CS_PRUNE_CPU) \94$(CS_PRUNE_GENERATED) \95$(CS_PRUNE_EX) \96$(RMCCHEADERS)9798# File names to include.99CSFILENAMES = -name '*.[ch]pp' \100-o -name '*.[Ccshlxy]' \101$(CS_ADD_GENERATED) \102-o -name '*.d' \103-o -name '*.il' \104-o -name '*.cc' \105-o -name '*[Mm]akefile*' \106-o -name '*.gmk' \107-o -name '*.make' \108-o -name '*.ad' \109$(ADDCLASSES)110111.PHONY: cscope cscope.clean cscope.scratch TAGS.clean FORCE112.PRECIOUS: cscope.out113114cscope $(CSCOPE_OUT): cscope.files FORCE115$(CSCOPE) -f $(CSCOPE_OUT) $(CSCOPE_FLAGS)116117cscope.clean:118$(QUIETLY) $(RM) $(CSCOPE_OUT) cscope.files119120cscope.scratch: cscope.clean cscope121122# The raw list is reordered so cscope displays the most relevant files first.123cscope.files:124$(QUIETLY) \125raw=cscope.$$$$; \126find $(CSDIRS) -type d \( $(CS_PRUNE) \) -prune -o \127-type f \( $(CSFILENAMES) \) -print > $$raw; \128{ \129echo "$(CSINCS)"; \130egrep -v "\.java|/make/" $$raw; \131fgrep ".java" $$raw; \132fgrep "/make/" $$raw; \133} > $@; \134rm -f $$raw135136TAGS: cscope.files FORCE137egrep -v '^-|^$$' $< | etags --members -138139TAGS.clean:140$(RM) TAGS141142143