Makefile revision 239:f90b3e014e83
117680Spst#
217680Spst# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
317680Spst# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
417680Spst#
517680Spst# This code is free software; you can redistribute it and/or modify it
617680Spst# under the terms of the GNU General Public License version 2 only, as
717680Spst# published by the Free Software Foundation.  Oracle designates this
817680Spst# particular file as subject to the "Classpath" exception as provided
917680Spst# by Oracle in the LICENSE file that accompanied this code.
1017680Spst#
1117680Spst# This code is distributed in the hope that it will be useful, but WITHOUT
1217680Spst# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1317680Spst# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1417680Spst# version 2 for more details (a copy is included in the LICENSE file that
1517680Spst# accompanied this code).
1617680Spst#
1717680Spst# You should have received a copy of the GNU General Public License version
1817680Spst# 2 along with this work; if not, write to the Free Software Foundation,
1917680Spst# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2017680Spst#
2117680Spst# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2217680Spst# or visit www.oracle.com if you need additional information or have any
2317680Spst# questions.
2417680Spst#
2517680Spst
2617680Spst#
2717680Spst# Makefile for building the corba workspace.
2817680Spst#
2917680Spst
3017680SpstBUILDDIR=.
3117680Spstinclude $(BUILDDIR)/common/Defs.gmk
3217680Spstinclude $(BUILDDIR)/common/CancelImplicits.gmk
3317680Spst
3417680Spst#----- commands
3517680Spst
3617680SpstCHMOD = chmod
3717680SpstCP = cp
3817680SpstECHO = echo # FIXME
3917680SpstFIND = find
4017680SpstMKDIR = mkdir
4117680SpstSED = sed
4217680SpstZIP = zip
4317680Spst
4417680Spst#-----  locations and deliverables
4517680Spst
4617680SpstTOPDIR=..
4717680SpstSRC_BIN_DIR = $(TOPDIR)/src/share/bin
4817680SpstSRC_CLASSES_DIR = $(TOPDIR)/src/share/classes
4917680Spst
5017680Spstifdef ALT_OUTPUTDIR
5117680Spst  OUTPUTDIR = $(ALT_OUTPUTDIR)
5217680Spst  BUILD_DIR = $(ALT_OUTPUTDIR)
5317680Spst  DIST_DIR = $(ALT_OUTPUTDIR)/dist
5417680Spstelse
5517680Spst  OUTPUTDIR = ..
5617680Spst  BUILD_DIR = $(TOPDIR)/build/$(PLATFORM)-$(ARCH)
5717680Spst  DIST_DIR = $(TOPDIR)/dist
5817680Spstendif
5917680SpstABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR))
6017680Spst
6117680SpstCLASSES_DIR = $(BUILD_DIR)/classes
6217680SpstGENSRC_DIR = $(BUILD_DIR)/gensrc
6317680Spst
6417680SpstLIB_DIR = $(DIST_DIR)/lib
6517680Spst
6617680Spst#-----
6717680Spst
6817680Spstifndef JDK_MAJOR_VERSION
6917680Spst  JDK_MAJOR_VERSION = 1
7017680Spstendif
7117680Spst
7217680Spstifndef JDK_MINOR_VERSION
7317680Spst  JDK_MINOR_VERSION = 7
7417680Spstendif
7517680Spst
7617680Spstifndef JDK_MICRO_VERSION
7717680Spst  JDK_MICRO_VERSION = 0
7817680Spstendif
7917680Spst
8017680Spstifndef JDK_VERSION
8117680Spst  JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
8217680Spstendif
8317680Spst
8417680Spstifndef MILESTONE
8517680Spst  MILESTONE = internal
8617680Spstendif
8717680Spst
8817680Spst# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set
8917680Spstifneq ($(MILESTONE),fcs)
9017680Spst  RELEASE       = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE)
9117680Spstelse
9217680Spst  RELEASE       = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE)
9317680Spstendif
9417680Spst
9517680Spst# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set
9617680Spstifdef BUILD_NUMBER
9717680Spst  FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER)
9817680Spstelse
9917680Spst  BUILD_NUMBER = b00
10017680Spst  USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`)
10117680Spst  FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
10217680Spstendif
10317680Spst
10417680Spst#----- useful macros
10517680Spst
10617680SpstSOURCE_LEVEL = 5
10717680SpstBOOTSTRAP_TARGET_LEVEL = 5
10817680Spst
10917680Spstifdef TARGET_CLASS_VERSION
11017680Spst    TARGET_LEVEL = $(TARGET_CLASS_VERSION)
11117680Spstelse
11217680Spst    TARGET_LEVEL = 7
11317680Spstendif
11417680Spst
11517680Spstifndef TARGET_JAVA
11617680Spst  TARGET_JAVA = java
11717680Spstendif
11817680Spst
11917680SpstSELF = $(lastword $(MAKEFILE_LIST))
12017680Spst
12117680Spst# for jdk, we generate the following:
12217680Spst# dist/lib/classes.jar:
12317680Spst#       corba recompiled to run on the target JDK,
12417680Spst#       ready for inclusion in rt.jar
12517680Spst# dist/lib/src.zip
12617680Spst#       .properties and .java files for classes in classes.jar,
12717680Spst#       ready for jdk src.zip
12817680Spst# dist/lib/bin.zip
12917680Spst#       corba specific binaries: orb.idl, ir.idl
13017680Spst
13117680Spst# Default target
13217680Spstdefault: all
13317680Spst
13417680Spst#----- classes.jar
13517680Spst
13617680SpstCLASSES_JAR = $(LIB_DIR)/classes.jar
13717680Spst$(CLASSES_JAR):
13817680Spst	$(MKDIR) -p $(@D)
13917680Spst	$(BOOT_JAR_CMD) -cf $@ -C $(CLASSES_DIR) .
14017680Spst
14117680Spst#----- src.zip
14217680Spst
14317680SpstSRC_ZIP_FILES = $(shell $(FIND) $(SRC_CLASSES_DIR) \( -name \*-template \) -prune -o -type f -print )
14417680Spst
14517680SpstSRC_ZIP = $(LIB_DIR)/src.zip
14617680Spst$(SRC_ZIP): $(SRC_ZIP_FILES)
14717680Spst	abs_src_zip=`cd $(@D) ; pwd`/$(@F) ; \
14817680Spst	( cd $(SRC_CLASSES_DIR) ; $(FIND) . \( -name \*-template \) -prune -o -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; \
14917680Spst	( cd $(GENSRC_DIR) ; $(FIND) . -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ;
15017680Spst
15117680Spst#----- bin.zip
15217680Spst
15317680SpstBIN_ZIP_FILES = $(BUILD_DIR/lib/orb.idl $(BUILD_DIR)/lib/ir.idl
15417680Spst
15517680SpstBIN_ZIP = $(LIB_DIR)/bin.zip
15617680Spst$(BIN_ZIP): $(BIN_ZIP_FILES)
15717680Spst	abs_bin_zip=`cd $(@D) ; pwd`/$(@F) ; \
15817680Spst	( cd $(BUILD_DIR) ; $(FIND) lib -name "*.idl" -print | $(ZIP) -q $$abs_bin_zip -@ ) ;
15917680Spst
16017680Spst#
16117680Spst# CORBA
16217680Spst#
16317680SpstSUBDIRS = tools javax org sun com
16417680Spst
16517680Spstbuild:
16617680Spst	$(SUBDIRS-loop)
16717680Spst
16817680Spstall : build $(CLASSES_JAR) $(SRC_ZIP) $(BIN_ZIP)
16917680Spst
17017680Spstclean clobber:
17117680Spst	$(RM) -r $(BUILD_DIR)
17217680Spst	$(RM) -r $(DIST_DIR)
17317680Spst
17417680Spst#-------------------------------------------------------------------
17517680Spst#
17617680Spst# Targets for Sun's internal JPRT build system
17717680Spst
17817680SpstCD = cd
17917680SpstZIP = zip
18017680Spst
18117680SpstJPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
18217680Spst
18317680Spstjprt_build_product jprt_build_debug jprt_build_fastdebug: all
18417680Spst	( $(CD) $(OUTPUTDIR) && \
18517680Spst	  $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist )
18617680Spst
18717680Spst#-------------------------------------------------------------------
18817680Spst
18917680Spst
19017680Spst#
19117680Spst# Phonies to avoid accidents.
19217680Spst#
19317680Spst.PHONY: all build clean clobber debug jprt_build_product jprt_build_debug jprt_build_fastdebug
19417680Spst