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