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