Fix show-makefiles rule for files containing colons

This commit is contained in:
Andrew Johnson
2018-10-23 11:06:19 -05:00
parent 27ee078bc8
commit 6eb88b16a0
+5 -3
View File
@@ -8,12 +8,14 @@
# These rules show the set of Makefiles, config files and
# rules files loaded by GNUmake.
SHOW_MAKEFILES = $(MAKEFILE_LIST:%=show-makefile.%)
# Protect against filenames containing colons (Windows)
SAFE_MAKEFILES = $(subst :,__colon__,$(MAKEFILE_LIST))
SHOW_MAKEFILES = $(SAFE_MAKEFILES:%=show-makefile.%)
show-makefiles: $(SHOW_MAKEFILES)
# The sort prevents warnings about duplicate targets:
$(sort $(SHOW_MAKEFILES)): show-makefile.%:
@echo " $(@:show-makefile.%=%)"
@echo " $(subst __colon__,:,$(@:show-makefile.%=%))"
.PHONY: show-makefiles show-makefile.%
@@ -23,7 +25,7 @@ $(sort $(SHOW_MAKEFILES)): show-makefile.%:
PRINT_Var = $(@:PRINT.%=%)
PRINT.%:
@echo "$(PRINT_Var) = '$($(PRINT_Var))'"
@echo $(PRINT_Var) = '$($(PRINT_Var))'
.PHONY: PRINT PRINT.%