]>
Commit | Line | Data |
---|---|---|
1ae64395 MCC |
1 | # Generate the *.h.rst files from uAPI headers |
2 | ||
573720f0 MCC |
3 | PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl |
4 | UAPI = $(srctree)/include/uapi/linux | |
96f69e0e | 5 | KAPI = $(srctree)/include/linux |
60c2820d | 6 | SRC_DIR=$(srctree)/Documentation/media |
573720f0 MCC |
7 | |
8 | FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \ | |
68cd5e0b | 9 | videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst |
1ae64395 | 10 | |
573720f0 MCC |
11 | TARGETS := $(addprefix $(BUILDDIR)/, $(FILES)) |
12 | ||
15a04d4e MCC |
13 | IMAGES = \ |
14 | typical_media_device.svg \ | |
15 | uapi/dvb/dvbstb.svg \ | |
16 | uapi/v4l/constraints.svg \ | |
76cf11aa MCC |
17 | uapi/v4l/crop.svg \ |
18 | uapi/v4l/fieldseq_bt.svg \ | |
19 | uapi/v4l/fieldseq_tb.svg \ | |
15a04d4e MCC |
20 | uapi/v4l/subdev-image-processing-full.svg \ |
21 | uapi/v4l/subdev-image-processing-scaling-multi-source.svg \ | |
22 | uapi/v4l/subdev-image-processing-crop.svg \ | |
76cf11aa MCC |
23 | uapi/v4l/vbi_525.svg \ |
24 | uapi/v4l/vbi_625.svg \ | |
25 | uapi/v4l/vbi_hsync.svg \ | |
26 | ||
15a04d4e MCC |
27 | |
28 | IMGTGT := $(patsubst %.png,%.pdf,$(patsubst %.svg,%.pdf,$(IMAGES))) | |
29 | IMGPDF := $(patsubst %,$(SRC_DIR)/%,$(IMGTGT)) | |
30 | ||
31 | cmd = $(echo-cmd) $(cmd_$(1)) | |
32 | ||
33 | quiet_cmd_genpdf = GENPDF $2 | |
34 | cmd_genpdf = convert $2 $3 | |
35 | ||
36 | %.pdf: %.svg | |
37 | @$(call cmd,genpdf,$<,$@) | |
38 | ||
39 | .PHONY: all html epub xml latex | |
40 | ||
609afe6b | 41 | all: $(BUILDDIR) ${TARGETS} |
15a04d4e MCC |
42 | html: all |
43 | epub: all | |
44 | xml: all | |
45 | latex: $(IMGPDF) all | |
46 | ||
47 | clean: | |
c54b6b37 | 48 | -rm -f $(IMGTGT) 2>/dev/null |
580e96c7 MH |
49 | |
50 | $(BUILDDIR): | |
51 | $(Q)mkdir -p $@ | |
1ae64395 | 52 | |
573720f0 MCC |
53 | # Rule to convert a .h file to inline RST documentation |
54 | ||
55 | gen_rst = \ | |
56 | echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \ | |
57 | ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions | |
58 | ||
59 | quiet_gen_rst = echo ' PARSE $(patsubst $(srctree)/%,%,$<)'; \ | |
60 | ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions | |
61 | ||
62 | silent_gen_rst = ${gen_rst} | |
63 | ||
64 | $(BUILDDIR)/audio.h.rst: ${UAPI}/dvb/audio.h ${PARSER} $(SRC_DIR)/audio.h.rst.exceptions | |
65 | @$($(quiet)gen_rst) | |
1ae64395 | 66 | |
573720f0 MCC |
67 | $(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions |
68 | @$($(quiet)gen_rst) | |
34fb8030 | 69 | |
573720f0 MCC |
70 | $(BUILDDIR)/dmx.h.rst: ${UAPI}/dvb/dmx.h ${PARSER} $(SRC_DIR)/dmx.h.rst.exceptions |
71 | @$($(quiet)gen_rst) | |
ada66bc1 | 72 | |
573720f0 MCC |
73 | $(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} $(SRC_DIR)/frontend.h.rst.exceptions |
74 | @$($(quiet)gen_rst) | |
8a6199c6 | 75 | |
573720f0 MCC |
76 | $(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions |
77 | @$($(quiet)gen_rst) | |
0c02966b | 78 | |
573720f0 MCC |
79 | $(BUILDDIR)/video.h.rst: ${UAPI}/dvb/video.h ${PARSER} $(SRC_DIR)/video.h.rst.exceptions |
80 | @$($(quiet)gen_rst) | |
447654d6 | 81 | |
580e96c7 | 82 | $(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions |
573720f0 | 83 | @$($(quiet)gen_rst) |
9f97b306 | 84 | |
d2c68150 MCC |
85 | $(BUILDDIR)/media.h.rst: ${UAPI}/media.h ${PARSER} $(SRC_DIR)/media.h.rst.exceptions |
86 | @$($(quiet)gen_rst) | |
87 | ||
96f69e0e MCC |
88 | $(BUILDDIR)/cec.h.rst: ${KAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions |
89 | @$($(quiet)gen_rst) | |
90 | ||
68cd5e0b MCC |
91 | $(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exceptions |
92 | @$($(quiet)gen_rst) | |
93 | ||
0c02966b | 94 | cleandocs: |
c54b6b37 | 95 | -rm -f ${TARGETS} |