make/copy/CopyCommon.gmk
changeset 48355 4944950606ef
parent 48305 522601e6dd0d
child 49537 149dc554808c
--- a/make/copy/CopyCommon.gmk	Wed Dec 20 17:36:50 2017 +0100
+++ b/make/copy/CopyCommon.gmk	Wed Dec 20 09:14:06 2017 -0800
@@ -39,20 +39,12 @@
   $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE, \
       SRC := $(INCLUDE_SOURCE_DIR), \
       DEST := $(INCLUDE_TARGET_DIR), \
-      FILES := $(shell $(FIND) $(INCLUDE_SOURCE_DIR) -type f), \
+      FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_DIR))), \
   ))
 
   TARGETS += $(COPY_EXPORTED_INCLUDE)
 endif
 
-# For historical reasons, the OS include directories have odd names.
-INCLUDE_TARGET_OS_SUBDIR := $(OPENJDK_TARGET_OS)
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  INCLUDE_TARGET_OS_SUBDIR := win32
-else ifeq ($(OPENJDK_TARGET_OS), macosx)
-  INCLUDE_TARGET_OS_SUBDIR := darwin
-endif
-
 # Use the most specific of OS and OS_TYPE.
 INCLUDE_SOURCE_OS_DIR := $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS)/native/include
 ifeq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), )
@@ -62,8 +54,8 @@
 ifneq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), )
   $(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE_OS, \
       SRC := $(INCLUDE_SOURCE_OS_DIR), \
-      DEST := $(INCLUDE_TARGET_DIR)/$(INCLUDE_TARGET_OS_SUBDIR), \
-      FILES := $(shell $(FIND) $(INCLUDE_SOURCE_OS_DIR) -type f), \
+      DEST := $(INCLUDE_TARGET_DIR)/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR), \
+      FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_OS_DIR))), \
   ))
 
   TARGETS += $(COPY_EXPORTED_INCLUDE_OS)