Skip to content

Commit

Permalink
build: support make help-overrides and make help-options
Browse files Browse the repository at this point in the history
These provide only *part* of the make help output, and as a side
benefit shuffle the output into a somewhat better order.

Used by the upcoming configure script to avoid needlessly
reduplicating help text.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
nickalcock authored and kvanhees committed Feb 7, 2024
1 parent 7e44ad9 commit 5528219
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Makeconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CONFIG_MK = $(objdir)/config.mk
#
# Syntax: $(call make-override-help,var,help-string)
define make-override-help
help::
help-overrides::
width=$$$$(printf '$(1)=[yes/no]' | wc -c); \
tabs="\t\t\t\t"; \
if [[ $$$${width} -gt 31 ]]; then \
Expand Down Expand Up @@ -144,7 +144,7 @@ $(CONFIG_MK):
echo 'CONFIGURED := yes' >> $(objdir)/config.mk
cat $(objdir)/.config/*.mk >> $(objdir)/config.mk 2>/dev/null || true

help::
help-overrides::
printf "Overrides for library and symbol searches:\n\n" >&2

$(eval $(call check-symbol-rule,ELF_GETSHDRSTRNDX,elf_getshdrstrndx,elf))
Expand All @@ -163,5 +163,7 @@ $(eval $(call check-header-rule,DIS4,disassembler(0,0,0,NULL),dis-asm))
$(eval $(call check-header-rule,INITDISINFO3,init_disassemble_info(NULL,NULL,NULL),dis-asm))
$(eval $(call check-header-rule,INITDISINFO4,init_disassemble_info(NULL,NULL,NULL,NULL),dis-asm))

help::
help-overrides::
printf "\n" >&2

help:: help-overrides
6 changes: 5 additions & 1 deletion Makeoptions
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ coverage ?= no
verbose ?= no
libfuse2 ?= no

help::
help-options::
@printf "Options:\n\n" >&2
@printf "make debugging=yes [targets]\tDisable optimization to make debugger use easier\n" >&2
@printf "make coverage=yes [targets]\tTurn on coverage support in the testsuite\n" >&2
@printf "make verbose=yes [target]\tEnable verbose building\n" >&2
@printf "make dof_dbg=yes [targets]\tTurn on especially noisy DOF parser debugging\n\n" >&2

help-dependencies::
@printf "Dependencies:\n\n" >&2
@printf "make libfuse2=yes [targets]\tBuild against libfuse 2 even if libfuse 3 is found\n\n" >&2

help:: help-options help-dependencies

ifneq ($(debugging),no)
override CFLAGS += -O0 -g
endif
Expand Down

0 comments on commit 5528219

Please sign in to comment.