Skip to content

Commit 027f2ff

Browse files
authored
Fix make help (AMReX-Codes#2854)
This reverts the change in AMReX-Codes#2845, which fixed an issue with `make print-%`, but broke `make help`. This is now fixed in a different way. Both `make print-%` and `make help` should work now.
1 parent 3d3ad21 commit 027f2ff

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Tools/GNUMake/Make.rules

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,14 @@ endif
512512
# e.g. libraries, simply do "make print-libraries". This will
513513
# print out the value.
514514
print-%:
515-
@echo $* is '$($*)'
515+
@echo $* is "$($*)"
516516
@echo ' origin = $(origin $*)'
517-
@echo ' value = $(value $*)'
517+
@echo ' value = $(subst ','"'"',$(value $*))'
518+
# We need to use subst on the result of $(value) because it contains single
519+
# quotes. Shell command echo does not like things like 'x'$(filiter-out)'y',
520+
# because what it sees is 'x', $(filter-out), and 'y'. With the substition, it
521+
# will see 'x', "'", '$(filter-out)', "'", and 'y', with $(filter-out) inside a
522+
# pair of single quotes.
518523

519524
.PHONY: help
520525
help:

Tools/GNUMake/sites/Make.nersc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ ifeq ($(which_computer),$(filter $(which_computer),perlmutter))
2626

2727
ifeq ($(USE_CUDA),TRUE)
2828
ifdef NPE_VERSION
29-
CFLAGS += -Xcompiler="$(filter-out -Wl%, $(wordlist 2,1024,$(shell mpicc -show 2> /dev/null)))"
30-
CXXFLAGS += -Xcompiler="$(filter-out -Wl%, $(wordlist 2,1024,$(shell mpicxx -show 2> /dev/null)))"
29+
CFLAGS += -Xcompiler='$(filter-out -Wl%, $(wordlist 2,1024,$(shell mpicc -show 2> /dev/null)))'
30+
CXXFLAGS += -Xcompiler='$(filter-out -Wl%, $(wordlist 2,1024,$(shell mpicxx -show 2> /dev/null)))'
3131
else
32-
CFLAGS += -Xcompiler="$(wordlist 2,1024,$(shell cc -craype-verbose 2> /dev/null))"
33-
CXXFLAGS += -Xcompiler="$(wordlist 2,1024,$(shell CC -craype-verbose 2> /dev/null))"
32+
CFLAGS += -Xcompiler='$(wordlist 2,1024,$(shell cc -craype-verbose 2> /dev/null))'
33+
CXXFLAGS += -Xcompiler='$(wordlist 2,1024,$(shell CC -craype-verbose 2> /dev/null))'
3434
endif
3535
else ifeq ($(USE_MPI),FALSE)
3636
CFLAGS += $(wordlist 2,1024,$(shell cc -craype-verbose 2> /dev/null))

0 commit comments

Comments
 (0)