Makefile revision 51:db35452e8965
154359Sroberto# 2182007Sroberto# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 354359Sroberto# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 454359Sroberto# 554359Sroberto# This code is free software; you can redistribute it and/or modify it 654359Sroberto# under the terms of the GNU General Public License version 2 only, as 754359Sroberto# published by the Free Software Foundation. Sun designates this 854359Sroberto# particular file as subject to the "Classpath" exception as provided 956746Sroberto# by Sun in the LICENSE file that accompanied this code. 1054359Sroberto# 1154359Sroberto# This code is distributed in the hope that it will be useful, but WITHOUT 1254359Sroberto# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1354359Sroberto# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1454359Sroberto# version 2 for more details (a copy is included in the LICENSE file that 1554359Sroberto# accompanied this code). 1654359Sroberto# 1782498Sroberto# You should have received a copy of the GNU General Public License version 1882498Sroberto# 2 along with this work; if not, write to the Free Software Foundation, 1982498Sroberto# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20290000Sglebius# 21290000Sglebius# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22290000Sglebius# CA 95054 USA or visit www.sun.com if you need additional information or 23290000Sglebius# have any questions. 24290000Sglebius# 2554359Sroberto 2654359Sroberto# 2754359Sroberto# Makefile for building the corba workspace. 2854359Sroberto# 2954359Sroberto 3054359SrobertoBUILDDIR=. 3154359Srobertoinclude $(BUILDDIR)/common/Defs.gmk 3254359Srobertoinclude $(BUILDDIR)/common/CancelImplicits.gmk 3354359Sroberto 3454359Sroberto#----- commands 3554359Sroberto 3654359SrobertoCHMOD = chmod 3754359SrobertoCP = cp 3854359SrobertoECHO = echo # FIXME 3954359SrobertoFIND = find 4054359SrobertoMKDIR = mkdir 4154359SrobertoSED = sed 4254359SrobertoZIP = zip 4354359Sroberto 4454359Sroberto#----- locations and deliverables 4554359Sroberto 4654359SrobertoTOPDIR=.. 4754359SrobertoSRC_BIN_DIR = $(TOPDIR)/src/share/bin 4854359SrobertoSRC_CLASSES_DIR = $(TOPDIR)/src/share/classes 4954359Sroberto 5054359Srobertoifdef ALT_OUTPUTDIR 51182007Sroberto OUTPUTDIR = $(ALT_OUTPUTDIR) 5254359Sroberto BUILD_DIR = $(ALT_OUTPUTDIR) 5354359Sroberto DIST_DIR = $(ALT_OUTPUTDIR)/dist 5454359Srobertoelse 5554359Sroberto OUTPUTDIR = .. 5654359Sroberto BUILD_DIR = $(TOPDIR)/build/$(PLATFORM)-$(ARCH) 57290000Sglebius DIST_DIR = $(TOPDIR)/dist 5854359Srobertoendif 5954359SrobertoABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR)) 6054359Sroberto 6154359SrobertoCLASSES_DIR = $(BUILD_DIR)/classes 6254359SrobertoGENSRC_DIR = $(BUILD_DIR)/gensrc 6354359Sroberto 6454359SrobertoBIN_DIR = $(DIST_DIR)/bin 6554359SrobertoLIB_DIR = $(DIST_DIR)/lib 6654359Sroberto 6754359Sroberto#----- 6854359Sroberto 6954359Srobertoifndef JDK_MAJOR_VERSION 7054359Sroberto JDK_MAJOR_VERSION = 1 7154359Srobertoendif 72290000Sglebius 7354359Srobertoifndef JDK_MINOR_VERSION 7454359Sroberto JDK_MINOR_VERSION = 7 7554359Srobertoendif 7654359Sroberto 7754359Srobertoifndef JDK_MICRO_VERSION 7854359Sroberto JDK_MICRO_VERSION = 0 7954359Srobertoendif 8054359Sroberto 8154359Srobertoifndef JDK_VERSION 8254359Sroberto JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) 8354359Srobertoendif 8454359Sroberto 8554359Srobertoifndef MILESTONE 8654359Sroberto MILESTONE = internal 8754359Srobertoendif 88182007Sroberto 89182007Sroberto# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set 90182007Srobertoifneq ($(MILESTONE),fcs) 9154359Sroberto RELEASE = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE) 92290000Sglebiuselse 93290000Sglebius RELEASE = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE) 94290000Sglebiusendif 95290000Sglebius 96290000Sglebius# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set 97290000Sglebiusifdef BUILD_NUMBER 98290000Sglebius FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER) 99290000Sglebiuselse 100290000Sglebius BUILD_NUMBER = b00 101290000Sglebius USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`) 10254359Sroberto FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER) 10354359Srobertoendif 10454359Sroberto 10554359Sroberto#----- useful macros 10654359Sroberto 107182007SrobertoSOURCE_LEVEL = 5 10854359SrobertoBOOTSTRAP_TARGET_LEVEL = 5 109182007SrobertoTARGET_LEVEL = 6 110182007Sroberto 11154359Srobertoifndef TARGET_JAVA 11254359Sroberto TARGET_JAVA = java 11354359Srobertoendif 11454359Sroberto 11554359SrobertoSELF = $(lastword $(MAKEFILE_LIST)) 11654359Sroberto 11754359Sroberto# for jdk, we generate the following: 118290000Sglebius# dist/lib/classes.jar: 11954359Sroberto# corba recompiled to run on the target JDK, 120182007Sroberto# ready for inclusion in rt.jar 12154359Sroberto# dist/lib/src.zip 12254359Sroberto# .properties and .java files for classes in classes.jar, 12354359Sroberto# ready for jdk src.zip 124290000Sglebius# dist/lib/bin.zip 12554359Sroberto# corba specific binaries: orb.idl, ir.idl 12654359Sroberto 12754359Sroberto# Default target 12854359Srobertodefault: all 12954359Sroberto 13054359Sroberto#----- classes.jar 131290000Sglebius 132290000SglebiusCLASSES_JAR = $(LIB_DIR)/classes.jar 133290000Sglebius$(CLASSES_JAR): 134290000Sglebius $(MKDIR) -p $(@D) 135290000Sglebius $(BOOT_JAR_CMD) -cf $@ -C $(CLASSES_DIR) . 136290000Sglebius 137290000Sglebius#----- src.zip 138290000Sglebius 139290000SglebiusSRC_ZIP_FILES = $(shell $(FIND) $(SRC_CLASSES_DIR) \( -name SCCS -o -name \*-template \) -prune -o -type f -print ) 14054359Sroberto 14154359SrobertoSRC_ZIP = $(LIB_DIR)/src.zip 14254359Sroberto$(SRC_ZIP): $(SRC_ZIP_FILES) 14354359Sroberto abs_src_zip=`cd $(@D) ; pwd`/$(@F) ; \ 14454359Sroberto ( cd $(SRC_CLASSES_DIR) ; $(FIND) . \( -name SCCS -o -name \*-template \) -prune -o -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; \ 14554359Sroberto ( cd $(GENSRC_DIR) ; $(FIND) . -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; 14654359Sroberto 147290000Sglebius#----- bin.zip 148290000Sglebius 149290000SglebiusBIN_ZIP_FILES = $(BUILD_DIR/lib/orb.idl $(BUILD_DIR)/lib/ir.idl 150290000Sglebius 151290000SglebiusBIN_ZIP = $(LIB_DIR)/bin.zip 152290000Sglebius$(BIN_ZIP): $(BIN_ZIP_FILES) 153290000Sglebius abs_bin_zip=`cd $(@D) ; pwd`/$(@F) ; \ 154290000Sglebius ( cd $(BUILD_DIR) ; $(FIND) lib -name "*.idl" -print | $(ZIP) -q $$abs_bin_zip -@ ) ; 155290000Sglebius 156290000Sglebius# 157290000Sglebius# CORBA 158290000Sglebius# 15954359SrobertoSUBDIRS = tools javax org sun com 16054359Sroberto 16154359Srobertobuild: 16254359Sroberto $(SUBDIRS-loop) 16354359Sroberto 16454359Srobertoall : build $(CLASSES_JAR) $(SRC_ZIP) $(BIN_ZIP) 16554359Sroberto 16654359Srobertoclean clobber: 167290000Sglebius $(RM) -r $(BUILD_DIR) 16854359Sroberto $(RM) -r $(DIST_DIR) 16954359Sroberto 170182007Sroberto#------------------------------------------------------------------- 17154359Sroberto# 17254359Sroberto# Targets for Sun's internal JPRT build system 17354359Sroberto 17454359SrobertoCD = cd 17554359SrobertoZIP = zip 17654359Sroberto 17754359SrobertoJPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip 17854359Sroberto 17954359Srobertojprt_build_product jprt_build_debug jprt_build_fastdebug: all 18054359Sroberto ( $(CD) $(OUTPUTDIR) && \ 18154359Sroberto $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist ) 18254359Sroberto 18354359Sroberto#------------------------------------------------------------------- 18454359Sroberto 18554359Sroberto 18654359Sroberto# 18754359Sroberto# Phonies to avoid accidents. 18854359Sroberto# 18954359Sroberto.PHONY: all build clean clobber debug jprt_build_product jprt_build_debug jprt_build_fastdebug 19054359Sroberto