author | yan |
Wed, 11 Jun 2014 17:23:56 +0400 | |
changeset 25191 | a41ac4e87fc4 |
parent 22703 | 322d8adeabe1 |
permissions | -rw-r--r-- |
14270 | 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 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
# This must be the first rule |
|
27 |
default: all |
|
28 |
||
29 |
include $(SPEC) |
|
30 |
include MakeBase.gmk |
|
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 | 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 | 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 | 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 | 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 | 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 | 55 |
$(MKDIR) -p $(@D) |
56 |
$(MKDIR) -p $(LANGTOOLS_OUTPUTDIR)/tmpstubs |
|
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 | 61 |
$(ECHO) $(LOG_INFO) No changes in the stubs!; \ |
62 |
$(RM) -r $(LANGTOOLS_OUTPUTDIR)/tmpstubs; \ |
|
63 |
else \ |
|
64 |
$(ECHO) $(LOG_INFO) Changes in stubs detected!; \ |
|
65 |
$(RM) -r $(@D); \ |
|
66 |
$(MV) $(LANGTOOLS_OUTPUTDIR)/tmpstubs $(@D); \ |
|
67 |
fi |
|
22703
322d8adeabe1
8026773: Failing compilation in Corba does not fail the build
erikj
parents:
21888
diff
changeset
|
68 |
$(TOUCH) $@ |
14270 | 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 |