corba/make/common/Classes.gmk
changeset 4 02bb8761fcce
child 5555 b2b5ed3f0d0d
equal deleted inserted replaced
0:fd16c54261b3 4:02bb8761fcce
       
     1 #
       
     2 # Copyright 1995-2005 Sun Microsystems, Inc.  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.  Sun designates this
       
     8 # particular file as subject to the "Classpath" exception as provided
       
     9 # by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
       
    22 # CA 95054 USA or visit www.sun.com if you need additional information or
       
    23 # have any questions.
       
    24 #
       
    25 
       
    26 include $(BUILDDIR)/common/Rules.gmk
       
    27 
       
    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
       
    35 
       
    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
       
    42 
       
    43 build : $(ALT_CLASSES_DISPOSITION)
       
    44 
       
    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
       
    60 
       
    61 .PHONY: copy-classes
       
    62 endif # ALT_CLASSBINDIR
       
    63