help target for NewMakeFile.gmk
Kelly O'Hair
kelly.ohair at oracle.com
Thu Oct 18 10:40:19 PDT 2012
I just added a help target, not exactly the way you suggested, but should work. Looks like:
make NEWBUILD=true help
# JDK Makefile
#
# Usage: make [Target]
#
# Target Description
# ------ -----------
# all - Build the entire jdk but not the images
# images - Create the jdk images for the builds
# clean - Clean and prepare for a fresh build from scratch
# clobber - Clean and also purge any hidden derived data
# checks - Perform various checks to make sure we can build
# sanity - Same as 'make checks'
# javadocs - Build the javadocs
# help - Print out the help messages
#
-kto
On Oct 17, 2012, at 9:49 PM, Mike Duigou wrote:
> When confronted with a new makefile I always wonder what targets are available. It's useful to have a help target that prints out the available targets.
>
> Here's a patch for the NewMakeFile.gmk that prints out the phony list as available targets. In other projects with phonies that aren't directly usable two lists are kept, one for usable targets and another for targets that can't or shouldn't be directly executed. Help will print just the usable list.
>
> Mike
>
> @@ -203,9 +203,29 @@
> jprt_build_generic
>
> ###########################################################################
> +# Help target
> +
> +THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
> +ifeq ($(THIS_MAKEFILE),Makefile)
> + MINUS_F := ""
> +else
> + MINUS_F := " -f $(THIS_MAKEFILE)"
> +endif
> +
> +help:
> + @$(ECHO) -n "# Usage : make$(MINUS_F)"
> + @for eachtarget in $(PHONY_LIST) ; do $(ECHO) -n " [$$eachtarget]" ; done
> + @$(ECHO) ""
> +
> +# Keep track of phony targets
> +PHONY_LIST += help
> +
> +###########################################################################
>
More information about the build-infra-dev
mailing list