Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Generate the *.h.rst files from uAPI headers
  2. PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
  3. UAPI = $(srctree)/include/uapi/linux
  4. KAPI = $(srctree)/include/linux
  5. SRC_DIR=$(srctree)/Documentation/media
  6. FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
  7. videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
  8. TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
  9. .PHONY: all
  10. all: $(BUILDDIR) ${TARGETS}
  11. $(BUILDDIR):
  12. $(Q)mkdir -p $@
  13. # Rule to convert a .h file to inline RST documentation
  14. gen_rst = \
  15. echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \
  16. ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
  17. quiet_gen_rst = echo ' PARSE $(patsubst $(srctree)/%,%,$<)'; \
  18. ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
  19. silent_gen_rst = ${gen_rst}
  20. $(BUILDDIR)/audio.h.rst: ${UAPI}/dvb/audio.h ${PARSER} $(SRC_DIR)/audio.h.rst.exceptions
  21. @$($(quiet)gen_rst)
  22. $(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions
  23. @$($(quiet)gen_rst)
  24. $(BUILDDIR)/dmx.h.rst: ${UAPI}/dvb/dmx.h ${PARSER} $(SRC_DIR)/dmx.h.rst.exceptions
  25. @$($(quiet)gen_rst)
  26. $(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} $(SRC_DIR)/frontend.h.rst.exceptions
  27. @$($(quiet)gen_rst)
  28. $(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions
  29. @$($(quiet)gen_rst)
  30. $(BUILDDIR)/video.h.rst: ${UAPI}/dvb/video.h ${PARSER} $(SRC_DIR)/video.h.rst.exceptions
  31. @$($(quiet)gen_rst)
  32. $(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions
  33. @$($(quiet)gen_rst)
  34. $(BUILDDIR)/media.h.rst: ${UAPI}/media.h ${PARSER} $(SRC_DIR)/media.h.rst.exceptions
  35. @$($(quiet)gen_rst)
  36. $(BUILDDIR)/cec.h.rst: ${KAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions
  37. @$($(quiet)gen_rst)
  38. $(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exceptions
  39. @$($(quiet)gen_rst)
  40. cleandocs:
  41. -rm ${TARGETS}