65 lines · plain
1# SPDX-License-Identifier: GPL-2.02 3# Rules to convert a .h file to inline RST documentation4 5SRC_DIR=$(srctree)/Documentation/userspace-api/media6PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl7UAPI = $(srctree)/include/uapi/linux8KAPI = $(srctree)/include/linux9 10FILES = ca.h.rst dmx.h.rst frontend.h.rst net.h.rst \11 videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst12 13TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))14 15gen_rst = \16 echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \17 ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions18 19quiet_gen_rst = echo ' PARSE $(patsubst $(srctree)/%,%,$<)'; \20 ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions21 22silent_gen_rst = ${gen_rst}23 24$(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions25 @$($(quiet)gen_rst)26 27$(BUILDDIR)/dmx.h.rst: ${UAPI}/dvb/dmx.h ${PARSER} $(SRC_DIR)/dmx.h.rst.exceptions28 @$($(quiet)gen_rst)29 30$(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} $(SRC_DIR)/frontend.h.rst.exceptions31 @$($(quiet)gen_rst)32 33$(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions34 @$($(quiet)gen_rst)35 36$(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions37 @$($(quiet)gen_rst)38 39$(BUILDDIR)/media.h.rst: ${UAPI}/media.h ${PARSER} $(SRC_DIR)/media.h.rst.exceptions40 @$($(quiet)gen_rst)41 42$(BUILDDIR)/cec.h.rst: ${UAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions43 @$($(quiet)gen_rst)44 45$(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exceptions46 @$($(quiet)gen_rst)47 48# Media build rules49 50.PHONY: all html texinfo epub xml latex51 52all: $(IMGDOT) $(BUILDDIR) ${TARGETS}53html: all54texinfo: all55epub: all56xml: all57latex: $(IMGPDF) all58linkcheck:59 60clean:61 -rm -f $(DOTTGT) $(IMGTGT) ${TARGETS} 2>/dev/null62 63$(BUILDDIR):64 $(Q)mkdir -p $@65