corba/make/common/Classes.gmk
author asaha
Mon, 10 Aug 2009 09:47:21 -0700
changeset 3490 c65dc9920c40
parent 4 02bb8761fcce
child 5555 b2b5ed3f0d0d
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
#
02bb8761fcce Initial load
duke
parents:
diff changeset
     2
# Copyright 1995-2005 Sun Microsystems, Inc.  All Rights Reserved.
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
#
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
02bb8761fcce Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
02bb8761fcce Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
02bb8761fcce Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
02bb8761fcce Initial load
duke
parents:
diff changeset
    23
# have any questions.
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
include $(BUILDDIR)/common/Rules.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
# Say you built classes into $(ALT_CLASSBINDIR) and then at the end of
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
# the build you might want to copy them over to $(ALT_CLASSDESTDIR);
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
# this rule takes care of that.  No one should really set these
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
# variables except the bootstrap/recompile stage of the java compiler.
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
ifdef ALT_CLASSBINDIR
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
# By default post-processing is copying.  Suppose you want to build
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
# a jar file then set ALT_CLASSES_DISPOSITION to '../../dest/nameof.jar'
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
# before including this file.
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
ifndef ALT_CLASSES_DISPOSITION
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
ALT_CLASSES_DISPOSITION = copy-classes
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
build : $(ALT_CLASSES_DISPOSITION)
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
copy-classes: 
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
ifneq ($(ALT_CLASSBINDIR), $(ALT_CLASSDESTDIR))
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
	@if [ -s $(TEMPDIR)/.classes.list ]; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
	  $(MKDIR) -p $(ALT_CLASSDESTDIR); \
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
	  $(ECHO) "Copying $(ALT_CLASSBINDIR)..."; \
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
	  $(ECHO) "($(CD) $(ALT_CLASSBINDIR); $(TAR) cf - .) | \
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
			($(CD) $(ALT_CLASSDESTDIR); $(TAR) xf -)"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
	  ($(CD) $(ALT_CLASSBINDIR); $(TAR) cf - .) | \
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
			($(CD) $(ALT_CLASSDESTDIR); $(TAR) xf -); \
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
	fi
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
else # ALT_CLASSBINDIR
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
	@if [ -s $(TEMPDIR)/.classes.list ]; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
	  $(ECHO) "Copy source and destination are the same: $(ALT_CLASSBINDIR) -- Copy skipped..."; \
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
	fi
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
endif # ALT_CLASSBINDIR
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
.PHONY: copy-classes
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
endif # ALT_CLASSBINDIR
02bb8761fcce Initial load
duke
parents:
diff changeset
    63