Skip to content

Commit

Permalink
mirror: fix building documentation targets
Browse files Browse the repository at this point in the history
The callable `descend` command in Makefile.include is currently broken
due to two reasons:
1. It is defined only for cases when the output is not suppressed by
   either `V=1` or `-s`.
2. The condition for checking the absence of `-s` is broken and it fails
   every time there is a variable definition containing the letter 's'.

The `descend` command is used in documentation targets and due to these
errors, these targets fail to build in the following cases:

    $ make V=1 doc
    make: Nothing to be done for 'doc'.

    $ make prefix="/usr" doc    # <- `prefix="/usr"` contains letter 's'
    make: Nothing to be done for 'doc'.

This fixes the two above issues by (1) defining `descend` for all cases
and (2) fixing the `-s` check by querying the first word of `MAKEFLAGS`
which is the correct approach for make-4.0 and higher.

Signed-off-by: Viktor Malik <viktor.malik@gmail.com>
  • Loading branch information
viktormalik authored and qmonnet committed Sep 2, 2024
1 parent 64402b8 commit b3d4318
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ EXTRA_WARNINGS := \
-Wundef \
-Wwrite-strings \

ifeq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
define descend
mkdir -p $(OUTPUT)$(1) && \
$(MAKE) --no-print-directory -C $(1) $(2)
endef

ifeq ($(findstring s,$(firstword -$(MAKEFLAGS))),)
ifneq ($(V),1)

define def_quiet_msg
Expand Down

0 comments on commit b3d4318

Please sign in to comment.