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