Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # SPDX-License-Identifier: GPL-2.0
  2. # Rules to convert a .h file to inline RST documentation
  3. SRC_DIR=$(srctree)/Documentation/userspace-api/media
  4. PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
  5. UAPI = $(srctree)/include/uapi/linux
  6. KAPI = $(srctree)/include/linux
  7. FILES = ca.h.rst dmx.h.rst frontend.h.rst net.h.rst \
  8. videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
  9. TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
  10. gen_rst = \
  11. echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \
  12. ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
  13. quiet_gen_rst = echo ' PARSE $(patsubst $(srctree)/%,%,$<)'; \
  14. ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
  15. silent_gen_rst = ${gen_rst}
  16. $(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions
  17. @$($(quiet)gen_rst)
  18. $(BUILDDIR)/dmx.h.rst: ${UAPI}/dvb/dmx.h ${PARSER} $(SRC_DIR)/dmx.h.rst.exceptions
  19. @$($(quiet)gen_rst)
  20. $(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} $(SRC_DIR)/frontend.h.rst.exceptions
  21. @$($(quiet)gen_rst)
  22. $(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions
  23. @$($(quiet)gen_rst)
  24. $(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions
  25. @$($(quiet)gen_rst)
  26. $(BUILDDIR)/media.h.rst: ${UAPI}/media.h ${PARSER} $(SRC_DIR)/media.h.rst.exceptions
  27. @$($(quiet)gen_rst)
  28. $(BUILDDIR)/cec.h.rst: ${UAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions
  29. @$($(quiet)gen_rst)
  30. $(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exceptions
  31. @$($(quiet)gen_rst)
  32. # Media build rules
  33. .PHONY: all html texinfo epub xml latex
  34. all: $(IMGDOT) $(BUILDDIR) ${TARGETS}
  35. html: all
  36. texinfo: all
  37. epub: all
  38. xml: all
  39. latex: $(IMGPDF) all
  40. linkcheck:
  41. clean:
  42. -rm -f $(DOTTGT) $(IMGTGT) ${TARGETS} 2>/dev/null
  43. $(BUILDDIR):
  44. $(Q)mkdir -p $@