1 # |
1 # |
2 # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
2 # Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # |
4 # |
5 # This code is free software; you can redistribute it and/or modify it |
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 |
6 # under the terms of the GNU General Public License version 2 only, as |
7 # published by the Free Software Foundation. Oracle designates this |
7 # published by the Free Software Foundation. Oracle designates this |
29 -include $(SPEC) |
29 -include $(SPEC) |
30 include MakeBase.gmk |
30 include MakeBase.gmk |
31 include JarArchive.gmk |
31 include JarArchive.gmk |
32 include JavaCompilation.gmk |
32 include JavaCompilation.gmk |
33 include SetupJavaCompilers.gmk |
33 include SetupJavaCompilers.gmk |
|
34 include TextFileProcessing.gmk |
34 |
35 |
35 JDK_CLASSES := $(call PathList, $(strip $(addprefix $(JDK_OUTPUTDIR)/modules/, \ |
36 JDK_CLASSES := $(call PathList, $(strip $(addprefix $(JDK_OUTPUTDIR)/modules/, \ |
36 java.base java.logging java.scripting))) |
37 java.base java.logging java.scripting))) |
37 |
38 |
38 NASHORN_JAR := $(IMAGES_OUTPUTDIR)/nashorn.jar |
39 NASHORN_JAR := $(IMAGES_OUTPUTDIR)/nashorn.jar |
39 NASHORN_VERSION := $(JDK_VERSION) |
|
40 NASHORN_FULL_VERSION := $(FULL_VERSION) |
|
41 |
|
42 ifdef MILESTONE |
|
43 ifeq ($(MILESTONE), internal) |
|
44 NASHORN_VERSION = $(FULL_VERSION) |
|
45 endif |
|
46 endif |
|
47 |
40 |
48 # Need to use source and target 8 for nasgen to work. |
41 # Need to use source and target 8 for nasgen to work. |
49 $(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \ |
42 $(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \ |
50 JVM := $(JAVA), \ |
43 JVM := $(JAVA), \ |
51 JAVAC := $(NEW_JAVAC), \ |
44 JAVAC := $(NEW_JAVAC), \ |
91 $(SUPPORT_OUTPUTDIR)/special_classes/jdk.scripting.nashorn/classes) \ |
84 $(SUPPORT_OUTPUTDIR)/special_classes/jdk.scripting.nashorn/classes) \ |
92 jdk.nashorn.internal.tools.nasgen.Main $(@D) jdk.nashorn.internal.objects $(@D) |
85 jdk.nashorn.internal.tools.nasgen.Main $(@D) jdk.nashorn.internal.objects $(@D) |
93 $(TOUCH) $@ |
86 $(TOUCH) $@ |
94 |
87 |
95 # Version file needs to be processed with version numbers |
88 # Version file needs to be processed with version numbers |
96 VERSION_FILE := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn/jdk/nashorn/internal/runtime/resources/version.properties |
89 $(eval $(call SetupTextFileProcessing, BUILD_VERSION_FILE, \ |
97 VERSION_SRC := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties-template |
90 SOURCE_FILES := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties.template, \ |
|
91 OUTPUT_FILE := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn/jdk/nashorn/internal/runtime/resources/version.properties, \ |
|
92 REPLACEMENTS := \ |
|
93 @@VERSION_STRING@@ => $(VERSION_STRING) ; \ |
|
94 @@VERSION_SHORT@@ => $(VERSION_SHORT) , \ |
|
95 )) |
98 |
96 |
99 # Needs to happen after nasgen run since nasgen run deletes it |
97 # Version processing needs to happen after nasgen run since nasgen run deletes it |
100 $(VERSION_FILE): $(NASGEN_RUN_FILE) |
98 $(BUILD_VERSION_FILE): $(NASGEN_RUN_FILE) |
101 $(VERSION_FILE): $(VERSION_SRC) |
|
102 $(ECHO) Creating version.properties |
|
103 $(MKDIR) -p $(@D) |
|
104 $(CAT) $< | $(SED) -e 's/$$(FULL_VERSION)/$(NASHORN_FULL_VERSION)/g' \ |
|
105 -e 's/$$(RELEASE)/$(NASHORN_VERSION)/g' \ |
|
106 -e '/^#.*$$/d' -e '/^$$/d' > $@ |
|
107 |
99 |
108 |
100 |
109 MANIFEST_ATTRIBUTES := Name: jdk/nashorn/\nImplementation-Title: Oracle Nashorn\nImplementation-Version: $(NASHORN_FULL_VERSION) |
101 MANIFEST_ATTRIBUTES := Name: jdk/nashorn/\nImplementation-Title: Oracle Nashorn\nImplementation-Version: $(VERSION_SHORT) |
110 |
102 |
111 # Create nashorn.jar from the final classes dir |
103 # Create nashorn.jar from the final classes dir |
112 $(eval $(call SetupJarArchive, BUILD_NASHORN_JAR, \ |
104 $(eval $(call SetupJarArchive,BUILD_NASHORN_JAR, \ |
113 DEPENDENCIES := $(NASGEN_RUN_FILE) \ |
105 DEPENDENCIES := $(NASGEN_RUN_FILE) $(BUILD_VERSION_FILE), \ |
114 $(VERSION_FILE), \ |
|
115 SRCS := $(NASHORN_CLASSES_DIR), \ |
106 SRCS := $(NASHORN_CLASSES_DIR), \ |
116 SUFFIXES := .class .js .properties Factory, \ |
107 SUFFIXES := .class .js .properties Factory, \ |
117 MANIFEST := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/META-INF/MANIFEST.MF, \ |
108 MANIFEST := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/META-INF/MANIFEST.MF, \ |
118 EXTRA_MANIFEST_ATTR := $(MANIFEST_ATTRIBUTES), \ |
109 EXTRA_MANIFEST_ATTR := $(MANIFEST_ATTRIBUTES), \ |
119 SKIP_METAINF := true, \ |
110 SKIP_METAINF := true, \ |
120 JAR := $(NASHORN_JAR), \ |
111 JAR := $(NASHORN_JAR), \ |
121 )) |
112 )) |
122 |
113 |
123 compile: $(NASHORN_RUN_FILE) $(VERSION_FILE) |
114 compile: $(NASHORN_RUN_FILE) $(BUILD_VERSION_FILE) |
124 all: $(NASHORN_JAR) |
115 all: $(NASHORN_JAR) |
125 |
116 |
126 .PHONY: compile all |
117 .PHONY: compile all |