Makefile revision 113:1c130e7b7a2e
11541Srgrimes# 21541Srgrimes# Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. 31541Srgrimes# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 41541Srgrimes# 51541Srgrimes# This code is free software; you can redistribute it and/or modify it 61541Srgrimes# under the terms of the GNU General Public License version 2 only, as 71541Srgrimes# published by the Free Software Foundation. Sun designates this 81541Srgrimes# particular file as subject to the "Classpath" exception as provided 91541Srgrimes# by Sun in the LICENSE file that accompanied this code. 101541Srgrimes# 111541Srgrimes# This code is distributed in the hope that it will be useful, but WITHOUT 121541Srgrimes# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 131541Srgrimes# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 141541Srgrimes# version 2 for more details (a copy is included in the LICENSE file that 151541Srgrimes# accompanied this code). 161541Srgrimes# 171541Srgrimes# You should have received a copy of the GNU General Public License version 181541Srgrimes# 2 along with this work; if not, write to the Free Software Foundation, 191541Srgrimes# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 201541Srgrimes# 211541Srgrimes# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 221541Srgrimes# CA 95054 USA or visit www.sun.com if you need additional information or 231541Srgrimes# have any questions. 241541Srgrimes# 251541Srgrimes 261541Srgrimes# 271541Srgrimes# Makefile for building the corba workspace. 281541Srgrimes# 2914505Shsu 3050477SpeterBUILDDIR=. 311541Srgrimesinclude $(BUILDDIR)/common/Defs.gmk 321541Srgrimesinclude $(BUILDDIR)/common/CancelImplicits.gmk 332165Spaul 342165Spaul#----- commands 352165Spaul 3615492SbdeCHMOD = chmod 3770834SwollmanCP = cp 38130380SrwatsonECHO = echo # FIXME 39130380SrwatsonFIND = find 401541SrgrimesMKDIR = mkdir 411541SrgrimesSED = sed 421541SrgrimesZIP = zip 431541Srgrimes 441541Srgrimes#----- locations and deliverables 451541Srgrimes 461541SrgrimesTOPDIR=.. 4736079SwollmanSRC_BIN_DIR = $(TOPDIR)/src/share/bin 4836079SwollmanSRC_CLASSES_DIR = $(TOPDIR)/src/share/classes 49129958Srwatson 50129958Srwatsonifdef ALT_OUTPUTDIR 51129958Srwatson OUTPUTDIR = $(ALT_OUTPUTDIR) 52129958Srwatson BUILD_DIR = $(ALT_OUTPUTDIR) 53129958Srwatson DIST_DIR = $(ALT_OUTPUTDIR)/dist 54129958Srwatsonelse 55129958Srwatson OUTPUTDIR = .. 56129958Srwatson BUILD_DIR = $(TOPDIR)/build/$(PLATFORM)-$(ARCH) 57129958Srwatson DIST_DIR = $(TOPDIR)/dist 58131168Srwatsonendif 5995552StanimuraABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR)) 601541Srgrimes 61130387SrwatsonCLASSES_DIR = $(BUILD_DIR)/classes 62129958SrwatsonGENSRC_DIR = $(BUILD_DIR)/gensrc 6397658Stanimura 6497658StanimuraBIN_DIR = $(DIST_DIR)/bin 65130818SrwatsonLIB_DIR = $(DIST_DIR)/lib 66129979Srwatson 6798993Salfred#----- 68129958Srwatson 691541Srgrimesifndef JDK_MAJOR_VERSION 7013765Smpp JDK_MAJOR_VERSION = 1 711541Srgrimesendif 721541Srgrimes 7378913Sjlemonifndef JDK_MINOR_VERSION 7478913Sjlemon JDK_MINOR_VERSION = 7 751541Srgrimesendif 7678913Sjlemon 771541Srgrimesifndef JDK_MICRO_VERSION 781541Srgrimes JDK_MICRO_VERSION = 0 791541Srgrimesendif 80160604Srwatson 81129979Srwatsonifndef JDK_VERSION 82129979Srwatson JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) 83129979Srwatsonendif 84140730Sglebius 85140730Sglebiusifndef MILESTONE 8618787Spst MILESTONE = internal 87140730Sglebiusendif 88130527Srwatson 89131029Srwatson# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set 9097658Stanimuraifneq ($(MILESTONE),fcs) 9141087Struckman RELEASE = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE) 92131017Srwatsonelse 9397658Stanimura RELEASE = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE) 941541Srgrimesendif 951541Srgrimes 961541Srgrimes# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set 9783421Sobrienifdef BUILD_NUMBER 98100591Sjdp FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER) 99130380Srwatsonelse 100141052Sglebius BUILD_NUMBER = b00 101117708Srobert USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`) 102130527Srwatson FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER) 103130527Srwatsonendif 104130527Srwatson 105130527Srwatson#----- useful macros 106167715Sandre 107167715SandreSOURCE_LEVEL = 5 108130527SrwatsonBOOTSTRAP_TARGET_LEVEL = 5 109130527Srwatson 110130527Srwatsonifdef TARGET_CLASS_VERSION 111130527Srwatson TARGET_LEVEL = $(TARGET_CLASS_VERSION) 112130527Srwatsonelse 113130527Srwatson TARGET_LEVEL = 7 114130527Srwatsonendif 115130527Srwatson 1161541Srgrimesifndef TARGET_JAVA 117130818Srwatson TARGET_JAVA = java 118130818Srwatsonendif 119130818Srwatson 1201541SrgrimesSELF = $(lastword $(MAKEFILE_LIST)) 121131022Srwatson 122131022Srwatson# for jdk, we generate the following: 123131022Srwatson# dist/lib/classes.jar: 1241541Srgrimes# corba recompiled to run on the target JDK, 1251541Srgrimes# ready for inclusion in rt.jar 1261541Srgrimes# dist/lib/src.zip 1271541Srgrimes# .properties and .java files for classes in classes.jar, 1281541Srgrimes# ready for jdk src.zip 12936527Speter# dist/lib/bin.zip 1301541Srgrimes# corba specific binaries: orb.idl, ir.idl 13155943Sjasone 13259288Sjlemon# Default target 133166404Sandredefault: all 1341541Srgrimes 13597658Stanimura#----- classes.jar 13697658Stanimura 137130527SrwatsonCLASSES_JAR = $(LIB_DIR)/classes.jar 138130398Srwatson$(CLASSES_JAR): 139130398Srwatson $(MKDIR) -p $(@D) 140160605Srwatson $(BOOT_JAR_CMD) -cf $@ -C $(CLASSES_DIR) . 141131168Srwatson 142147852Sjhb#----- src.zip 14397658Stanimura 14497658StanimuraSRC_ZIP_FILES = $(shell $(FIND) $(SRC_CLASSES_DIR) \( -name \*-template \) -prune -o -type f -print ) 14597658Stanimura 14697658StanimuraSRC_ZIP = $(LIB_DIR)/src.zip 14797658Stanimura$(SRC_ZIP): $(SRC_ZIP_FILES) 1481541Srgrimes abs_src_zip=`cd $(@D) ; pwd`/$(@F) ; \ 1491541Srgrimes ( cd $(SRC_CLASSES_DIR) ; $(FIND) . \( -name \*-template \) -prune -o -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; \ 150121628Ssam ( cd $(GENSRC_DIR) ; $(FIND) . -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; 151121628Ssam 152121628Ssam#----- bin.zip 153121628Ssam 154121628SsamBIN_ZIP_FILES = $(BUILD_DIR/lib/orb.idl $(BUILD_DIR)/lib/ir.idl 155121628Ssam 156121628SsamBIN_ZIP = $(LIB_DIR)/bin.zip 1571541Srgrimes$(BIN_ZIP): $(BIN_ZIP_FILES) 158129979Srwatson abs_bin_zip=`cd $(@D) ; pwd`/$(@F) ; \ 159129979Srwatson ( cd $(BUILD_DIR) ; $(FIND) lib -name "*.idl" -print | $(ZIP) -q $$abs_bin_zip -@ ) ; 160129979Srwatson 161129979Srwatson# 162129979Srwatson# CORBA 163129979Srwatson# 164136682SrwatsonSUBDIRS = tools javax org sun com 165136682Srwatson 166130364Srwatsonbuild: 167130364Srwatson $(SUBDIRS-loop) 168129979Srwatson 169129979Srwatsonall : build $(CLASSES_JAR) $(SRC_ZIP) $(BIN_ZIP) 170130380Srwatson 171130380Srwatsonclean clobber: 172130380Srwatson $(RM) -r $(BUILD_DIR) 173130380Srwatson $(RM) -r $(DIST_DIR) 174130380Srwatson 175130380Srwatson#------------------------------------------------------------------- 176130380Srwatson# 177130380Srwatson# Targets for Sun's internal JPRT build system 178130380Srwatson 179130380SrwatsonCD = cd 180130380SrwatsonZIP = zip 181136326Srwatson 182130380SrwatsonJPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip 183130380Srwatson 184130380Srwatsonjprt_build_product jprt_build_debug jprt_build_fastdebug: all 185130380Srwatson ( $(CD) $(OUTPUTDIR) && \ 186130380Srwatson $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist ) 187130380Srwatson 188130380Srwatson#------------------------------------------------------------------- 189130380Srwatson 190130380Srwatson 191130380Srwatson# 192130380Srwatson# Phonies to avoid accidents. 193130380Srwatson# 194130492Srwatson.PHONY: all build clean clobber debug jprt_build_product jprt_build_debug jprt_build_fastdebug 1951541Srgrimes