make/Makefile

Tue, 28 Dec 2010 15:52:36 -0800

author
ohair
date
Tue, 28 Dec 2010 15:52:36 -0800
changeset 240
f90b3e014e83
parent 194
0f60cf26c5b5
child 544
9729f9862eb4
permissions
-rw-r--r--

6962318: Update copyright year
Reviewed-by: xdono

duke@1 1 #
ohair@240 2 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
duke@1 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 #
duke@1 5 # This code is free software; you can redistribute it and/or modify it
duke@1 6 # under the terms of the GNU General Public License version 2 only, as
ohair@158 7 # published by the Free Software Foundation. Oracle designates this
duke@1 8 # particular file as subject to the "Classpath" exception as provided
ohair@158 9 # by Oracle in the LICENSE file that accompanied this code.
duke@1 10 #
duke@1 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 # accompanied this code).
duke@1 16 #
duke@1 17 # You should have received a copy of the GNU General Public License version
duke@1 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 #
ohair@158 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@158 22 # or visit www.oracle.com if you need additional information or have any
ohair@158 23 # questions.
duke@1 24 #
duke@1 25
duke@1 26 #
duke@1 27 # Makefile for building the corba workspace.
duke@1 28 #
duke@1 29
duke@1 30 BUILDDIR=.
duke@1 31 include $(BUILDDIR)/common/Defs.gmk
duke@1 32 include $(BUILDDIR)/common/CancelImplicits.gmk
duke@1 33
duke@1 34 #----- commands
duke@1 35
duke@1 36 CHMOD = chmod
duke@1 37 CP = cp
duke@1 38 ECHO = echo # FIXME
duke@1 39 FIND = find
duke@1 40 MKDIR = mkdir
duke@1 41 SED = sed
duke@1 42 ZIP = zip
duke@1 43
duke@1 44 #----- locations and deliverables
duke@1 45
duke@1 46 TOPDIR=..
duke@1 47 SRC_BIN_DIR = $(TOPDIR)/src/share/bin
duke@1 48 SRC_CLASSES_DIR = $(TOPDIR)/src/share/classes
duke@1 49
duke@1 50 ifdef ALT_OUTPUTDIR
duke@1 51 OUTPUTDIR = $(ALT_OUTPUTDIR)
duke@1 52 BUILD_DIR = $(ALT_OUTPUTDIR)
duke@1 53 DIST_DIR = $(ALT_OUTPUTDIR)/dist
duke@1 54 else
duke@1 55 OUTPUTDIR = ..
duke@1 56 BUILD_DIR = $(TOPDIR)/build/$(PLATFORM)-$(ARCH)
duke@1 57 DIST_DIR = $(TOPDIR)/dist
duke@1 58 endif
duke@1 59 ABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR))
duke@1 60
duke@1 61 CLASSES_DIR = $(BUILD_DIR)/classes
duke@1 62 GENSRC_DIR = $(BUILD_DIR)/gensrc
duke@1 63
duke@1 64 LIB_DIR = $(DIST_DIR)/lib
duke@1 65
duke@1 66 #-----
duke@1 67
duke@1 68 ifndef JDK_MAJOR_VERSION
duke@1 69 JDK_MAJOR_VERSION = 1
duke@1 70 endif
duke@1 71
duke@1 72 ifndef JDK_MINOR_VERSION
duke@1 73 JDK_MINOR_VERSION = 7
duke@1 74 endif
duke@1 75
duke@1 76 ifndef JDK_MICRO_VERSION
duke@1 77 JDK_MICRO_VERSION = 0
duke@1 78 endif
duke@1 79
duke@1 80 ifndef JDK_VERSION
duke@1 81 JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
duke@1 82 endif
duke@1 83
duke@1 84 ifndef MILESTONE
duke@1 85 MILESTONE = internal
duke@1 86 endif
duke@1 87
duke@1 88 # RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set
duke@1 89 ifneq ($(MILESTONE),fcs)
duke@1 90 RELEASE = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE)
duke@1 91 else
duke@1 92 RELEASE = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE)
duke@1 93 endif
duke@1 94
duke@1 95 # FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set
duke@1 96 ifdef BUILD_NUMBER
duke@1 97 FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER)
duke@1 98 else
duke@1 99 BUILD_NUMBER = b00
duke@1 100 USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`)
duke@1 101 FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
duke@1 102 endif
duke@1 103
duke@1 104 #----- useful macros
duke@1 105
duke@1 106 SOURCE_LEVEL = 5
duke@1 107 BOOTSTRAP_TARGET_LEVEL = 5
jjg@83 108
jjg@83 109 ifdef TARGET_CLASS_VERSION
jjg@83 110 TARGET_LEVEL = $(TARGET_CLASS_VERSION)
jjg@83 111 else
jjg@100 112 TARGET_LEVEL = 7
jjg@83 113 endif
duke@1 114
duke@1 115 ifndef TARGET_JAVA
duke@1 116 TARGET_JAVA = java
duke@1 117 endif
duke@1 118
duke@1 119 SELF = $(lastword $(MAKEFILE_LIST))
duke@1 120
duke@1 121 # for jdk, we generate the following:
duke@1 122 # dist/lib/classes.jar:
duke@1 123 # corba recompiled to run on the target JDK,
duke@1 124 # ready for inclusion in rt.jar
duke@1 125 # dist/lib/src.zip
duke@1 126 # .properties and .java files for classes in classes.jar,
duke@1 127 # ready for jdk src.zip
duke@1 128 # dist/lib/bin.zip
duke@1 129 # corba specific binaries: orb.idl, ir.idl
duke@1 130
duke@1 131 # Default target
duke@1 132 default: all
duke@1 133
duke@1 134 #----- classes.jar
duke@1 135
duke@1 136 CLASSES_JAR = $(LIB_DIR)/classes.jar
duke@1 137 $(CLASSES_JAR):
duke@1 138 $(MKDIR) -p $(@D)
duke@1 139 $(BOOT_JAR_CMD) -cf $@ -C $(CLASSES_DIR) .
duke@1 140
duke@1 141 #----- src.zip
duke@1 142
ohair@114 143 SRC_ZIP_FILES = $(shell $(FIND) $(SRC_CLASSES_DIR) \( -name \*-template \) -prune -o -type f -print )
duke@1 144
duke@1 145 SRC_ZIP = $(LIB_DIR)/src.zip
duke@1 146 $(SRC_ZIP): $(SRC_ZIP_FILES)
duke@1 147 abs_src_zip=`cd $(@D) ; pwd`/$(@F) ; \
ohair@114 148 ( cd $(SRC_CLASSES_DIR) ; $(FIND) . \( -name \*-template \) -prune -o -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; \
duke@1 149 ( cd $(GENSRC_DIR) ; $(FIND) . -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ;
duke@1 150
duke@1 151 #----- bin.zip
duke@1 152
duke@1 153 BIN_ZIP_FILES = $(BUILD_DIR/lib/orb.idl $(BUILD_DIR)/lib/ir.idl
duke@1 154
duke@1 155 BIN_ZIP = $(LIB_DIR)/bin.zip
duke@1 156 $(BIN_ZIP): $(BIN_ZIP_FILES)
duke@1 157 abs_bin_zip=`cd $(@D) ; pwd`/$(@F) ; \
duke@1 158 ( cd $(BUILD_DIR) ; $(FIND) lib -name "*.idl" -print | $(ZIP) -q $$abs_bin_zip -@ ) ;
duke@1 159
duke@1 160 #
duke@1 161 # CORBA
duke@1 162 #
duke@1 163 SUBDIRS = tools javax org sun com
duke@1 164
duke@1 165 build:
duke@1 166 $(SUBDIRS-loop)
duke@1 167
duke@1 168 all : build $(CLASSES_JAR) $(SRC_ZIP) $(BIN_ZIP)
duke@1 169
duke@1 170 clean clobber:
duke@1 171 $(RM) -r $(BUILD_DIR)
duke@1 172 $(RM) -r $(DIST_DIR)
duke@1 173
duke@1 174 #-------------------------------------------------------------------
duke@1 175 #
duke@1 176 # Targets for Sun's internal JPRT build system
duke@1 177
duke@1 178 CD = cd
duke@1 179 ZIP = zip
duke@1 180
duke@1 181 JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
duke@1 182
duke@1 183 jprt_build_product jprt_build_debug jprt_build_fastdebug: all
duke@1 184 ( $(CD) $(OUTPUTDIR) && \
duke@1 185 $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist )
duke@1 186
duke@1 187 #-------------------------------------------------------------------
duke@1 188
duke@1 189
duke@1 190 #
duke@1 191 # Phonies to avoid accidents.
duke@1 192 #
duke@1 193 .PHONY: all build clean clobber debug jprt_build_product jprt_build_debug jprt_build_fastdebug

mercurial