~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/bpf/bpftool/Documentation/Makefile

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2 include ../../../scripts/Makefile.include
  3 
  4 INSTALL ?= install
  5 RM ?= rm -f
  6 RMDIR ?= rmdir --ignore-fail-on-non-empty
  7 
  8 ifeq ($(V),1)
  9   Q =
 10 else
 11   Q = @
 12 endif
 13 
 14 prefix ?= /usr/local
 15 mandir ?= $(prefix)/man
 16 man8dir = $(mandir)/man8
 17 
 18 MAN8_RST = $(wildcard bpftool*.rst)
 19 
 20 _DOC_MAN8 = $(patsubst %.rst,%.8,$(MAN8_RST))
 21 DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8))
 22 
 23 man: man8
 24 man8: $(DOC_MAN8)
 25 
 26 RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
 27 RST2MAN_OPTS += --verbose --strip-comments
 28 
 29 list_pages = $(sort $(basename $(filter-out $(1),$(MAN8_RST))))
 30 see_also = $(subst " ",, \
 31         "\n" \
 32         "SEE ALSO\n" \
 33         "========\n" \
 34         "**bpf**\ (2),\n" \
 35         "**bpf-helpers**\\ (7)" \
 36         $(foreach page,$(call list_pages,$(1)),",\n**$(page)**\\ (8)") \
 37         "\n")
 38 
 39 $(OUTPUT)%.8: %.rst
 40 ifndef RST2MAN_DEP
 41         $(error "rst2man not found, but required to generate man pages")
 42 endif
 43         $(QUIET_GEN)( cat $< ; printf "%b" $(call see_also,$<) ) | rst2man $(RST2MAN_OPTS) > $@
 44 
 45 clean:
 46         $(call QUIET_CLEAN, Documentation)
 47         $(Q)$(RM) $(DOC_MAN8)
 48 
 49 install: man
 50         $(call QUIET_INSTALL, Documentation-man)
 51         $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
 52         $(Q)$(INSTALL) -m 644 $(DOC_MAN8) $(DESTDIR)$(man8dir)
 53 
 54 uninstall:
 55         $(call QUIET_UNINST, Documentation-man)
 56         $(Q)$(RM) $(addprefix $(DESTDIR)$(man8dir)/,$(_DOC_MAN8))
 57         $(Q)$(RMDIR) $(DESTDIR)$(man8dir)
 58 
 59 .PHONY: man man8 clean install uninstall
 60 .DEFAULT_GOAL := man

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php