Skip to content
Snippets Groups Projects
Select Git revision
  • 87bff9e96071936c7163598ebaa350a5a2b19441
  • master default protected
  • 1.31
  • 4.38.8
  • 4.38.7
  • 4.38.6
  • 4.38.5
  • 4.38.4
  • 4.38.3
  • 4.38.2
  • 4.38.1
  • 4.38.0
  • 4.37.2
  • 4.37.1
  • 4.37.0
  • 4.36.0
  • 4.35.0
  • 4.34.1
  • 4.34.0
  • 4.33.1
  • 4.33.0
  • 4.32.2
  • 4.32.1
23 results

test.html

Blame
  • target-help.mk 1.63 KiB
    #############################################################################################
    #############################################################################################
    ##
    ## HELP-TARGETS
    ##
    #############################################################################################
    #############################################################################################
    
    # @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
    .DEFAULT_GOAL := help
    
    .PHONY: print
    ## Print Path	
    print:
    	$(ECHO) "THIS_MAKEFILE:      $(THIS_MAKEFILE)"
    	$(ECHO) "THIS_MAKEFILE_PATH: $(THIS_MAKEFILE_PATH)"
    	$(ECHO) "PROJECT_ROOT:       $(PROJECT_ROOT)"
    
    # Add a comment to the public targets so that it appears
    # in this help Use two # characters for a help comment
    .PHONY: help
    help:
    	@printf "${COMMENT}Usage:${RESET}\n"
    	@printf " make [target] [arg=\"val\"...]\n\n"
    	@printf "${COMMENT}Available targets:${RESET}\n"
    	@awk '/^[a-zA-Z\-\\_0-9\.@]+:/ { \
    		helpMessage = match(lastLine, /^## (.*)/); \
    		if (helpMessage) { \
    			helpCommand = substr($$1, 0, index($$1, ":")); \
    			helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
    			printf " ${INFO}%-22s${RESET} %s\n", helpCommand, helpMessage; \
    		} \
    	} \
    	{ lastLine = $$0 }' $(MAKEFILE_LIST)
    	@printf "\n${COMMENT}Available arguments:${RESET}\n\n"
    	@awk '/^(([a-zA-Z\-\\_0-9\.@]+)\s[?:]?=)/ { \
    		helpMessage = match(lastLine, /^## (.*)/); \
    		if (helpMessage) { \
    			helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
    			printf " ${INFO}%-22s${RESET} %s (Default: %s)\n", $$1, helpMessage, $$3; \
    		} \
    	} \
    	{ lastLine = $$0 }' $(MAKEFILE_LIST)