nashorn/make/BuildNashorn.gmk
changeset 25865 d38d876f1654
parent 23367 20c3810174dc
child 26892 97093836f3b7
--- a/nashorn/make/BuildNashorn.gmk	Sun Aug 10 19:39:07 2014 -0700
+++ b/nashorn/make/BuildNashorn.gmk	Sun Aug 17 15:56:32 2014 +0100
@@ -30,7 +30,8 @@
 include MakeBase.gmk
 include JavaCompilation.gmk
 
-JDK_CLASSES := $(JDK_OUTPUTDIR)/classes
+JDK_CLASSES := $(subst $(SPACE),$(PATH_SEP),$(strip $(addprefix $(JDK_OUTPUTDIR)/modules/, \
+      java.base java.logging java.scripting)))
 
 NASHORN_JAR := $(NASHORN_DIST)/nashorn.jar
 NASHORN_VERSION := $(JDK_VERSION)
@@ -46,19 +47,19 @@
 $(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \
     JVM := $(JAVA), \
     JAVAC := $(NEW_JAVAC), \
-    FLAGS := -g -source 7 -target 7 -bootclasspath $(JDK_CLASSES), \
+    FLAGS := -g -source 7 -target 7 -bootclasspath "$(JDK_CLASSES)", \
     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
 
 # Build nashorn into intermediate directory
 $(eval $(call SetupJavaCompilation,BUILD_NASHORN, \
     SETUP := GENERATE_NEWBYTECODE_DEBUG, \
-    SRC := $(NASHORN_TOPDIR)/src, \
+    SRC := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes, \
     COPY := .properties .js, \
     BIN := $(NASHORN_OUTPUTDIR)/nashorn_classes))
 
 NASGEN_SRC := $(NASHORN_TOPDIR)/buildtools/nasgen/src
-ASM_SRC := $(JDK_TOPDIR)/src/share/classes/jdk/internal/org/objectweb/asm
+ASM_SRC := $(JDK_TOPDIR)/src/java.base/share/classes/jdk/internal/org/objectweb/asm
 
 # Build nasgen
 $(eval $(call SetupJavaCompilation,BUILD_NASGEN, \
@@ -70,8 +71,11 @@
 # Nasgen needs nashorn classes
 $(BUILD_NASGEN): $(BUILD_NASHORN)
 
+NASHORN_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn
+NASGEN_RUN_FILE := $(NASHORN_CLASSES_DIR)/_the.nasgen.run
+
 # Copy classes to final classes dir and run nasgen to modify classes in jdk.nashorn.internal.objects package
-$(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run: $(BUILD_NASGEN)
+$(NASGEN_RUN_FILE): $(BUILD_NASGEN)
 	$(ECHO) Running nasgen
 	$(MKDIR) -p $(@D)
 	$(RM) -rf $(@D)/jdk $(@D)/netscape
@@ -82,11 +86,12 @@
 	$(TOUCH) $@
 
 # Version file needs to be processed with version numbers
-VERSION_FILE := $(NASHORN_OUTPUTDIR)/classes/jdk/nashorn/internal/runtime/resources/version.properties
+VERSION_FILE := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn/jdk/nashorn/internal/runtime/resources/version.properties
+VERSION_SRC := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties-template
 
 # Needs to happen after nasgen run since nasgen run deletes it
-$(VERSION_FILE): $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run
-$(VERSION_FILE): $(NASHORN_TOPDIR)/src/jdk/nashorn/internal/runtime/resources/version.properties-template
+$(VERSION_FILE): $(NASGEN_RUN_FILE)
+$(VERSION_FILE): $(VERSION_SRC)
 	$(ECHO) Creating version.properties
 	$(MKDIR) -p $(@D)
 	$(CAT) $< | $(SED) -e 's/$$(FULL_VERSION)/$(NASHORN_FULL_VERSION)/g' \
@@ -98,15 +103,16 @@
 
 # Create nashorn.jar from the final classes dir
 $(eval $(call SetupArchive,BUILD_NASHORN_JAR, \
-    $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run \
+    $(NASGEN_RUN_FILE) \
     $(VERSION_FILE), \
-    SRCS := $(NASHORN_OUTPUTDIR)/classes, \
+    SRCS := $(NASHORN_CLASSES_DIR), \
     SUFFIXES := .class .js .properties Factory, \
-    MANIFEST := $(NASHORN_TOPDIR)/src/META-INF/MANIFEST.MF, \
+    MANIFEST := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/META-INF/MANIFEST.MF, \
     EXTRA_MANIFEST_ATTR := $(MANIFEST_ATTRIBUTES), \
     SKIP_METAINF := true, \
     JAR := $(NASHORN_JAR)))
 
+compile: $(NASHORN_RUN_FILE) $(VERSION_FILE)
 all: $(NASHORN_JAR)
 
-.PHONY: all
+.PHONY: compile all