make/bsd/makefiles/vm.make

Print this page
rev 3024 : 7132779: build-infra merge: Enable ccache to work for most developer builds.
Summary: When a build number is not specified, the JRE_RELEASE_VERSION define contains a date and timestamp. Thus ccache cannot cache the object files for longer than a minute since the define is passed to the compilation of all source files. This change passes JRE_RELEASE_VERSION only to vm_version.cpp and adds a function jre_release_version() to Abstract_VM_Version. This allows all other source files to be ccached.
Reviewed-by: ohair, rottenha
Contributed-by: fredrik.ohrstrom@oracle.com


  72   BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
  73 else
  74   BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
  75 endif
  76 
  77 # The following variables are defined in the generated flags.make file.
  78 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
  79 JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
  80 HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
  81 BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
  82 BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
  83 VM_DISTRO     = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
  84 
  85 CPPFLAGS =           \
  86   ${SYSDEFS}         \
  87   ${INCLUDES}        \
  88   ${BUILD_VERSION}   \
  89   ${BUILD_TARGET}    \
  90   ${BUILD_USER}      \
  91   ${HS_LIB_ARCH}     \
  92   ${JRE_VERSION}     \
  93   ${VM_DISTRO}





  94 
  95 ifdef DEFAULT_LIBPATH
  96 CPPFLAGS += -DDEFAULT_LIBPATH="\"$(DEFAULT_LIBPATH)\""
  97 endif
  98 
  99 ifndef JAVASE_EMBEDDED
 100 CFLAGS += -DINCLUDE_TRACE
 101 endif
 102 
 103 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
 104 CFLAGS += $(CFLAGS_WARN/BYFILE)
 105 
 106 # Do not use C++ exception handling
 107 CFLAGS += $(CFLAGS/NOEX)
 108 
 109 # Extra flags from gnumake's invocation or environment
 110 CFLAGS += $(EXTRA_CFLAGS)
 111 LFLAGS += $(EXTRA_CFLAGS)
 112 
 113 # Don't set excutable bit on stack segment




  72   BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
  73 else
  74   BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
  75 endif
  76 
  77 # The following variables are defined in the generated flags.make file.
  78 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
  79 JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
  80 HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
  81 BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
  82 BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
  83 VM_DISTRO     = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
  84 
  85 CPPFLAGS =           \
  86   ${SYSDEFS}         \
  87   ${INCLUDES}        \
  88   ${BUILD_VERSION}   \
  89   ${BUILD_TARGET}    \
  90   ${BUILD_USER}      \
  91   ${HS_LIB_ARCH}     \

  92   ${VM_DISTRO}
  93 
  94 # This is VERY important! The version define must only be supplied to vm_version.o
  95 # If not, ccache will not re-use the cache at all, since the version string might contain
  96 # a time and date. 
  97 vm_version.o: CPPFLAGS += ${JRE_VERSION} 
  98 
  99 ifdef DEFAULT_LIBPATH
 100 CPPFLAGS += -DDEFAULT_LIBPATH="\"$(DEFAULT_LIBPATH)\""
 101 endif
 102 
 103 ifndef JAVASE_EMBEDDED
 104 CFLAGS += -DINCLUDE_TRACE
 105 endif
 106 
 107 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
 108 CFLAGS += $(CFLAGS_WARN/BYFILE)
 109 
 110 # Do not use C++ exception handling
 111 CFLAGS += $(CFLAGS/NOEX)
 112 
 113 # Extra flags from gnumake's invocation or environment
 114 CFLAGS += $(EXTRA_CFLAGS)
 115 LFLAGS += $(EXTRA_CFLAGS)
 116 
 117 # Don't set excutable bit on stack segment