make/cscope.make

Wed, 27 Apr 2016 01:25:04 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:25:04 +0800
changeset 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/
changeset: 6782:28b50d07f6f8
tag: jdk8u25-b17

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 #
aoqi@0 5 # This code is free software; you can redistribute it and/or modify it
aoqi@0 6 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 # published by the Free Software Foundation.
aoqi@0 8 #
aoqi@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 # accompanied this code).
aoqi@0 14 #
aoqi@0 15 # You should have received a copy of the GNU General Public License version
aoqi@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 #
aoqi@0 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 # or visit www.oracle.com if you need additional information or have any
aoqi@0 21 # questions.
aoqi@0 22 #
aoqi@0 23 #
aoqi@0 24
aoqi@0 25 # The cscope.out file is generated in the current directory. The old cscope.out
aoqi@0 26 # file is *not* removed because cscope is smart enough to only build what has
aoqi@0 27 # changed. cscope can be confused if files are renamed or removed, so it may be
aoqi@0 28 # necessary to remove cscope.out (gmake cscope.clean) if a lot of reorganization
aoqi@0 29 # has occurred.
aoqi@0 30
aoqi@0 31 include $(GAMMADIR)/make/scm.make
aoqi@0 32
aoqi@0 33 RM = rm -f
aoqi@0 34 HG = hg
aoqi@0 35 CS_TOP = $(GAMMADIR)
aoqi@0 36
aoqi@0 37 CSDIRS = $(CS_TOP)/src $(CS_TOP)/make
aoqi@0 38 CSINCS = $(CSDIRS:%=-I%)
aoqi@0 39
aoqi@0 40 CSCOPE = cscope
aoqi@0 41 CSCOPE_OUT = cscope.out
aoqi@0 42 CSCOPE_FLAGS = -b
aoqi@0 43
aoqi@0 44 # Allow .java files to be added from the environment (CSCLASSES=yes).
aoqi@0 45 ifdef CSCLASSES
aoqi@0 46 ADDCLASSES= -o -name '*.java'
aoqi@0 47 endif
aoqi@0 48
aoqi@0 49 # Adding CClassHeaders also pushes the file count of a full workspace up about
aoqi@0 50 # 200 files (these files also don't exist in a new workspace, and thus will
aoqi@0 51 # cause the recreation of the database as they get created, which might seem
aoqi@0 52 # a little confusing). Thus allow these files to be added from the environment
aoqi@0 53 # (CSHEADERS=yes).
aoqi@0 54 ifndef CSHEADERS
aoqi@0 55 RMCCHEADERS= -o -name CClassHeaders
aoqi@0 56 endif
aoqi@0 57
aoqi@0 58 # Ignore build products.
aoqi@0 59 CS_PRUNE_GENERATED = -o -name '${OSNAME}_*_core' -o \
aoqi@0 60 -name '${OSNAME}_*_compiler?'
aoqi@0 61
aoqi@0 62 # O/S-specific files for all systems are included by default. Set CS_OS to a
aoqi@0 63 # space-separated list of identifiers to include only those systems.
aoqi@0 64 ifdef CS_OS
aoqi@0 65 CS_PRUNE_OS = $(patsubst %,-o -name '*%*',\
aoqi@0 66 $(filter-out ${CS_OS},bsd linux macos solaris windows))
aoqi@0 67 endif
aoqi@0 68
aoqi@0 69 # CPU-specific files for all processors are included by default. Set CS_CPU
aoqi@0 70 # space-separated list identifiers to include only those CPUs.
aoqi@0 71 ifdef CS_CPU
aoqi@0 72 CS_PRUNE_CPU = $(patsubst %,-o -name '*%*',\
aoqi@0 73 $(filter-out ${CS_CPU},arm ppc sparc x86 zero))
aoqi@0 74 endif
aoqi@0 75
aoqi@0 76 # What files should we include? A simple rule might be just those files under
aoqi@0 77 # SCCS control, however this would miss files we create like the opcodes and
aoqi@0 78 # CClassHeaders. The following attempts to find everything that is *useful*.
aoqi@0 79 # (.del files are created by sccsrm, demo directories contain many .java files
aoqi@0 80 # that probably aren't useful for development, and the pkgarchive may contain
aoqi@0 81 # duplicates of files within the source hierarchy).
aoqi@0 82
aoqi@0 83 # Directories to exclude.
aoqi@0 84 CS_PRUNE_STD = $(SCM_DIRS) \
aoqi@0 85 -o -name '.del-*' \
aoqi@0 86 -o -name '*demo' \
aoqi@0 87 -o -name pkgarchive
aoqi@0 88
aoqi@0 89 # Placeholder for user-defined excludes.
aoqi@0 90 CS_PRUNE_EX =
aoqi@0 91
aoqi@0 92 CS_PRUNE = $(CS_PRUNE_STD) \
aoqi@0 93 $(CS_PRUNE_OS) \
aoqi@0 94 $(CS_PRUNE_CPU) \
aoqi@0 95 $(CS_PRUNE_GENERATED) \
aoqi@0 96 $(CS_PRUNE_EX) \
aoqi@0 97 $(RMCCHEADERS)
aoqi@0 98
aoqi@0 99 # File names to include.
aoqi@0 100 CSFILENAMES = -name '*.[ch]pp' \
aoqi@0 101 -o -name '*.[Ccshlxy]' \
aoqi@0 102 $(CS_ADD_GENERATED) \
aoqi@0 103 -o -name '*.d' \
aoqi@0 104 -o -name '*.il' \
aoqi@0 105 -o -name '*.cc' \
aoqi@0 106 -o -name '*[Mm]akefile*' \
aoqi@0 107 -o -name '*.gmk' \
aoqi@0 108 -o -name '*.make' \
aoqi@0 109 -o -name '*.ad' \
aoqi@0 110 $(ADDCLASSES)
aoqi@0 111
aoqi@0 112 .PHONY: cscope cscope.clean cscope.scratch TAGS.clean FORCE
aoqi@0 113 .PRECIOUS: cscope.out
aoqi@0 114
aoqi@0 115 cscope $(CSCOPE_OUT): cscope.files FORCE
aoqi@0 116 $(CSCOPE) -f $(CSCOPE_OUT) $(CSCOPE_FLAGS)
aoqi@0 117
aoqi@0 118 cscope.clean:
aoqi@0 119 $(QUIETLY) $(RM) $(CSCOPE_OUT) cscope.files
aoqi@0 120
aoqi@0 121 cscope.scratch: cscope.clean cscope
aoqi@0 122
aoqi@0 123 # The raw list is reordered so cscope displays the most relevant files first.
aoqi@0 124 cscope.files:
aoqi@0 125 $(QUIETLY) \
aoqi@0 126 raw=cscope.$$$$; \
aoqi@0 127 find $(CSDIRS) -type d \( $(CS_PRUNE) \) -prune -o \
aoqi@0 128 -type f \( $(CSFILENAMES) \) -print > $$raw; \
aoqi@0 129 { \
aoqi@0 130 echo "$(CSINCS)"; \
aoqi@0 131 egrep -v "\.java|/make/" $$raw; \
aoqi@0 132 fgrep ".java" $$raw; \
aoqi@0 133 fgrep "/make/" $$raw; \
aoqi@0 134 } > $@; \
aoqi@0 135 rm -f $$raw
aoqi@0 136
aoqi@0 137 TAGS: cscope.files FORCE
aoqi@0 138 egrep -v '^-|^$$' $< | etags --members -
aoqi@0 139
aoqi@0 140 TAGS.clean:
aoqi@0 141 $(RM) TAGS

mercurial