langtools/src/share/opensource/javac/Makefile
author lmalvent
Mon, 10 Mar 2008 23:51:13 +0100
changeset 54 a007508f7193
parent 10 06bc494ca11e
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
#
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
# Copyright 2006-2007 Sun Microsystems, Inc.  All Rights Reserved.
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
#
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
# have any questions.
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
# Simple Makefile for javac
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
BUILD = build
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
BUILD_BOOTCLASSES = $(BUILD)/bootclasses
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
BUILD_CLASSES = $(BUILD)/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
BUILD_JAVAC_SRCFILES = $(BUILD)/javac.srcfiles
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
GENSRCDIR = $(BUILD)/gensrc
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
DIST = dist
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
DIST_JAVAC = $(DIST)
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
ABS_DIST_JAVAC = $(shell cd $(DIST_JAVAC) ; pwd)
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
SRC_BIN = src/bin
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
SRC_CLASSES = src/share/classes
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
#--------------------------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
#
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
# version info for generated compiler
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
JDK_VERSION = 1.7.0
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
RELEASE=$(JDK_VERSION)-opensource
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
BUILD_NUMBER = b00
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`)
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
#--------------------------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
CAT	= /bin/cat
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
CHMOD	= /bin/chmod
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
CP	= /bin/cp
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
MKDIR 	= /bin/mkdir
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
RM 	= /bin/rm
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
SED 	= /bin/sed
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
SYSTEM_UNAME := $(shell uname)
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
# Platform settings specific to Solaris
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
ifeq ($(SYSTEM_UNAME), SunOS)
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
  # Intrinsic unix command, with backslash-escaped character interpretation
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
  #   (not using -e  will cause build failure when using /bin/bash)
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
  #   (using -e breaks something else)
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
  ECHO           = /usr/bin/echo
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
  PLATFORM       = solaris
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
# Platform settings specific to Linux
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
ifeq ($(SYSTEM_UNAME), Linux)
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
  # Intrinsic unix command, with backslash-escaped character interpretation
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
  ECHO           = echo -e
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
  PLATFORM       = linux
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
# Set BOOTDIR to specify the JDK used to build the compiler
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
ifdef	BOOTDIR
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
JAR	= $(BOOTDIR)/bin/jar
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
JAVA	= $(BOOTDIR)/bin/java
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
JAVAC	= $(BOOTDIR)/bin/javac
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
JAVADOC = $(BOOTDIR)/bin/javadoc
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
else
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
JAR	= jar
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
JAVA	= java
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
JAVAC	= javac
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
JAVADOC = javadoc
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
ifndef JTREG
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
ifdef JTREG_HOME
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
JTREG   = $(JTREG_HOME)/$(PLATFORM)/bin/jtreg
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
else
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
JTREG	= jtreg
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
ifndef	JTREG_OPTS
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
JTREG_OPTS = -s -verbose:summary
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
ifndef	JTREG_TESTS
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
JTREG_TESTS = test/tools/javac
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
# Set this to the baseline version of JDK used for the tests
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
# TESTJDKHOME = 
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
COMPILER_SOURCE_LEVEL = 1.5
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
#--------------------------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
SCM_DIRS = -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
JAVAC_SRCS = $(shell find \
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
        $(SRC_CLASSES)/javax/annotation/processing \
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
        $(SRC_CLASSES)/javax/lang/model \
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
        $(SRC_CLASSES)/javax/tools \
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        $(SRC_CLASSES)/com/sun/source \
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        $(SRC_CLASSES)/com/sun/tools/javac \
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
	\( $(SCM_DIRS) -o -name \*-template.\* \) -prune -o -name \*.java -print )
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
JAVAC_RESOURCES = $(shell ls $(SRC_CLASSES)/com/sun/tools/javac/resources/*.properties | $(SED) -e 's/-template//' )
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
#--------------------------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
default: build
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
all: build docs
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
clean:
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
	$(RM) -rf $(BUILD) $(DIST)
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
build:	sanity $(DIST_JAVAC)/lib/javac.jar $(DIST_JAVAC)/bin/javac 
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
# javac.jar
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
$(DIST_JAVAC)/lib/javac.jar: \
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
		$(JAVAC_SRCS) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
		$(patsubst $(SRC_CLASSES)/%,$(BUILD_BOOTCLASSES)/%,$(JAVAC_RESOURCES)) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
		$(patsubst $(SRC_CLASSES)/%,$(BUILD_CLASSES)/%,$(JAVAC_RESOURCES)) 
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
	@$(ECHO) $(JAVAC_SRCS) > $(BUILD_JAVAC_SRCFILES)
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
	$(JAVAC) -d $(BUILD_BOOTCLASSES) -source $(COMPILER_SOURCE_LEVEL) -g:source,lines @$(BUILD_JAVAC_SRCFILES)
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
	$(JAVA) -cp $(BUILD_BOOTCLASSES) com.sun.tools.javac.Main \
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
		-d $(BUILD_CLASSES) -g:source,lines @$(BUILD_JAVAC_SRCFILES)
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
	( $(ECHO) "Main-Class: com.sun.tools.javac.Main" ; \
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
	  $(ECHO) "Built-By: $$USER" ; \
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
	  $(ECHO) "Built-At: `date`" ) > $(BUILD)/javac.MF
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
	$(MKDIR) -p $(DIST_JAVAC)/lib
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
	$(JAR) -cmf $(BUILD)/javac.MF $(DIST_JAVAC)/lib/javac.jar -C ${BUILD_CLASSES} .
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
# javac resources
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
$(BUILD_BOOTCLASSES)/com/sun/tools/javac/resources/version.properties \
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
$(BUILD_CLASSES)/com/sun/tools/javac/resources/version.properties: \
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
		$(SRC_CLASSES)/com/sun/tools/javac/resources/version-template.properties
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
	$(SED) 	-e 's/$$(JDK_VERSION)/$(JDK_VERSION)/'  \
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
		-e 's/$$(FULL_VERSION)/$(FULL_VERSION)/' \
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
		-e 's/$$(RELEASE)/$(RELEASE)/' \
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
		< $< > $@
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
$(BUILD_BOOTCLASSES)/com/sun/tools/javac/resources/%.properties: \
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
		$(SRC_CLASSES)/com/sun/tools/javac/resources/%.properties
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
	$(CP) $^ $@
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
$(BUILD_CLASSES)/com/sun/tools/javac/resources/%.properties: \
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
		$(SRC_CLASSES)/com/sun/tools/javac/resources/%.properties
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
	$(CP) $^ $@
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
# javac wrapper script
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
$(DIST_JAVAC)/bin/javac: $(SRC_BIN)/javac.sh
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
	$(MKDIR) -p $(@D)
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
	$(CP) $^ $@
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
	$(CHMOD) +x $@
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
# javadoc
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
JLS3_URL = http://java.sun.com/docs/books/jls/
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
JLS3_CITE = <a href="$(JLS3_URL)"> \
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
		The Java Language Specification, Third Edition</a>
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
TAG_JLS3 = -tag 'jls3:a:See <cite>$(JLS3_CITE)</cite>:'
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
TAGS = $(IGNORED_TAGS:%=-tag %:X) $(TAG_JLS3)
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
docs:	
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
	$(JAVADOC) -sourcepath $(SRC_CLASSES) -d $(DIST_JAVAC)/doc/api \
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
	    $(TAGS) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
            -subpackages javax.annotation.processing:javax.lang.model:javax.tools:com.sun.source:com.sun.tools.javac
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
#--------------------------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
test: test-sanity $(DIST_JAVAC)/lib/javac.jar
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
	$(JTREG) $(JTREG_OPTS) -noshell \
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
		-jdk:$(TESTJDKHOME) \
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
		-Xbootclasspath/p:$(ABS_DIST_JAVAC)/lib/javac.jar \
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
		-w:$(BUILD)/jtreg/work \
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
		-r:$(BUILD)/jtreg/report \
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
		$(JTREG_TESTS)
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
#--------------------------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
ifndef ERROR_FILE
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
  ERROR_FILE   = $(BUILD)/sanityCheckErrors.txt
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
presanity:
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
	@$(RM) -f $(ERROR_FILE)
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
	@$(MKDIR) -p `dirname $(ERROR_FILE)`
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
######################################################
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
# CLASSPATH cannot be set, unless you are insane.
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
######################################################
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
sane-classpath:
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
ifdef CLASSPATH
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
	@$(ECHO) "ERROR: Your CLASSPATH environment variable is set.  This will \n" \
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
	   "      most likely cause the build to fail.  Please unset it \n" \
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
	   "      and start your build again. \n" \
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
	   "" >> $(ERROR_FILE)
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
######################################################
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
# JAVA_HOME cannot be set, unless you are insane.
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
######################################################
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
sane-java_home:
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
ifdef JAVA_HOME
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
	@$(ECHO) "ERROR: Your JAVA_HOME environment variable is set.  This will \n" \
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
	   "      most likely cause the build to fail.  Please unset it \n" \
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
	   "      and start your build again. \n" \
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
	   "" >> $(ERROR_FILE)
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
######################################################
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
# TESTJDKHOME needs to be set to run tests
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
######################################################
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
sane-testjdk:
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
ifndef TESTJDKHOME
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
	@$(ECHO) "ERROR: TESTJDKHOME needs to be set to the baseline version \n" \
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
	   "     version of JDK used to run the compiler tests.\n" \
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
	   "" >> $(ERROR_FILE)
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
endif
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
sane-lastrule:
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
	@if [ -r $(ERROR_FILE) ]; then \
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
	  if [ "x$(INSANE)" = x ]; then \
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
	    $(ECHO) "Exiting because of the above error(s). \n" \
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
	      "">> $(ERROR_FILE); \
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
	  fi ; \
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
	  $(CAT) $(ERROR_FILE) ; \
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
	  if [ "x$(INSANE)" = x ]; then \
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
	    exit 1 ; \
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
	  fi ; \
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
	fi
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
sanity \
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
build-sanity: presanity sane-classpath sane-java_home sane-lastrule
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
test-sanity: presanity sane-classpath sane-java_home sane-testjdk sane-lastrule
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
#--------------------------------------------------------------------------------
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
.PHONY: all build clean default docs prep test \
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
	presanity sanity build-sanity test-sanity \
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
	sane-classpath sane-java_home sane-testjdk sane-lastrule