From: Egbert Eich <eich@suse.com>
Date: Sun Apr 26 18:07:27 2020 +0200
Subject: Fix Makefiles for gmake 4.3
Patch-mainline: Not yet
Git-commit: 71d386b6f5f7da266eb0cc6bcc5eafe5de52ad21
References: boo#

gmake 4.3 expects an unescaped '#' in function calls.
Fix in a backward compatible way.

Signed-off-by: Egbert Eich <eich@suse.com>
---
 .command_rpm-git                                   |   2 +-
 .../kokkos-kernels/Makefile.kokkos-kernels         |  86 ++++-----
 .../packages/kokkos/Makefile.kokkos                | 195 +++++++++++----------
 3 files changed, 142 insertions(+), 141 deletions(-)
diff --git a/Trilinos-trilinos-release-12-14-1/packages/kokkos-kernels/Makefile.kokkos-kernels b/Trilinos-trilinos-release-12-14-1/packages/kokkos-kernels/Makefile.kokkos-kernels
index 383b98c..0fffe85 100644
--- a/packages/kokkos-kernels/Makefile.kokkos-kernels
+++ b/packages/kokkos-kernels/Makefile.kokkos-kernels
@@ -54,7 +54,7 @@ ifndef KOKKOS_CXXFLAGS
   include $(KOKKOS_PATH)/Makefile.kokkos
 endif
 
-
+KOKKOSHASH=\#
 #=========================================================================
 #==== Generate KokkosKernels_config.h ====================================
 #=========================================================================
@@ -63,8 +63,8 @@ tmp := $(shell echo "/* ---------------------------------------------" > KokkosK
 tmp := $(shell echo "Makefile constructed configuration:" >> KokkosKernels_config.tmp)
 tmp := $(shell date >> KokkosKernels_config.tmp)
 tmp := $(shell echo "----------------------------------------------*/" >> KokkosKernels_config.tmp)
-tmp := $(shell echo "\#ifndef KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.tmp)
-tmp := $(shell echo "\#define KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.tmp)
+tmp := $(shell echo "$(KOKKOSHASH)ifndef KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.tmp)
+tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.tmp)
 
 #==== ETI Macros Scalars =================================================
 KOKKOSKERNELS_INTERNAL_INST_SCALARS =
@@ -79,27 +79,27 @@ tmp := $(shell echo "ETI Scalar Types:" >> KokkosKernels_config.tmp)
 tmp := $(shell echo "   ---------------------------------------------*/" >> KokkosKernels_config.tmp)
 
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_DOUBLE), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_DOUBLE" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_DOUBLE" >> KokkosKernels_config.tmp )
   KOKKOSKERNELS_INTERNAL_INST_SCALARS += "double"
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_FLOAT), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_FLOAT" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_FLOAT" >> KokkosKernels_config.tmp )
   KOKKOSKERNELS_INTERNAL_INST_SCALARS += "float"
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_DOUBLE_), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_COMPLEX_DOUBLE" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_COMPLEX_DOUBLE" >> KokkosKernels_config.tmp )
   KOKKOSKERNELS_INTERNAL_INST_SCALARS += "Kokkos::complex<double>"
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_FLOAT_), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_COMPLEX_FLOAT" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_COMPLEX_FLOAT" >> KokkosKernels_config.tmp )
   KOKKOSKERNELS_INTERNAL_INST_SCALARS += "Kokkos::complex<float>"
 endif
-tmp := $(shell echo "\#if defined(KOKKOSKERNELS_INST_COMPLEX_DOUBLE)" >> KokkosKernels_config.tmp )
-tmp := $(shell echo "\#define KOKKOSKERNELS_INST_KOKKOS_COMPLEX_DOUBLE_" >> KokkosKernels_config.tmp )
-tmp := $(shell echo "\#endif" >> KokkosKernels_config.tmp )
-tmp := $(shell echo "\#if defined(KOKKOSKERNELS_INST_COMPLEX_FLOAT)" >> KokkosKernels_config.tmp )
-tmp := $(shell echo "\#define KOKKOSKERNELS_INST_KOKKOS_COMPLEX_FLOAT_" >> KokkosKernels_config.tmp )
-tmp := $(shell echo "\#endif" >> KokkosKernels_config.tmp )
+tmp := $(shell echo "$(KOKKOSHASH)if defined(KOKKOSKERNELS_INST_COMPLEX_DOUBLE)" >> KokkosKernels_config.tmp )
+tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_KOKKOS_COMPLEX_DOUBLE_" >> KokkosKernels_config.tmp )
+tmp := $(shell echo "$(KOKKOSHASH)endif" >> KokkosKernels_config.tmp )
+tmp := $(shell echo "$(KOKKOSHASH)if defined(KOKKOSKERNELS_INST_COMPLEX_FLOAT)" >> KokkosKernels_config.tmp )
+tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_KOKKOS_COMPLEX_FLOAT_" >> KokkosKernels_config.tmp )
+tmp := $(shell echo "$(KOKKOSHASH)endif" >> KokkosKernels_config.tmp )
 
 
 #==== ETI Macros ORDINALS =================================================
@@ -113,11 +113,11 @@ tmp := $(shell echo "ETI Ordinal Types:" >> KokkosKernels_config.tmp)
 tmp := $(shell echo "   ---------------------------------------------*/" >> KokkosKernels_config.tmp)
 
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_ORDINAL_INT), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_ORDINAL_INT" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_ORDINAL_INT" >> KokkosKernels_config.tmp )
   KOKKOSKERNELS_INTERNAL_INST_ORDINALS += "int"
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_ORDINAL_INT64_T), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_ORDINAL_INT64_T" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_ORDINAL_INT64_T" >> KokkosKernels_config.tmp )
   KOKKOSKERNELS_INTERNAL_INST_ORDINALS += "int64_t"
 endif
 
@@ -132,11 +132,11 @@ tmp := $(shell echo "ETI Offset Types:" >> KokkosKernels_config.tmp)
 tmp := $(shell echo "   ---------------------------------------------*/" >> KokkosKernels_config.tmp)
 
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_OFFSET_INT), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_OFFSET_INT" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_OFFSET_INT" >> KokkosKernels_config.tmp )
   KOKKOSKERNELS_INTERNAL_INST_OFFSETS += "int"
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_OFFSET_SIZE_T), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_OFFSET_SIZE_T" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_OFFSET_SIZE_T" >> KokkosKernels_config.tmp )
   KOKKOSKERNELS_INTERNAL_INST_OFFSETS += "size_t"
 endif
 
@@ -152,10 +152,10 @@ tmp := $(shell echo "ETI Layout Types:" >> KokkosKernels_config.tmp)
 tmp := $(shell echo "   ---------------------------------------------*/" >> KokkosKernels_config.tmp)
 
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_LAYOUTLEFT), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_LAYOUTLEFT" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_LAYOUTLEFT" >> KokkosKernels_config.tmp )
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_LAYOUTRIGHT), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_LAYOUTRIGHT" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_LAYOUTRIGHT" >> KokkosKernels_config.tmp )
 endif
 
 #==== ETI Macros ExecutionSpaces =================================================
@@ -171,16 +171,16 @@ tmp := $(shell echo "ETI ExecutionSpace Types:" >> KokkosKernels_config.tmp)
 tmp := $(shell echo "   ---------------------------------------------*/" >> KokkosKernels_config.tmp)
 
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_SERIAL), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_EXECSPACE_SERIAL" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_EXECSPACE_SERIAL" >> KokkosKernels_config.tmp )
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_OPENMP), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_EXECSPACE_OPENMP" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_EXECSPACE_OPENMP" >> KokkosKernels_config.tmp )
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_THREADS), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_EXECSPACE_THREADS" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_EXECSPACE_THREADS" >> KokkosKernels_config.tmp )
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_CUDA), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_EXECSPACE_CUDA" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_EXECSPACE_CUDA" >> KokkosKernels_config.tmp )
 endif
 
 #==== ETI Macros MemorySpaces =================================================
@@ -197,25 +197,25 @@ tmp := $(shell echo "ETI Memory Space Types:" >> KokkosKernels_config.tmp)
 tmp := $(shell echo "   ---------------------------------------------*/" >> KokkosKernels_config.tmp)
 
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_HOSTSPACE), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_HOSTSPACE" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_MEMSPACE_HOSTSPACE" >> KokkosKernels_config.tmp )
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_HBWSPACE), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_HBWSPACE" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_MEMSPACE_HBWSPACE" >> KokkosKernels_config.tmp )
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDASPACE), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_CUDASPACE" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_MEMSPACE_CUDASPACE" >> KokkosKernels_config.tmp )
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAUVMSPACE), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_CUDAUVMSPACE" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_MEMSPACE_CUDAUVMSPACE" >> KokkosKernels_config.tmp )
 endif
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAHOSTPINNEDSPACE), 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE" >> KokkosKernels_config.tmp )
 endif
 
 ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_CUDA), 1)
   ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDASPACE), 0)
     ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAUVMSPACE), 0)
-      tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_CUDASPACE" >> KokkosKernels_config.tmp )
+      tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_INST_MEMSPACE_CUDASPACE" >> KokkosKernels_config.tmp )
     endif
   endif
 endif
@@ -231,14 +231,14 @@ tmp := $(shell echo "   ---------------------------------------------*/" >> Kokk
 
 ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_BLAS}, 1)
   KOKKOSKERNELS_LIBS += ${BLAS_LIBS}
-  tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_BLAS" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_ENABLE_TPL_BLAS" >> KokkosKernels_config.tmp )
 endif
 
 ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_MKL}, 1)
   KOKKOSKERNELS_CPPFLAGS += -I${MKL_PATH}/include
   KOKKOSKERNELS_LIBS += ${MKL_LIBS}
 
-  tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_MKL" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_ENABLE_TPL_MKL" >> KokkosKernels_config.tmp )
 endif
 
 ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_CUSPARSE}, 1)
@@ -248,7 +248,7 @@ ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_CUSPARSE}, 1)
   KOKKOSKERNELS_LDFLAGS += -L${CUDA_PATH}/lib
   KOKKOSKERNELS_LIBS += -lcusparse
 
-  tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_CUSPARSE" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_ENABLE_TPL_CUSPARSE" >> KokkosKernels_config.tmp )
 endif
 
 ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_CUBLAS}, 1)
@@ -258,14 +258,14 @@ ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_CUBLAS}, 1)
   KOKKOSKERNELS_LDFLAGS += -L${CUDA_PATH}/lib
   KOKKOSKERNELS_LIBS += -lcublas
 
-  tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_CUBLAS" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_ENABLE_TPL_CUBLAS" >> KokkosKernels_config.tmp )
 endif
 
-  tmp := $(shell echo "\#if defined(KOKKOSKERNELS_ENABLE_TPL_MKL)" >> KokkosKernels_config.tmp )
-  tmp := $(shell echo "\#if !defined(KOKKOSKERNELS_ENABLE_TPL_BLAS)" >> KokkosKernels_config.tmp )  
-  tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_BLAS" >> KokkosKernels_config.tmp )
-  tmp := $(shell echo "\#endif" >> KokkosKernels_config.tmp )
-  tmp := $(shell echo "\#endif" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)if defined(KOKKOSKERNELS_ENABLE_TPL_MKL)" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)if !defined(KOKKOSKERNELS_ENABLE_TPL_BLAS)" >> KokkosKernels_config.tmp )  
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_ENABLE_TPL_BLAS" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)endif" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)endif" >> KokkosKernels_config.tmp )
 
 #==== Options =================================================
 
@@ -277,19 +277,19 @@ tmp := $(shell echo "   ---------------------------------------------*/" >> Kokk
 KOKKOSKERNELS_INTERNAL_ETI_ONLY := $(strip $(shell echo $(KOKKOSKERNELS_OPTIONS) | grep "eti-only" | wc -l))
 
 ifeq (${KOKKOSKERNELS_INTERNAL_ETI_ONLY}, 1)
-  tmp := $(shell echo "\#define KOKKOSKERNELS_ETI_ONLY" >> KokkosKernels_config.tmp )
+  tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_ETI_ONLY" >> KokkosKernels_config.tmp )
 endif
 
 #==== Put in guard for library compilations ===========================
 tmp := $(shell echo "" >> KokkosKernels_config.tmp)
-tmp := $(shell echo "\#ifndef KOKKOSKERNELS_IMPL_COMPILE_LIBRARY" >> KokkosKernels_config.tmp)
-tmp := $(shell echo "\#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY false" >> KokkosKernels_config.tmp)
-tmp := $(shell echo "\#endif " >> KokkosKernels_config.tmp)
+tmp := $(shell echo "$(KOKKOSHASH)ifndef KOKKOSKERNELS_IMPL_COMPILE_LIBRARY" >> KokkosKernels_config.tmp)
+tmp := $(shell echo "$(KOKKOSHASH)define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY false" >> KokkosKernels_config.tmp)
+tmp := $(shell echo "$(KOKKOSHASH)endif " >> KokkosKernels_config.tmp)
 tmp := $(shell echo "" >> KokkosKernels_config.tmp)
 
 #==== Endif the file  =================================================
 
-tmp := $(shell echo "\#endif // KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.tmp)
+tmp := $(shell echo "$(KOKKOSHASH)endif // KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.tmp)
 
 #==== Update the config file if necessary =================================================
 
diff --git a/Trilinos-trilinos-release-12-14-1/packages/kokkos/Makefile.kokkos b/Trilinos-trilinos-release-12-14-1/packages/kokkos/Makefile.kokkos
index 27b3ce4..5c0e91f 100644
--- a/packages/kokkos/Makefile.kokkos
+++ b/packages/kokkos/Makefile.kokkos
@@ -359,6 +359,7 @@ KOKKOS_INTERNAL_CONFIG_TMP=KokkosCore_config.tmp
 KOKKOS_CONFIG_HEADER=KokkosCore_config.h
 # Functions for generating config header file
 kokkos_append_header = $(shell echo $1 >> $(KOKKOS_INTERNAL_CONFIG_TMP))
+KOKKOSHASH=\#
 
 # Do not append first line
 tmp := $(shell echo "/* ---------------------------------------------" > KokkosCore_config.tmp)
@@ -366,82 +367,82 @@ tmp := $(call kokkos_append_header,"Makefile constructed configuration:")
 tmp := $(call kokkos_append_header,"$(shell date)")
 tmp := $(call kokkos_append_header,"----------------------------------------------*/")
 
-tmp := $(call kokkos_append_header,'\#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H)')
-tmp := $(call kokkos_append_header,'\#error "Do not include $(KOKKOS_CONFIG_HEADER) directly; include Kokkos_Macros.hpp instead."')
-tmp := $(call kokkos_append_header,'\#else')
-tmp := $(call kokkos_append_header,'\#define KOKKOS_CORE_CONFIG_H')
-tmp := $(call kokkos_append_header,'\#endif')
+tmp := $(call kokkos_append_header,'$(KOKKOSHASH)if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H)')
+tmp := $(call kokkos_append_header,'$(KOKKOSHASH)error "Do not include $(KOKKOS_CONFIG_HEADER) directly; include Kokkos_Macros.hpp instead."')
+tmp := $(call kokkos_append_header,'$(KOKKOSHASH)else')
+tmp := $(call kokkos_append_header,'$(KOKKOSHASH)define KOKKOS_CORE_CONFIG_H')
+tmp := $(call kokkos_append_header,'$(KOKKOSHASH)endif')
 	
 tmp := $(call kokkos_append_header,"/* Execution Spaces */")
 
 ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CUDA")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1)
-  tmp := $(call kokkos_append_header,'\#define KOKKOS_ENABLE_ROCM')
+  tmp := $(call kokkos_append_header,'$(KOKKOSHASH)define KOKKOS_ENABLE_ROCM')
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1)
-  tmp := $(call kokkos_append_header,'\#define KOKKOS_ENABLE_OPENMPTARGET')
+  tmp := $(call kokkos_append_header,'$(KOKKOSHASH)define KOKKOS_ENABLE_OPENMPTARGET')
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1)
-  tmp := $(call kokkos_append_header,'\#define KOKKOS_ENABLE_OPENMP')
+  tmp := $(call kokkos_append_header,'$(KOKKOSHASH)define KOKKOS_ENABLE_OPENMP')
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_THREADS")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_THREADS")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_QTHREADS), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_QTHREADS")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_QTHREADS")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_SERIAL), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_SERIAL")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_SERIAL")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_TM), 1)
-  tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__")
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_TM")
-  tmp := $(call kokkos_append_header,"\#endif")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)ifndef __CUDA_ARCH__")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_TM")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)endif")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ISA_X86_64), 1)
-  tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__")
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_ISA_X86_64")
-  tmp := $(call kokkos_append_header,"\#endif")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)ifndef __CUDA_ARCH__")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_USE_ISA_X86_64")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)endif")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ISA_KNC), 1)
-  tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__")
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_ISA_KNC")
-  tmp := $(call kokkos_append_header,"\#endif")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)ifndef __CUDA_ARCH__")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_USE_ISA_KNC")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)endif")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ISA_POWERPCLE), 1)
-  tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__")
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_ISA_POWERPCLE")
-  tmp := $(call kokkos_append_header,"\#endif")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)ifndef __CUDA_ARCH__")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_USE_ISA_POWERPCLE")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)endif")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ISA_POWERPCBE), 1)
-  tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__")
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_ISA_POWERPCBE")
-  tmp := $(call kokkos_append_header,"\#endif")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)ifndef __CUDA_ARCH__")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_USE_ISA_POWERPCBE")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)endif")
 endif
 
 tmp := $(call kokkos_append_header,"/* General Settings */")
 ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX11), 1)
   KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX11_FLAG)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX11")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CXX11")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX1Z), 1)
   KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX1Z_FLAG)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX11")
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX1Z")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CXX11")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CXX1Z")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_ENABLE_DEBUG), 1)
@@ -451,15 +452,15 @@ ifeq ($(KOKKOS_INTERNAL_ENABLE_DEBUG), 1)
 
   KOKKOS_CXXFLAGS += -g
   KOKKOS_LDFLAGS += -g
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK")
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_DEBUG")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_DEBUG")
   ifeq ($(KOKKOS_INTERNAL_DISABLE_DUALVIEW_MODIFY_CHECK), 0)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK")
   endif
 endif
 
 ifeq ($(KOKKOS_INTERNAL_ENABLE_PROFILING_LOAD_PRINT), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_PROFILING_LOAD_PRINT")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_PROFILING_LOAD_PRINT")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_HWLOC), 1)
@@ -474,11 +475,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_HWLOC), 1)
   endif
   KOKKOS_LIBS += -lhwloc
   KOKKOS_TPL_LIBRARY_NAMES += hwloc
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_HWLOC")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_HWLOC")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_LIBRT), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_LIBRT")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_USE_LIBRT")
   KOKKOS_LIBS += -lrt
   KOKKOS_TPL_LIBRARY_NAMES += rt
 endif
@@ -495,47 +496,47 @@ ifeq ($(KOKKOS_INTERNAL_USE_MEMKIND), 1)
   endif
   KOKKOS_LIBS += -lmemkind -lnuma
   KOKKOS_TPL_LIBRARY_NAMES += memkind numa
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_HBWSPACE")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_HBWSPACE")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_DISABLE_PROFILING), 0)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_PROFILING")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_PROFILING")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_DISABLE_DEPRECATED_CODE), 0)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_DEPRECATED_CODE")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_DEPRECATED_CODE")
 endif
 ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_ETI")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_ETI")
 endif
 
 ifeq ($(KOKKOS_INTERNAL_ENABLE_LARGE_MEM_TESTS), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_LARGE_MEM_TESTS")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_LARGE_MEM_TESTS")
 endif
 
 tmp := $(call kokkos_append_header,"/* Optimization Settings */")
 
 ifeq ($(KOKKOS_INTERNAL_OPT_RANGE_AGGRESSIVE_VECTORIZATION), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION")
 endif
 
 tmp := $(call kokkos_append_header,"/* Cuda Settings */")
 
 ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1)
   ifeq ($(KOKKOS_INTERNAL_CUDA_USE_LDG), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC")
   else
     ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1)
-      tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC")
+      tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC")
     endif
   endif
 
   ifeq ($(KOKKOS_INTERNAL_CUDA_USE_UVM), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_UVM")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CUDA_UVM")
   endif
 
   ifeq ($(KOKKOS_INTERNAL_CUDA_USE_RELOC), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE")
     KOKKOS_CXXFLAGS += --relocatable-device-code=true
     KOKKOS_LDFLAGS += --relocatable-device-code=true
   endif
@@ -551,7 +552,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1)
   ifeq ($(KOKKOS_INTERNAL_CUDA_USE_LAMBDA), 1)
     ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1)
       ifeq ($(shell test $(KOKKOS_INTERNAL_COMPILER_NVCC_VERSION) -gt 70; echo $$?),0)
-        tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_LAMBDA")
+        tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CUDA_LAMBDA")
         KOKKOS_CXXFLAGS += -expt-extended-lambda
       else
         $(warning Warning: Cuda Lambda support was requested but NVCC version is too low. This requires NVCC for Cuda version 7.5 or higher. Disabling Lambda support now.)
@@ -559,19 +560,19 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1)
     endif
 
     ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1)
-      tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_LAMBDA")
+      tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ENABLE_CUDA_LAMBDA")
     endif
   endif
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_IMPL_CUDA_CLANG_WORKAROUND")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_IMPL_CUDA_CLANG_WORKAROUND")
   endif
 endif
 
 # Add Architecture flags.
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV80), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV80")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ARMV80")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1)
     KOKKOS_CXXFLAGS +=
@@ -588,7 +589,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV80), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV81), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV81")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ARMV81")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1)
     KOKKOS_CXXFLAGS +=
@@ -605,8 +606,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV81), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV80")
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV8_THUNDERX")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ARMV80")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ARMV8_THUNDERX")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1)
     KOKKOS_CXXFLAGS +=
@@ -623,8 +624,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV81")
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV8_THUNDERX2")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ARMV81")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ARMV8_THUNDERX2")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1)
     KOKKOS_CXXFLAGS +=
@@ -641,7 +642,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_SSE42), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_SSE42")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_SSE42")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1)
     KOKKOS_CXXFLAGS += -xSSE4.2
@@ -663,7 +664,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_SSE42), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_AVX")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1)
     KOKKOS_CXXFLAGS += -mavx
@@ -685,7 +686,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER7), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_POWER7")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_POWER7")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1)
 
@@ -697,7 +698,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER7), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER8), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_POWER8")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_POWER8")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1)
 
@@ -718,7 +719,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER8), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER9), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_POWER9")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_POWER9")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1)
 
@@ -739,7 +740,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER9), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_HSW), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX2")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_AVX2")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1)
     KOKKOS_CXXFLAGS += -xCORE-AVX2
@@ -761,7 +762,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_HSW), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_BDW), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX2")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_AVX2")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1)
     KOKKOS_CXXFLAGS += -xCORE-AVX2
@@ -783,7 +784,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_BDW), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX512MIC), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX512MIC")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_AVX512MIC")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1)
     KOKKOS_CXXFLAGS += -xMIC-AVX512
@@ -804,7 +805,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX512MIC), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX512XEON), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX512XEON")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_AVX512XEON")
 
   ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1)
     KOKKOS_CXXFLAGS += -xCORE-AVX512
@@ -825,7 +826,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX512XEON), 1)
 endif
 
 ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KNC), 1)
-  tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KNC")
+  tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KNC")
   KOKKOS_CXXFLAGS += -mmic
   KOKKOS_LDFLAGS += -mmic
 endif
@@ -842,58 +843,58 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1)
   endif
 
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KEPLER30), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER30")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KEPLER")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KEPLER30")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_30
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KEPLER32), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER32")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KEPLER")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KEPLER32")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_32
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KEPLER35), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER35")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KEPLER")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KEPLER35")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_35
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KEPLER37), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER37")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KEPLER")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KEPLER37")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_37
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_MAXWELL50), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL50")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_MAXWELL")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_MAXWELL50")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_50
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_MAXWELL52), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL52")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_MAXWELL")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_MAXWELL52")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_52
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_MAXWELL53), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL53")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_MAXWELL")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_MAXWELL53")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_53
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_PASCAL60), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_PASCAL")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_PASCAL60")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_PASCAL")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_PASCAL60")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_60
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_PASCAL61), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_PASCAL")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_PASCAL61")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_PASCAL")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_PASCAL61")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_61
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VOLTA70), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA70")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_VOLTA")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_VOLTA70")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_70
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VOLTA72), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA72")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_VOLTA")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_VOLTA72")
     KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_72
   endif
 
@@ -910,28 +911,28 @@ endif
 ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1)
   # Lets start with adding architecture defines
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KAVERI), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ROCM 701")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KAVERI")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ROCM 701")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_KAVERI")
     KOKKOS_INTERNAL_ROCM_ARCH_FLAG := --amdgpu-target=gfx701 
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_CARRIZO), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ROCM 801")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_CARRIZO")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ROCM 801")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_CARRIZO")
     KOKKOS_INTERNAL_ROCM_ARCH_FLAG := --amdgpu-target=gfx801 
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_FIJI), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ROCM 803")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_FIJI")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ROCM 803")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_FIJI")
     KOKKOS_INTERNAL_ROCM_ARCH_FLAG := --amdgpu-target=gfx803
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VEGA), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ROCM 900")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VEGA")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ROCM 900")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_VEGA")
     KOKKOS_INTERNAL_ROCM_ARCH_FLAG := --amdgpu-target=gfx900 
   endif
   ifeq ($(KOKKOS_INTERNAL_USE_ARCH_GFX901), 1)
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ROCM 901")
-    tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_GFX901")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_ROCM 901")
+    tmp := $(call kokkos_append_header,"$(KOKKOSHASH)define KOKKOS_ARCH_GFX901")
     KOKKOS_INTERNAL_ROCM_ARCH_FLAG := --amdgpu-target=gfx901 
   endif
  
