Mon, 27 Aug 2012 10:54:30 -0700
Merge
1 #
2 # Copyright (c) 1995, 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 #
26 include $(BUILDDIR)/common/Rules.gmk
28 #
29 # Say you built classes into $(ALT_CLASSBINDIR) and then at the end of
30 # the build you might want to copy them over to $(ALT_CLASSDESTDIR);
31 # this rule takes care of that. No one should really set these
32 # variables except the bootstrap/recompile stage of the java compiler.
33 #
34 ifdef ALT_CLASSBINDIR
36 # By default post-processing is copying. Suppose you want to build
37 # a jar file then set ALT_CLASSES_DISPOSITION to '../../dest/nameof.jar'
38 # before including this file.
39 ifndef ALT_CLASSES_DISPOSITION
40 ALT_CLASSES_DISPOSITION = copy-classes
41 endif
43 build : $(ALT_CLASSES_DISPOSITION)
45 copy-classes:
46 ifneq ($(ALT_CLASSBINDIR), $(ALT_CLASSDESTDIR))
47 @if [ -s $(TEMPDIR)/.classes.list ]; then \
48 $(MKDIR) -p $(ALT_CLASSDESTDIR); \
49 $(ECHO) "Copying $(ALT_CLASSBINDIR)..."; \
50 $(ECHO) "($(CD) $(ALT_CLASSBINDIR); $(TAR) cf - .) | \
51 ($(CD) $(ALT_CLASSDESTDIR); $(TAR) xf -)"; \
52 ($(CD) $(ALT_CLASSBINDIR); $(TAR) cf - .) | \
53 ($(CD) $(ALT_CLASSDESTDIR); $(TAR) xf -); \
54 fi
55 else # ALT_CLASSBINDIR
56 @if [ -s $(TEMPDIR)/.classes.list ]; then \
57 $(ECHO) "Copy source and destination are the same: $(ALT_CLASSBINDIR) -- Copy skipped..."; \
58 fi
59 endif # ALT_CLASSBINDIR
61 .PHONY: copy-classes
62 endif # ALT_CLASSBINDIR