@@ -858,19 +858,17 @@ $(OBJDIR)/ceed.pc : pkgconfig-prefix = $(prefix)
858858GIT_DESCRIBE = $(shell git describe --always --dirty 2>/dev/null || printf "unknown\n")
859859
860860$(OBJDIR ) /interface/ceed-config.c : Makefile
861- @$(file >$@ ,#include <ceed-impl.h>) \
862- $(file >>$@ ,) \
863- $(file >>$@ ,int CeedGetGitVersion(const char ** git_version) {) \
864- $(file >>$@, *git_version = "$(GIT_DESCRIBE)";) \
865- $(file >>$@, return 0;) \
866- $(file >>$@,}) \
867- $(file >>$@,) \
868- $(file >>$@,int CeedGetBuildConfiguration(const char **build_config) {) \
869- $(file >>$@, *build_config =) \
870- $(foreach v,$(CONFIG_VARS),$(file >>$@,"$(v) = $($(v))\n")) \
871- $(file >>$@, ;) \
872- $(file >>$@, return 0;) \
873- $(file >>$@,})
861+ @printf ' #include <ceed-impl.h>\n\n' > $@
862+ @printf ' int CeedGetGitVersion(const char **git_version) {\n' >> $@
863+ @printf ' *git_version = "$(GIT_DESCRIBE)";\n' >> $@
864+ @printf ' return 0;\n' >> $@
865+ @printf ' }\n\n' >> $@
866+ @printf ' int CeedGetBuildConfiguration(const char **build_config) {\n' >> $@
867+ @printf ' *build_config =' >> $@
868+ @printf " $( foreach v,$( CONFIG_VARS) ,\n\" $( v) = $( $( v) ) \\\n\" ) \n" >> $@
869+ @printf ' ;\n' >> $@
870+ @printf ' return 0;\n' >> $@
871+ @printf ' }\n' >> $@
874872
875873$(OBJDIR ) /interface/ceed-jit-source-root-default.o : CPPFLAGS += -DCEED_JIT_SOURCE_ROOT_DEFAULT="\"$(abspath ./include) /\""
876874$(OBJDIR ) /interface/ceed-jit-source-root-install.o : CPPFLAGS += -DCEED_JIT_SOURCE_ROOT_DEFAULT="\"$(abspath $(includedir ) ) /\""
@@ -1037,8 +1035,8 @@ CONFIG_VARS = CC CXX FC NVCC NVCC_CXX HIPCC \
10371035needs_save = $(or $(filter command line,$(origin $(1 ) ) ) ,$(filter simple,$(flavor $(1 ) ) ) )
10381036
10391037configure :
1040- $( file > $(CONFIG ) )
1041- $(foreach v,$(CONFIG_VARS ) ,$(if $(call needs_save,$(v ) ) ,$( file >> $( CONFIG ) , $( v ) := $($(v ) ) ) ) )
1038+ @printf " # Cached Configuration " > $(CONFIG )
1039+ @printf " $( foreach v,$( CONFIG_VARS) ,$( if $( call needs_save,$( v) ) ,\n $( v) := $( $( v) ) ) ) \n " >> $( CONFIG )
10421040 @echo " Configuration cached in $( CONFIG) :"
10431041 @cat $(CONFIG )
10441042
0 commit comments