Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/bsd/makefiles/cscope.make
32285 views
#1# Copyright (c) 2005, 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#25# The cscope.out file is made in the current directory and spans the entire26# source tree.27#28# Things to note:29# 1. We use relative names for cscope.30# 2. We *don't* remove the old cscope.out file, because cscope is smart31# enough to only build what has changed. It can be confused, however,32# if files are renamed or removed, so it may be necessary to manually33# remove cscope.out if a lot of reorganization has occurred.34#3536include $(GAMMADIR)/make/scm.make3738NAWK = awk39RM = rm -f40HG = hg41CS_TOP = ../..4243CSDIRS = $(CS_TOP)/src $(CS_TOP)/build44CSINCS = $(CSDIRS:%=-I%)4546CSCOPE = cscope47CSCOPE_FLAGS = -b4849# Allow .java files to be added from the environment (CSCLASSES=yes).50ifdef CSCLASSES51ADDCLASSES= -o -name '*.java'52endif5354# Adding CClassHeaders also pushes the file count of a full workspace up about55# 200 files (these files also don't exist in a new workspace, and thus will56# cause the recreation of the database as they get created, which might seem57# a little confusing). Thus allow these files to be added from the environment58# (CSHEADERS=yes).59ifndef CSHEADERS60RMCCHEADERS= -o -name CClassHeaders61endif6263# Use CS_GENERATED=x to include auto-generated files in the build directories.64ifdef CS_GENERATED65CS_ADD_GENERATED = -o -name '*.incl'66else67CS_PRUNE_GENERATED = -o -name '${OS}_*_core' -o -name '${OS}_*_compiler?'68endif6970# OS-specific files for other systems are excluded by default. Use CS_OS=yes71# to include platform-specific files for other platforms.72ifndef CS_OS73CS_OS = linux macos solaris win32 bsd74CS_PRUNE_OS = $(patsubst %,-o -name '*%*',$(filter-out ${OS},${CS_OS}))75endif7677# Processor-specific files for other processors are excluded by default. Use78# CS_CPU=x to include platform-specific files for other platforms.79ifndef CS_CPU80CS_CPU = i486 sparc amd64 ia6481CS_PRUNE_CPU = $(patsubst %,-o -name '*%*',$(filter-out ${SRCARCH},${CS_CPU}))82endif8384# What files should we include? A simple rule might be just those files under85# SCCS control, however this would miss files we create like the opcodes and86# CClassHeaders. The following attempts to find everything that is *useful*.87# (.del files are created by sccsrm, demo directories contain many .java files88# that probably aren't useful for development, and the pkgarchive may contain89# duplicates of files within the source hierarchy).9091# Directories to exclude.92CS_PRUNE_STD = $(SCM_DIRS) \93-o -name '.del-*' \94-o -name '*demo' \95-o -name pkgarchive9697CS_PRUNE = $(CS_PRUNE_STD) \98$(CS_PRUNE_OS) \99$(CS_PRUNE_CPU) \100$(CS_PRUNE_GENERATED) \101$(RMCCHEADERS)102103# File names to include.104CSFILENAMES = -name '*.[ch]pp' \105-o -name '*.[Ccshlxy]' \106$(CS_ADD_GENERATED) \107-o -name '*.il' \108-o -name '*.cc' \109-o -name '*[Mm]akefile*' \110-o -name '*.gmk' \111-o -name '*.make' \112-o -name '*.ad' \113$(ADDCLASSES)114115.PRECIOUS: cscope.out116117cscope cscope.out: cscope.files FORCE118$(CSCOPE) $(CSCOPE_FLAGS)119120# The .raw file is reordered here in an attempt to make cscope display the most121# relevant files first.122cscope.files: .cscope.files.raw123echo "$(CSINCS)" > $@124-egrep -v "\.java|\/make\/" $< >> $@125-fgrep ".java" $< >> $@126-fgrep "/make/" $< >> $@127128.cscope.files.raw: .nametable.files129-find $(CSDIRS) -type d \( $(CS_PRUNE) \) -prune -o \130-type f \( $(CSFILENAMES) \) -print > $@131132cscope.clean: nametable.clean133-$(RM) cscope.out cscope.files .cscope.files.raw134135TAGS: cscope.files FORCE136egrep -v '^-|^$$' $< | etags --members -137138TAGS.clean: nametable.clean139-$(RM) TAGS140141# .nametable.files and .nametable.files.tmp are used to determine if any files142# were added to/deleted from/renamed in the workspace. If not, then there's143# normally no need to rebuild the cscope database. To force a rebuild of144# the cscope database: gmake nametable.clean.145.nametable.files: .nametable.files.tmp146( cmp -s $@ $< ) || ( cp $< $@ )147-$(RM) $<148149# `hg status' is slightly faster than `hg fstatus'. Both are150# quite a bit slower on an NFS mounted file system, so this is151# really geared towards repos on local file systems.152.nametable.files.tmp:153-$(HG) fstatus -acmn > $@154nametable.clean:155-$(RM) .nametable.files .nametable.files.tmp156157FORCE:158159.PHONY: cscope cscope.clean TAGS.clean nametable.clean FORCE160161162