Skip to content

Commit

Permalink
build: Add help message for the print target
Browse files Browse the repository at this point in the history
  • Loading branch information
itislu committed Jul 31, 2024
1 parent d8c01dc commit 3057c2b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# By: ldulling <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/12/23 03:22:46 by ldulling #+# #+# #
# Updated: 2024/07/31 01:57:09 by ldulling ### ########.fr #
# Updated: 2024/07/31 02:06:25 by ldulling ### ########.fr #
# #
# **************************************************************************** #

Expand Down Expand Up @@ -126,7 +126,7 @@ export CC CFLAGS MAKECMDGOALS MAKEFLAGS

PHONY_TARGETS := all fast run san val noenv valfd help build lib waitforlib \
clean fclean ffclean re
HELP_TARGETS := help \
HELP_TARGETS := help help-print \
$(addprefix help-,$(PHONY_TARGETS)) \
$(addsuffix -help,$(PHONY_TARGETS))
PHONY_TARGETS += $(HELP_TARGETS)
Expand Down Expand Up @@ -247,6 +247,7 @@ help :

help-help :
echo "Display more information for a specific target by appending or prepending help."
echo "Usage: make help-<target> | make <target>-help"

%-help:
$(MAKE) help-$(subst -help,,$@)
Expand Down Expand Up @@ -393,7 +394,10 @@ MSG_FAILURE := $(STY_BOL)$(STY_ITA)$(STY_RED)"BUILD FAILED!"$(STY_RES)

# *************************** MAKEFILE DEBUGGING ***************************** #

# Execute "make print-[variable name]" to list the variable's values
help-print :
echo "Print the value of a Makefile variable by appending the variable name to print-."
echo "Useful for Makefile debugging."
echo "Usage: make print-<variable name>"

print-% :
echo $* = $($*)
Expand Down

0 comments on commit 3057c2b

Please sign in to comment.