annotate build/solaris/makefiles/cscope.make @ 0:a61af66fc99e jdk7-b24

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children 7747916a0945
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 #
a61af66fc99e Initial load
duke
parents:
diff changeset
2 # Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.
a61af66fc99e Initial load
duke
parents:
diff changeset
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 #
a61af66fc99e Initial load
duke
parents:
diff changeset
5 # This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 # under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 # published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 #
a61af66fc99e Initial load
duke
parents:
diff changeset
9 # This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 # version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 # accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 #
a61af66fc99e Initial load
duke
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 # 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 #
a61af66fc99e Initial load
duke
parents:
diff changeset
19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 # CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 # have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 #
a61af66fc99e Initial load
duke
parents:
diff changeset
23 #
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 #
a61af66fc99e Initial load
duke
parents:
diff changeset
26 # The cscope.out file is made in the current directory and spans the entire
a61af66fc99e Initial load
duke
parents:
diff changeset
27 # source tree.
a61af66fc99e Initial load
duke
parents:
diff changeset
28 #
a61af66fc99e Initial load
duke
parents:
diff changeset
29 # Things to note:
a61af66fc99e Initial load
duke
parents:
diff changeset
30 # 1. We use relative names for cscope.
a61af66fc99e Initial load
duke
parents:
diff changeset
31 # 2. We *don't* remove the old cscope.out file, because cscope is smart
a61af66fc99e Initial load
duke
parents:
diff changeset
32 # enough to only build what has changed. It can be confused, however,
a61af66fc99e Initial load
duke
parents:
diff changeset
33 # if files are renamed or removed, so it may be necessary to manually
a61af66fc99e Initial load
duke
parents:
diff changeset
34 # remove cscope.out if a lot of reorganization has occurred.
a61af66fc99e Initial load
duke
parents:
diff changeset
35 #
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 include $(GAMMADIR)/make/scm.make
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 NAWK = /usr/xpg4/bin/awk
a61af66fc99e Initial load
duke
parents:
diff changeset
40 RM = rm -f
a61af66fc99e Initial load
duke
parents:
diff changeset
41 CS_TOP = ../..
a61af66fc99e Initial load
duke
parents:
diff changeset
42
a61af66fc99e Initial load
duke
parents:
diff changeset
43 CSDIRS = $(CS_TOP)/src $(CS_TOP)/build
a61af66fc99e Initial load
duke
parents:
diff changeset
44 CSINCS = $(CSDIRS:%=-I%)
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 CSCOPE = cscope
a61af66fc99e Initial load
duke
parents:
diff changeset
47 CSCOPE_FLAGS = -b
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 # Allow .java files to be added from the environment (CSCLASSES=yes).
a61af66fc99e Initial load
duke
parents:
diff changeset
50 ifdef CSCLASSES
a61af66fc99e Initial load
duke
parents:
diff changeset
51 ADDCLASSES= -o -name '*.java'
a61af66fc99e Initial load
duke
parents:
diff changeset
52 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 # Adding CClassHeaders also pushes the file count of a full workspace up about
a61af66fc99e Initial load
duke
parents:
diff changeset
55 # 200 files (these files also don't exist in a new workspace, and thus will
a61af66fc99e Initial load
duke
parents:
diff changeset
56 # cause the recreation of the database as they get created, which might seem
a61af66fc99e Initial load
duke
parents:
diff changeset
57 # a little confusing). Thus allow these files to be added from the environment
a61af66fc99e Initial load
duke
parents:
diff changeset
58 # (CSHEADERS=yes).
a61af66fc99e Initial load
duke
parents:
diff changeset
59 ifndef CSHEADERS
a61af66fc99e Initial load
duke
parents:
diff changeset
60 RMCCHEADERS= -o -name CClassHeaders
a61af66fc99e Initial load
duke
parents:
diff changeset
61 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 # Use CS_GENERATED=x to include auto-generated files in the build directories.
a61af66fc99e Initial load
duke
parents:
diff changeset
64 ifdef CS_GENERATED
a61af66fc99e Initial load
duke
parents:
diff changeset
65 CS_ADD_GENERATED = -o -name '*.incl'
a61af66fc99e Initial load
duke
parents:
diff changeset
66 else
a61af66fc99e Initial load
duke
parents:
diff changeset
67 CS_PRUNE_GENERATED = -o -name '${OS}_*_core' -o -name '${OS}_*_compiler?'
a61af66fc99e Initial load
duke
parents:
diff changeset
68 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 # OS-specific files for other systems are excluded by default. Use CS_OS=yes
a61af66fc99e Initial load
duke
parents:
diff changeset
71 # to include platform-specific files for other platforms.
a61af66fc99e Initial load
duke
parents:
diff changeset
72 ifndef CS_OS
a61af66fc99e Initial load
duke
parents:
diff changeset
73 CS_OS = linux macos solaris win32
a61af66fc99e Initial load
duke
parents:
diff changeset
74 CS_PRUNE_OS = $(patsubst %,-o -name '*%*',$(filter-out ${OS},${CS_OS}))
a61af66fc99e Initial load
duke
parents:
diff changeset
75 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 # Processor-specific files for other processors are excluded by default. Use
a61af66fc99e Initial load
duke
parents:
diff changeset
78 # CS_CPU=x to include platform-specific files for other platforms.
a61af66fc99e Initial load
duke
parents:
diff changeset
79 ifndef CS_CPU
a61af66fc99e Initial load
duke
parents:
diff changeset
80 CS_CPU = i486 sparc amd64 ia64
a61af66fc99e Initial load
duke
parents:
diff changeset
81 CS_PRUNE_CPU = $(patsubst %,-o -name '*%*',$(filter-out ${SRCARCH},${CS_CPU}))
a61af66fc99e Initial load
duke
parents:
diff changeset
82 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 # What files should we include? A simple rule might be just those files under
a61af66fc99e Initial load
duke
parents:
diff changeset
85 # SCCS control, however this would miss files we create like the opcodes and
a61af66fc99e Initial load
duke
parents:
diff changeset
86 # CClassHeaders. The following attempts to find everything that is *useful*.
a61af66fc99e Initial load
duke
parents:
diff changeset
87 # (.del files are created by sccsrm, demo directories contain many .java files
a61af66fc99e Initial load
duke
parents:
diff changeset
88 # that probably aren't useful for development, and the pkgarchive may contain
a61af66fc99e Initial load
duke
parents:
diff changeset
89 # duplicates of files within the source hierarchy).
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 # Directories to exclude.
a61af66fc99e Initial load
duke
parents:
diff changeset
92 CS_PRUNE_STD = $(SCM_DIRS) \
a61af66fc99e Initial load
duke
parents:
diff changeset
93 -o -name '.del-*' \
a61af66fc99e Initial load
duke
parents:
diff changeset
94 -o -name '*demo' \
a61af66fc99e Initial load
duke
parents:
diff changeset
95 -o -name pkgarchive
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 CS_PRUNE = $(CS_PRUNE_STD) \
a61af66fc99e Initial load
duke
parents:
diff changeset
98 $(CS_PRUNE_OS) \
a61af66fc99e Initial load
duke
parents:
diff changeset
99 $(CS_PRUNE_CPU) \
a61af66fc99e Initial load
duke
parents:
diff changeset
100 $(CS_PRUNE_GENERATED) \
a61af66fc99e Initial load
duke
parents:
diff changeset
101 $(RMCCHEADERS)
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 # File names to include.
a61af66fc99e Initial load
duke
parents:
diff changeset
104 CSFILENAMES = -name '*.[ch]pp' \
a61af66fc99e Initial load
duke
parents:
diff changeset
105 -o -name '*.[Ccshlxy]' \
a61af66fc99e Initial load
duke
parents:
diff changeset
106 $(CS_ADD_GENERATED) \
a61af66fc99e Initial load
duke
parents:
diff changeset
107 -o -name '*.d' \
a61af66fc99e Initial load
duke
parents:
diff changeset
108 -o -name '*.il' \
a61af66fc99e Initial load
duke
parents:
diff changeset
109 -o -name '*.cc' \
a61af66fc99e Initial load
duke
parents:
diff changeset
110 -o -name '*[Mm]akefile*' \
a61af66fc99e Initial load
duke
parents:
diff changeset
111 -o -name '*.gmk' \
a61af66fc99e Initial load
duke
parents:
diff changeset
112 -o -name '*.make' \
a61af66fc99e Initial load
duke
parents:
diff changeset
113 -o -name '*.ad' \
a61af66fc99e Initial load
duke
parents:
diff changeset
114 $(ADDCLASSES)
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 .PRECIOUS: cscope.out
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 cscope cscope.out: cscope.files FORCE
a61af66fc99e Initial load
duke
parents:
diff changeset
119 $(CSCOPE) $(CSCOPE_FLAGS)
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 # The .raw file is reordered here in an attempt to make cscope display the most
a61af66fc99e Initial load
duke
parents:
diff changeset
122 # relevant files first.
a61af66fc99e Initial load
duke
parents:
diff changeset
123 cscope.files: .cscope.files.raw
a61af66fc99e Initial load
duke
parents:
diff changeset
124 echo "$(CSINCS)" > $@
a61af66fc99e Initial load
duke
parents:
diff changeset
125 -egrep -v "\.java|\/build\/" $< >> $@
a61af66fc99e Initial load
duke
parents:
diff changeset
126 -fgrep ".java" $< >> $@
a61af66fc99e Initial load
duke
parents:
diff changeset
127 -fgrep "/build/" $< >> $@
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 .cscope.files.raw: .nametable.files
a61af66fc99e Initial load
duke
parents:
diff changeset
130 -find $(CSDIRS) -type d \( $(CS_PRUNE) \) -prune -o \
a61af66fc99e Initial load
duke
parents:
diff changeset
131 -type f \( $(CSFILENAMES) \) -print > $@
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 cscope.clean: nametable.clean
a61af66fc99e Initial load
duke
parents:
diff changeset
134 -$(RM) cscope.out cscope.files .cscope.files.raw
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 TAGS: cscope.files FORCE
a61af66fc99e Initial load
duke
parents:
diff changeset
137 egrep -v '^-|^$$' $< | etags --members -
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 TAGS.clean: nametable.clean
a61af66fc99e Initial load
duke
parents:
diff changeset
140 -$(RM) TAGS
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 # .nametable.files and .nametable.files.tmp are used to determine if any files
a61af66fc99e Initial load
duke
parents:
diff changeset
143 # were added to/deleted from/renamed in the workspace. If not, then there's
a61af66fc99e Initial load
duke
parents:
diff changeset
144 # normally no need to run find. To force a 'find': gmake nametable.clean.
a61af66fc99e Initial load
duke
parents:
diff changeset
145 .nametable.files: .nametable.files.tmp
a61af66fc99e Initial load
duke
parents:
diff changeset
146 cmp -s $@ $< || cp $< $@
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 .nametable.files.tmp: $(CS_TOP)/Codemgr_wsdata/nametable
a61af66fc99e Initial load
duke
parents:
diff changeset
149 $(NAWK) \
a61af66fc99e Initial load
duke
parents:
diff changeset
150 '{ if (sub("( [a-z0-9]{2,8}){4}$$", "")) print $$0; }' $< > $@
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 nametable.clean:
a61af66fc99e Initial load
duke
parents:
diff changeset
153 -$(RM) .nametable.files .nametable.files.tmp
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 FORCE:
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 .PHONY: cscope cscope.clean TAGS.clean nametable.clean FORCE