langtools/make/GenstubsLangtools.gmk
author darcy
Thu, 17 Jul 2014 09:47:25 -0700
changeset 25690 b1dac768ab79
parent 22703 322d8adeabe1
permissions -rw-r--r--
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9 Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     1
#
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
     2
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     4
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    10
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    15
# accompanied this code).
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    16
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    20
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    23
# questions.
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    24
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    25
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    26
# This must be the first rule
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    27
default: all
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    28
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    29
include $(SPEC)
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    30
include MakeBase.gmk
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    31
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    32
include CommonLangtools.gmk
14556
e303c2c4c881 8003844: build-infra: docs target isn't working properly
erikj
parents: 14270
diff changeset
    33
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    34
# GenStubs is used to bootstrap any dependencies from javac to the new JDK that is not
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    35
# yet built. It is currently not needed but might be again in the future. The following
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    36
# exercises the functionality to verify that it works.
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    37
TOOL_GENSTUBS_CMD = $(JAVA) \
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    38
     "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" \
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    39
     genstubs.GenStubs
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    40
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    41
# We fetch source from the JDK...
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    42
JDKS := $(JDK_TOPDIR)/src/share/classes
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    43
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    44
# Build the list of classes to generate stubs from. java/util/function/Predicate.java isn't
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    45
# currently needed, but is used as a demo for now.
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    46
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    47
STUBSOURCES := $(shell $(FIND) $(JDKS) -name "*.java" | $(GREP) \
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    48
    -e "$(JDKS)/java/util/function/Predicate.java")
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    49
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    50
# Rewrite the file names into class names because the GenStubs tool require this.
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    51
STUBCLASSES := $(subst /,., $(patsubst $(JDKS)/%.java, %, $(STUBSOURCES)))
20623
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    52
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    53
# Now setup the build recipe for genstubs.
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    54
$(LANGTOOLS_OUTPUTDIR)/genstubs/_the_stubs: $(STUBSOURCES)
20623
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    55
	$(MKDIR) -p $(@D)
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    56
	$(MKDIR) -p $(LANGTOOLS_OUTPUTDIR)/tmpstubs
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    57
	$(ECHO) $(LOG_INFO) Generating stubs from JDK sources.
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    58
	$(TOOL_GENSTUBS_CMD) -s $(LANGTOOLS_OUTPUTDIR)/tmpstubs -sourcepath $(JDKS) $(STUBCLASSES)
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    59
	if $(DIFF) -x "_the*" -rq $(LANGTOOLS_OUTPUTDIR)/tmpstubs $(LANGTOOLS_OUTPUTDIR)/genstubs \
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    60
	    > /dev/null 2>&1; then \
20623
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    61
	  $(ECHO) $(LOG_INFO) No changes in the stubs!; \
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    62
	  $(RM) -r $(LANGTOOLS_OUTPUTDIR)/tmpstubs; \
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    63
	else \
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    64
	  $(ECHO) $(LOG_INFO) Changes in stubs detected!; \
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    65
	  $(RM) -r $(@D); \
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    66
	  $(MV) $(LANGTOOLS_OUTPUTDIR)/tmpstubs $(@D); \
cb61ea12e375 8001931: The new build system whitespace cleanup
ihse
parents: 17650
diff changeset
    67
	fi
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    68
	$(TOUCH) $@
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    69
22703
322d8adeabe1 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 21888
diff changeset
    70
all: $(LANGTOOLS_OUTPUTDIR)/genstubs/_the_stubs