jdk/makefiles/common/Classes.gmk
changeset 13180 8aa9ac63f4ac
parent 13179 6ab81ecbfa0d
parent 13174 55e64db81468
child 13182 f680b32db5a7
equal deleted inserted replaced
13179:6ab81ecbfa0d 13180:8aa9ac63f4ac
     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 #
       
    25 
       
    26 # WARNING: This file is shared with other workspaces.
       
    27 #          So when it includes other files, it must use JDK_TOPDIR.
       
    28 #
       
    29 
       
    30 include $(JDK_TOPDIR)/makefiles/common/Rules.gmk
       
    31 
       
    32 #
       
    33 # Say you built classes into $(ALT_CLASSBINDIR) and then at the end of
       
    34 # the build you might want to copy them over to $(ALT_CLASSDESTDIR);
       
    35 # this rule takes care of that.  No one should really set these
       
    36 # variables except the bootstrap/recompile stage of the java compiler.
       
    37 #
       
    38 ifdef ALT_CLASSBINDIR
       
    39 
       
    40 # By default post-processing is copying.  Suppose you want to build
       
    41 # a jar file then set ALT_CLASSES_DISPOSITION to '../../dest/nameof.jar'
       
    42 # before including this file.
       
    43 ifndef ALT_CLASSES_DISPOSITION
       
    44 ALT_CLASSES_DISPOSITION = copy-classes
       
    45 endif
       
    46 
       
    47 build : $(ALT_CLASSES_DISPOSITION)
       
    48 
       
    49 copy-classes: 
       
    50 ifneq ($(ALT_CLASSBINDIR), $(ALT_CLASSDESTDIR))
       
    51 	@if [ -s $(TEMPDIR)/.classes.list ]; then \
       
    52 	  mkdir -p $(ALT_CLASSDESTDIR); \
       
    53 	  echo "Copying $(ALT_CLASSBINDIR)..."; \
       
    54 	  echo "(cd $(ALT_CLASSBINDIR); tar cf - .) | \
       
    55 			(cd $(ALT_CLASSDESTDIR); tar xf -)"; \
       
    56 	  (cd $(ALT_CLASSBINDIR); tar cf - .) | \
       
    57 			(cd $(ALT_CLASSDESTDIR); tar xf -); \
       
    58 	fi
       
    59 else # ALT_CLASSBINDIR
       
    60 	@if [ -s $(TEMPDIR)/.classes.list ]; then \
       
    61 	  echo "Copy source and destination are the same: $(ALT_CLASSBINDIR) -- Copy skipped..."; \
       
    62 	fi
       
    63 endif # ALT_CLASSBINDIR
       
    64 
       
    65 .PHONY: copy-classes
       
    66 endif # ALT_CLASSBINDIR
       
    67