1 #
   2 # Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
   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.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #
  23 #
  24 
  25 macosx_product:
  26         $(MAKE) all_product_macosx
  27 macosx_optimized:
  28         $(MAKE) all_optimized_macosx
  29 macosx_fastdebug:
  30         $(MAKE) all_fastdebug_macosx
  31 macosx_debug:
  32         $(MAKE) all_debug_macosx
  33 
  34 
  35 all_product_macosx:
  36         $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_PRODUCT_TARGETS)
  37         $(QUIETLY) $(MAKE) BUILD_FLAVOR=product EXPORT_SUBDIR= binarize
  38 all_optimized_macosx:
  39         $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_OPTIMIZED_TARGETS)
  40         $(QUIETLY) $(MAKE) BUILD_FLAVOR=optimized EXPORT_SUBDIR=/optimized binarize
  41 all_fastdebug_macosx:
  42         $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_FASTDEBUG_TARGETS)
  43         $(QUIETLY) $(MAKE) BUILD_FLAVOR=fastdebug EXPORT_SUBDIR=/fastdebug binarize
  44 all_debug_macosx:
  45         $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_DEBUG_TARGETS)
  46         $(QUIETLY) $(MAKE) BUILD_FLAVOR=debug EXPORT_SUBDIR=/debug binarize
  47 
  48 
  49 binarize: $(MACOSX_COPY_LIST)
  50         $(RM) -r $(EXPORT_PATH)/lib/amd64
  51 
  52 # Copy built binaries in place
  53 # - copies directories; including empty dirs
  54 # - copies files, symlinks, other non-directory files
  55 $(MACOSX_COPY_LIST):
  56         BUILT_COPY_FILES="`find $(EXPORT_LIB_DIR)/amd64/$(subst $(EXPORT_LIB_DIR)/,,$@) -prune 2>/dev/null`" || test $$? = "1"; \
  57         if [ -n "$${BUILT_COPY_FILES}" ]; then \
  58           for i in $${BUILT_COPY_FILES}; do \
  59             $(MKDIR) -p $(shell dirname $@); \
  60             $(CP) -R $${i} $@; \
  61           done; \
  62         fi
  63 
  64 
  65 # Do not touch lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
  66 # That symbolic link belongs to the 'jdk' build.
  67 export_macosx:
  68         $(RM) -r $(EXPORT_PATH)/lib/amd64
  69         $(RM) -r $(JDK_IMAGE_DIR)/lib/amd64
  70         ($(CD) $(EXPORT_PATH) && \
  71           $(TAR) -cf - *) | \
  72           ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xpf -)
  73 
  74 
  75 # Do not touch lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
  76 # That symbolic link belongs to the 'jdk' build.
  77 copy_macosx:
  78         $(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/lib/amd64
  79         ($(CD) $(EXPORT_PATH)$(COPY_SUBDIR) && \
  80           $(TAR) -cf - *) | \
  81           ($(CD) $(JDK_IMAGE_DIR)$(COPY_SUBDIR) && $(TAR) -xpf -)
  82 
  83 
  84 # Additional processing
  85 export_product_jdk::
  86         $(MAKE) EXPORT_SUBDIR=           export_macosx
  87 export_optimized_jdk::
  88         $(MAKE) EXPORT_SUBDIR=/optimized export_macosx
  89 export_fastdebug_jdk::
  90         $(MAKE) EXPORT_SUBDIR=/fastdebug export_macosx
  91 export_debug_jdk::
  92         $(MAKE) EXPORT_SUBDIR=/debug     export_macosx
  93 copy_product_jdk::
  94         $(MAKE) COPY_SUBDIR=             copy_macosx
  95 copy_optimized_jdk::
  96         $(MAKE) COPY_SUBDIR=/optimized   copy_macosx
  97 copy_fastdebug_jdk::
  98         $(MAKE) COPY_SUBDIR=/fastdebug   copy_macosx
  99 copy_debug_jdk::
 100         $(MAKE) COPY_SUBDIR=/debug       copy_macosx
 101 
 102 .PHONY: macosx_product macosx_fastdebug macosx_debug \
 103         all_product_macosx all_fastdebug_macosx all_debug_macosx \
 104         macosx_optimized all_optimized_macosx \
 105         binarize export_macosx copy_macosx \
 106         $(MACOSX_COPY_LIST)