| 1 |
# SPDX-License-Identifier: GPL-2.0-or-later |
| 2 |
# SPDX-FileCopyrightText: 2017-2021 Bartosz Golaszewski <[email protected]> |
| 3 |
# SPDX-FileCopyrightText: 2025 Bartosz Golaszewski <[email protected]> |
| 4 |
|
| 5 |
MAN_ENTRIES = |
| 6 |
MAN_DEPS = |
| 7 |
|
| 8 |
if WITH_TOOLS |
| 9 |
|
| 10 |
TOOLS = \ |
| 11 |
gpiodetect \ |
| 12 |
gpioinfo \ |
| 13 |
gpioget \ |
| 14 |
gpioset \ |
| 15 |
gpiomon \ |
| 16 |
gpionotify |
| 17 |
|
| 18 |
MAN_ENTRIES += $(TOOLS) |
| 19 |
MAN_DEPS += $(foreach dep,$(TOOLS),$(top_builddir)/tools/$(dep)) |
| 20 |
|
| 21 |
endif |
| 22 |
|
| 23 |
if WITH_DBUS |
| 24 |
|
| 25 |
GPIOCLI_CMDS = \ |
| 26 |
detect \ |
| 27 |
find \ |
| 28 |
info \ |
| 29 |
get \ |
| 30 |
monitor \ |
| 31 |
notify \ |
| 32 |
reconfigure \ |
| 33 |
release \ |
| 34 |
request \ |
| 35 |
requests \ |
| 36 |
set \ |
| 37 |
wait |
| 38 |
|
| 39 |
MAN_ENTRIES += \ |
| 40 |
gpio-manager \ |
| 41 |
gpiocli \ |
| 42 |
$(foreach cmd,$(GPIOCLI_CMDS),gpiocli-$(cmd)) |
| 43 |
|
| 44 |
MAN_DEPS += \ |
| 45 |
$(top_builddir)/dbus/manager/gpio-manager |
| 46 |
$(top_builddir)/dbus/client/gpiocli |
| 47 |
|
| 48 |
endif |
| 49 |
|
| 50 |
dist_man1_MANS := $(foreach entry,$(MAN_ENTRIES),$(entry).man) |
| 51 |
|
| 52 |
%.man: $(MAN_DEPS) |
| 53 |
$(AM_V_GEN)export PATH=$(top_builddir)/dbus/manager/:$(top_builddir)/dbus/client/:$(top_builddir)/tools/:$$PATH; \ |
| 54 |
if [ "$(*F)" = "gpio-manager" ]; then \ |
| 55 |
EXEC=$(*F); \ |
| 56 |
NAME="libgpiod D-Bus daemon"; \ |
| 57 |
HELP=--help-option=--help; \ |
| 58 |
else \ |
| 59 |
EXEC=$(if $(findstring -,$(*F)),$(word 1,$(subst -, ,$(*F))),$(*F)); \ |
| 60 |
NAME=$(if $(findstring -,$(*F)),$(word 2,$(subst -, ,$(*F))),"libgpiod command-line utility"); \ |
| 61 |
HELP=$(if $(findstring -,$(*F)),--help-option="$(word 2,$(subst -, ,$(*F))) --help",--help-option=--help); \ |
| 62 |
fi; \ |
| 63 |
help2man $$EXEC \ |
| 64 |
--include=$(srcdir)/template --output=$(builddir)/$@ --no-info \ |
| 65 |
--name="$$NAME" "$$HELP" --manual=$(*F) |
| 66 |
|
| 67 |
clean-local: |
| 68 |
rm -f $(dist_man1_MANS) |
| 69 |
|
| 70 |
EXTRA_DIST = template |