common/makefiles/Jprt.gmk

Print this page




  26 # This file is included by the root NewerMakefile and contains targets 
  27 # and utilities needed by JPRT.
  28 
  29 # Utilities used in this Makefile. Most of this makefile executes without
  30 # the context of a spec file from configure.
  31 CAT=cat
  32 CMP=cmp
  33 CP=cp
  34 ECHO=echo
  35 MKDIR=mkdir
  36 PRINTF=printf
  37 PWD=pwd
  38 # Insure we have a path that looks like it came from pwd
  39 #   (This is mostly for Windows sake and drive letters)
  40 define UnixPath # path
  41 $(shell (cd "$1" && $(PWD)))
  42 endef
  43 
  44 BUILD_DIR_ROOT:=$(root_dir)/build
  45 
  46 # Appears to be an open build
  47 OPEN_BUILD := \
  48 $(shell \
  49   if [    -d $(root_dir)/jdk/src/closed      \
  50        -o -d $(root_dir)/jdk/make/closed     \
  51        -o -d $(root_dir)/jdk/test/closed     \
  52        -o -d $(root_dir)/hotspot/src/closed  \
  53        -o -d $(root_dir)/hotspot/make/closed \
  54        -o -d $(root_dir)/hotspot/test/closed ] ; then \
  55     echo "false"; \
  56   else \
  57     echo "true"; \
  58   fi \
  59  )
  60 ifdef OPENJDK
  61   OPEN_BUILD=true








  62 endif
  63 


  64 ###########################################################################
  65 # To help in adoption of the new configure&&make build process, a bridge
  66 #   build will use the old settings to run configure and do the build.
  67 
  68 # Build with the configure bridge. After running configure, restart make
  69 # to parse the new spec file.
  70 BRIDGE_TARGETS := all
  71 bridgeBuild: bridge2configure
  72         @cd $(root_dir) && $(MAKE) -f NewMakefile.gmk $(BRIDGE_TARGETS)
  73 
  74 # Bridge from old Makefile ALT settings to configure options
  75 bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts
  76         bash ./configure $(strip $(shell $(CAT) $<))
  77 
  78 # Create a file with configure options created from old Makefile mechanisms.
  79 $(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest
  80         $(RM) $@
  81         $(CP) $< $@
  82 
  83 # Use this file to only change when obvious things have changed


  85         $(RM) $@.tmp
  86         $(MKDIR) -p $(BUILD_DIR_ROOT)
  87         @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp
  88 ifdef ARCH_DATA_MODEL
  89         @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp
  90 endif
  91 ifeq ($(ARCH_DATA_MODEL),32)
  92         @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp
  93 endif
  94 ifdef ALT_PARALLEL_COMPILE_JOBS
  95         @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp
  96 endif
  97 ifdef ALT_BOOTDIR
  98         @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp
  99 endif
 100 ifdef ALT_CUPS_HEADERS_PATH
 101         @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp
 102 endif
 103 ifdef ALT_FREETYPE_HEADERS_PATH
 104         @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp





 105 endif
 106 ifeq ($(OPEN_BUILD),true)
 107         @$(ECHO) " --enable-openjdk-only " >> $@.tmp
 108 else
 109   # Todo: move to closed?
 110   ifdef ALT_MOZILLA_HEADERS_PATH
 111         @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp
 112   endif
 113   ifdef ALT_JUNIT_DIR
 114         @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp
 115   endif
 116   ifdef ANT_HOME
 117         @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp
 118   endif
 119   ifdef ALT_JAVAFX_ZIP_DIR
 120         @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp
 121   endif
 122   ifdef ALT_WIXDIR
 123         @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp
 124   endif




  26 # This file is included by the root NewerMakefile and contains targets 
  27 # and utilities needed by JPRT.
  28 
  29 # Utilities used in this Makefile. Most of this makefile executes without
  30 # the context of a spec file from configure.
  31 CAT=cat
  32 CMP=cmp
  33 CP=cp
  34 ECHO=echo
  35 MKDIR=mkdir
  36 PRINTF=printf
  37 PWD=pwd
  38 # Insure we have a path that looks like it came from pwd
  39 #   (This is mostly for Windows sake and drive letters)
  40 define UnixPath # path
  41 $(shell (cd "$1" && $(PWD)))
  42 endef
  43 
  44 BUILD_DIR_ROOT:=$(root_dir)/build
  45 














  46 ifdef OPENJDK
  47   OPEN_BUILD=true
  48 else
  49   OPEN_BUILD := $(if $(or $(wildcard $(root_dir)/jdk/src/closed), \
  50                           $(wildcard $(root_dir)/jdk/make/closed), \
  51                           $(wildcard $(root_dir)/jdk/test/closed), \
  52                           $(wildcard $(root_dir)/hotspot/src/closed), \
  53                           $(wildcard $(root_dir)/hotspot/make/closed), \
  54                           $(wildcard $(root_dir)/hotspot/test/closed)), \
  55                      false,true)
  56 endif
  57 
  58 HOTSPOT_AVAILABLE := $(if $(wildcard $(root_dir)/hotspot),true,false)
  59 
  60 ###########################################################################
  61 # To help in adoption of the new configure&&make build process, a bridge
  62 #   build will use the old settings to run configure and do the build.
  63 
  64 # Build with the configure bridge. After running configure, restart make
  65 # to parse the new spec file.
  66 BRIDGE_TARGETS := all
  67 bridgeBuild: bridge2configure
  68         @cd $(root_dir) && $(MAKE) -f NewMakefile.gmk $(BRIDGE_TARGETS)
  69 
  70 # Bridge from old Makefile ALT settings to configure options
  71 bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts
  72         bash ./configure $(strip $(shell $(CAT) $<))
  73 
  74 # Create a file with configure options created from old Makefile mechanisms.
  75 $(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest
  76         $(RM) $@
  77         $(CP) $< $@
  78 
  79 # Use this file to only change when obvious things have changed


  81         $(RM) $@.tmp
  82         $(MKDIR) -p $(BUILD_DIR_ROOT)
  83         @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp
  84 ifdef ARCH_DATA_MODEL
  85         @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp
  86 endif
  87 ifeq ($(ARCH_DATA_MODEL),32)
  88         @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp
  89 endif
  90 ifdef ALT_PARALLEL_COMPILE_JOBS
  91         @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp
  92 endif
  93 ifdef ALT_BOOTDIR
  94         @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp
  95 endif
  96 ifdef ALT_CUPS_HEADERS_PATH
  97         @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp
  98 endif
  99 ifdef ALT_FREETYPE_HEADERS_PATH
 100         @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp
 101 endif
 102 ifeq ($(HOTSPOT_AVAILABLE),false)
 103   ifdef ALT_JDK_IMPORT_PATH
 104         @$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> $@.tmp
 105   endif
 106 endif
 107 ifeq ($(OPEN_BUILD),true)
 108         @$(ECHO) " --enable-openjdk-only " >> $@.tmp
 109 else
 110   # Todo: move to closed?
 111   ifdef ALT_MOZILLA_HEADERS_PATH
 112         @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp
 113   endif
 114   ifdef ALT_JUNIT_DIR
 115         @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp
 116   endif
 117   ifdef ANT_HOME
 118         @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp
 119   endif
 120   ifdef ALT_JAVAFX_ZIP_DIR
 121         @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp
 122   endif
 123   ifdef ALT_WIXDIR
 124         @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp
 125   endif