jdk/make/lib/LibCommon.gmk
changeset 27565 729f9700483a
parent 26192 33b90e93e3bf
child 27799 097b1d6f6894
--- a/jdk/make/lib/LibCommon.gmk	Tue Nov 18 15:25:16 2014 -0800
+++ b/jdk/make/lib/LibCommon.gmk	Wed Dec 03 14:22:58 2014 +0000
@@ -23,8 +23,6 @@
 # questions.
 #
 
-default: all
-
 include $(SPEC)
 include MakeBase.gmk
 include NativeCompilation.gmk
@@ -34,16 +32,9 @@
 
 GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
 
-# Put the libraries here. Different locations for different target apis.
-ifeq ($(OPENJDK_TARGET_OS_API), posix)
-  INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
-else
-  INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/bin
-endif
-
 # Absolute paths to lib files on windows for use in LDFLAGS. Should figure out a more
 # elegant solution to this.
-WIN_JAVA_LIB := $(JDK_OUTPUTDIR)/objs/libjava/java.lib
+WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
 
 # Use this variable to set DEBUG_SYMBOLS true on windows for all libraries, but
 # not on other platforms.
@@ -57,24 +48,45 @@
 endif
 
 ################################################################################
-
 # Find the default set of src dirs for a native library.
 # Param 1 - module name
 # Param 2 - library name
-FindSrcDirsForLib = $(call uniq, $(wildcard \
-    $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
-    $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_API_DIR)/native/lib$(strip $2) \
-    $(JDK_TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
+define FindSrcDirsForLib 
+  $(call uniq, $(wildcard \
+      $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
+      $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_API_DIR)/native/lib$(strip $2) \
+      $(JDK_TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
+endef
 
 ################################################################################
+# Find lib dir for module
+# Param 1 - module name
+ifeq ($(OPENJDK_TARGET_OS_API), posix)
+  define FindLibDirForModule
+    $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)$(OPENJDK_TARGET_CPU_LIBDIR)
+  endef
+else
+  define FindLibDirForModule
+    $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
+  endef
+endif
 
-# A lot of libraries are dependent on libjava. Define the name of that
-# library here to make dependency declarations to it possible in other files.
-BUILD_LIBJAVA := $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX)
+################################################################################
+# Find a library
+# Param 1 - module name
+# Param 2 - library name
+# Param 3 - subdir for library
+define FindLib
+  $(call FindLibDirForModule, $(strip $1))$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(SHARED_LIBRARY_SUFFIX)
+endef
 
-# Also define the header include flags needed to compile against it.
+################################################################################
+# Define the header include flags needed to compile against it.
 LIBJAVA_HEADER_FLAGS := $(addprefix -I, $(call FindSrcDirsForLib, java.base, java))
 
+# Put the libraries here.
+INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE))
+
 ################################################################################
 
 # Define it here since there are multiple uses.