Classes.gmk revision 157
3863N/A#
3863N/A# Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved.
3863N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3863N/A#
3863N/A# This code is free software; you can redistribute it and/or modify it
3863N/A# under the terms of the GNU General Public License version 2 only, as
3863N/A# published by the Free Software Foundation. Oracle designates this
3863N/A# particular file as subject to the "Classpath" exception as provided
3863N/A# by Oracle in the LICENSE file that accompanied this code.
3863N/A#
3863N/A# This code is distributed in the hope that it will be useful, but WITHOUT
3863N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3863N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3863N/A# version 2 for more details (a copy is included in the LICENSE file that
3863N/A# accompanied this code).
3863N/A#
3863N/A# You should have received a copy of the GNU General Public License version
3863N/A# 2 along with this work; if not, write to the Free Software Foundation,
3863N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3863N/A#
3863N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3863N/A# or visit www.oracle.com if you need additional information or have any
3863N/A# questions.
3863N/A#
3863N/A
3863N/Ainclude $(BUILDDIR)/common/Rules.gmk
3863N/A
3863N/A#
3863N/A# Say you built classes into $(ALT_CLASSBINDIR) and then at the end of
3863N/A# the build you might want to copy them over to $(ALT_CLASSDESTDIR);
3863N/A# this rule takes care of that. No one should really set these
3863N/A# variables except the bootstrap/recompile stage of the java compiler.
3863N/A#
3863N/Aifdef ALT_CLASSBINDIR
3863N/A
3863N/A# By default post-processing is copying. Suppose you want to build
3863N/A# a jar file then set ALT_CLASSES_DISPOSITION to '../../dest/nameof.jar'
3863N/A# before including this file.
3863N/Aifndef ALT_CLASSES_DISPOSITION
3863N/AALT_CLASSES_DISPOSITION = copy-classes
3863N/Aendif
3863N/A
3863N/Abuild : $(ALT_CLASSES_DISPOSITION)
3863N/A
3863N/Acopy-classes:
3863N/Aifneq ($(ALT_CLASSBINDIR), $(ALT_CLASSDESTDIR))
3863N/A @if [ -s $(TEMPDIR)/.classes.list ]; then \
3863N/A $(MKDIR) -p $(ALT_CLASSDESTDIR); \
3863N/A $(ECHO) "Copying $(ALT_CLASSBINDIR)..."; \
3863N/A $(ECHO) "($(CD) $(ALT_CLASSBINDIR); $(TAR) cf - .) | \
3863N/A ($(CD) $(ALT_CLASSDESTDIR); $(TAR) xf -)"; \
3863N/A ($(CD) $(ALT_CLASSBINDIR); $(TAR) cf - .) | \
3863N/A ($(CD) $(ALT_CLASSDESTDIR); $(TAR) xf -); \
3863N/A fi
3863N/Aelse # ALT_CLASSBINDIR
3863N/A @if [ -s $(TEMPDIR)/.classes.list ]; then \
3863N/A $(ECHO) "Copy source and destination are the same: $(ALT_CLASSBINDIR) -- Copy skipped..."; \
3863N/A fi
3863N/Aendif # ALT_CLASSBINDIR
3863N/A
3863N/A.PHONY: copy-classes
3863N/Aendif # ALT_CLASSBINDIR
3863N/A
3863N/A