Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d7fa60a

Browse files
committedMar 25, 2025·
make - version <4 does not support file
1 parent c2d180a commit d7fa60a

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed
 

‎Makefile

+13-15
Original file line numberDiff line numberDiff line change
@@ -858,19 +858,17 @@ $(OBJDIR)/ceed.pc : pkgconfig-prefix = $(prefix)
858858
GIT_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 \
10371035
needs_save = $(or $(filter command line,$(origin $(1))),$(filter simple,$(flavor $(1))))
10381036

10391037
configure :
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

Comments
 (0)
Please sign in to comment.