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