1 # |
|
2 # Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. |
|
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. Oracle designates this |
|
8 # particular file as subject to the "Classpath" exception as provided |
|
9 # by Oracle in the LICENSE file that accompanied this code. |
|
10 # |
|
11 # This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 # version 2 for more details (a copy is included in the LICENSE file that |
|
15 # accompanied this code). |
|
16 # |
|
17 # You should have received a copy of the GNU General Public License version |
|
18 # 2 along with this work; if not, write to the Free Software Foundation, |
|
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 # |
|
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 # or visit www.oracle.com if you need additional information or have any |
|
23 # questions. |
|
24 # |
|
25 |
|
26 # |
|
27 # Only get these rules if SCCS is available |
|
28 # |
|
29 |
|
30 ifdef SCCS |
|
31 |
|
32 # SCCS command to extract out latest source |
|
33 SCCS_GET=$(SCCS) get -s |
|
34 |
|
35 # |
|
36 # Make sure all files in workspace are fresh |
|
37 # |
|
38 TEMP_ALL_FILES=$(JDK_TOPDIR)/temp_filelist |
|
39 $(TEMP_ALL_FILES): $(JDK_TOPDIR)/Codemgr_wsdata/nametable |
|
40 $(prep-target) |
|
41 @$(CUT) -d' ' -f1 $< \ |
|
42 | $(GREP) -v '^VERSION' \ |
|
43 | $(GREP) -v '^deleted_files' \ |
|
44 | $(GREP) -v '^Codemgr_wsdata' > $@ |
|
45 |
|
46 sccs_get: $(TEMP_ALL_FILES) |
|
47 @$(PRINTF) "Workspace has %d files\n" `$(CAT) $< | $(WC) -l` |
|
48 @count=0; \ |
|
49 for i in `$(CAT) $<` ; do \ |
|
50 f=$(JDK_TOPDIR)/$$i; \ |
|
51 count=`$(EXPR) $$count '+' 1`; \ |
|
52 if [ `$(EXPR) $$count '%' 100` = 0 ] ; then \ |
|
53 $(PRINTF) "\rChecked $$count files"; \ |
|
54 fi; \ |
|
55 if [ ! -f $$f ] ; then \ |
|
56 $(PRINTF) "\r$(SCCS_GET) $$f\n"; \ |
|
57 (cd `$(DIRNAME) $$f` && $(SCCS_GET) `$(BASENAME) $$f`); \ |
|
58 elif /usr/bin/test $$f -ot `$(DIRNAME) $$f`/SCCS/s.`$(BASENAME) $$f` ; then \ |
|
59 $(PRINTF) "\r$(SCCS_GET) $$f\n"; \ |
|
60 (cd `$(DIRNAME) $$f` && $(SCCS_GET) `$(BASENAME) $$f`); \ |
|
61 fi; \ |
|
62 done; \ |
|
63 $(PRINTF) "\rChecked $$count files\n" |
|
64 |
|
65 # |
|
66 # Phonies to avoid accidents. |
|
67 # |
|
68 .PHONY: sccs_get |
|
69 |
|
70 endif |
|