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