Makefile 6.59 KB
Newer Older
1 2 3 4 5 6 7
LIBRARIES-$(CONFIG_AVUTIL)     += libavutil
LIBRARIES-$(CONFIG_SWSCALE)    += libswscale
LIBRARIES-$(CONFIG_SWRESAMPLE) += libswresample
LIBRARIES-$(CONFIG_AVCODEC)    += libavcodec
LIBRARIES-$(CONFIG_AVFORMAT)   += libavformat
LIBRARIES-$(CONFIG_AVDEVICE)   += libavdevice
LIBRARIES-$(CONFIG_AVFILTER)   += libavfilter
8

9 10 11 12 13 14 15
COMPONENTS-$(CONFIG_AVUTIL)     += ffmpeg-utils
COMPONENTS-$(CONFIG_SWSCALE)    += ffmpeg-scaler
COMPONENTS-$(CONFIG_SWRESAMPLE) += ffmpeg-resampler
COMPONENTS-$(CONFIG_AVCODEC)    += ffmpeg-codecs ffmpeg-bitstream-filters
COMPONENTS-$(CONFIG_AVFORMAT)   += ffmpeg-formats ffmpeg-protocols
COMPONENTS-$(CONFIG_AVDEVICE)   += ffmpeg-devices
COMPONENTS-$(CONFIG_AVFILTER)   += ffmpeg-filters
16

17
MANPAGES1   = $(AVPROGS-yes:%=doc/%.1)    $(AVPROGS-yes:%=doc/%-all.1)    $(COMPONENTS-yes:%=doc/%.1)
18 19
MANPAGES3   = $(LIBRARIES-yes:%=doc/%.3)
MANPAGES    = $(MANPAGES1) $(MANPAGES3)
20 21
PODPAGES    = $(AVPROGS-yes:%=doc/%.pod)  $(AVPROGS-yes:%=doc/%-all.pod)  $(COMPONENTS-yes:%=doc/%.pod)  $(LIBRARIES-yes:%=doc/%.pod)
HTMLPAGES   = $(AVPROGS-yes:%=doc/%.html) $(AVPROGS-yes:%=doc/%-all.html) $(COMPONENTS-yes:%=doc/%.html) $(LIBRARIES-yes:%=doc/%.html) \
22 23
              doc/developer.html                                        \
              doc/faq.html                                              \
24
              doc/fate.html                                             \
25
              doc/general.html                                          \
26
              doc/git-howto.html                                        \
27
              doc/nut.html                                              \
28
              doc/platform.html                                         \
29

30 31 32
TXTPAGES    = doc/fate.txt                                              \


33 34 35 36
DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
DOCS-$(CONFIG_PODPAGES)  += $(PODPAGES)
DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
37
DOCS = $(DOCS-yes)
38

39
DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE)      += avio_reading
40
DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE)           += avcodec
41
DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
42
DOC_EXAMPLES-$(CONFIG_DEMUXING_DECODING_EXAMPLE) += demuxing_decoding
43
DOC_EXAMPLES-$(CONFIG_EXTRACT_MVS_EXAMPLE)       += extract_mvs
44
DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)      += filter_audio
45 46 47
DOC_EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE)   += filtering_audio
DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE)   += filtering_video
DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)          += metadata
48
DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE)            += muxing
49
DOC_EXAMPLES-$(CONFIG_REMUXING_EXAMPLE)          += remuxing
50 51
DOC_EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE)  += resampling_audio
DOC_EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE)     += scaling_video
52
DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)     += transcode_aac
53
DOC_EXAMPLES-$(CONFIG_TRANSCODING_EXAMPLE)       += transcoding
54
ALL_DOC_EXAMPLES_LIST = $(DOC_EXAMPLES-) $(DOC_EXAMPLES-yes)
55

56
DOC_EXAMPLES       := $(DOC_EXAMPLES-yes:%=doc/examples/%$(PROGSSUF)$(EXESUF))
57 58
ALL_DOC_EXAMPLES   := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)$(EXESUF))
ALL_DOC_EXAMPLES_G := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)_g$(EXESUF))
59
PROGS              += $(DOC_EXAMPLES)
60

61 62
all-$(CONFIG_DOC): doc

63
doc: documentation
64

65
apidoc: doc/doxy/html
66 67
documentation: $(DOCS)

68 69
examples: $(DOC_EXAMPLES)

70
TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d)
71

72 73 74 75 76
doc/%.txt: TAG = TXT
doc/%.txt: doc/%.texi
	$(Q)$(TEXIDEP)
	$(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null

77 78 79 80
GENTEXI  = format codec
GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)

$(GENTEXI): TAG = GENTEXI
81
$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
82 83
	$(M)doc/print_options $* > $@

84
doc/%.html: TAG = HTML
85 86 87 88 89 90 91 92 93 94 95
doc/%-all.html: TAG = HTML

ifdef HAVE_MAKEINFO_HTML
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
	$(Q)$(TEXIDEP)
	$(M)makeinfo --html -I doc --no-split -D config-not-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<

doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
	$(Q)$(TEXIDEP)
	$(M)makeinfo --html -I doc --no-split -D config-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
else
96
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
97
	$(Q)$(TEXIDEP)
98 99 100 101 102
	$(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<

doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
	$(Q)$(TEXIDEP)
	$(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
103
endif
104 105

doc/%.pod: TAG = POD
106
doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
107
	$(Q)$(TEXIDEP)
108 109 110 111 112 113
	$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@

doc/%-all.pod: TAG = POD
doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
	$(Q)$(TEXIDEP)
	$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
114

115
doc/%.1 doc/%.3: TAG = MAN
116
doc/%.1: doc/%.pod $(GENTEXI)
117
	$(M)pod2man --section=1 --center=" " --release=" " --date=" " $< > $@
118
doc/%.3: doc/%.pod $(GENTEXI)
119
	$(M)pod2man --section=3 --center=" " --release=" " --date=" " $< > $@
120

121
$(DOCS) doc/doxy/html: | doc/
122
$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
123
OBJDIRS += doc/examples
124

125
DOXY_INPUT      = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c))
126

Timothy Gu's avatar
Timothy Gu committed
127
doc/doxy/html: TAG = DOXY
128
doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT)
129
	$(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXYGEN) $(DOXY_INPUT)
130

131 132
install-doc: install-html install-man

133
install-html:
134

135 136
install-man:

137
ifdef CONFIG_HTMLPAGES
138
install-progs-$(CONFIG_DOC): install-html
139

140
install-html: $(HTMLPAGES)
141 142
	$(Q)mkdir -p "$(DOCDIR)"
	$(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
143 144 145
endif

ifdef CONFIG_MANPAGES
146
install-progs-$(CONFIG_DOC): install-man
147 148 149

install-man: $(MANPAGES)
	$(Q)mkdir -p "$(MANDIR)/man1"
150 151 152
	$(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1"
	$(Q)mkdir -p "$(MANDIR)/man3"
	$(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3"
153
endif
154

155 156 157
uninstall: uninstall-doc

uninstall-doc: uninstall-html uninstall-man
158

159
uninstall-html:
160
	$(RM) -r "$(DOCDIR)"
161 162

uninstall-man:
163
	$(RM) $(addprefix "$(MANDIR)/man1/",$(AVPROGS-yes:%=%.1) $(AVPROGS-yes:%=%-all.1) $(COMPONENTS-yes:%=%.1))
164
	$(RM) $(addprefix "$(MANDIR)/man3/",$(LIBRARIES-yes:%=%.3))
165

166
clean:: docclean
167

168 169 170
distclean:: docclean
	$(RM) doc/config.texi

171
examplesclean:
172
	$(RM) $(ALL_DOC_EXAMPLES) $(ALL_DOC_EXAMPLES_G)
173 174 175 176
	$(RM) $(CLEANSUFFIXES:%=doc/examples/%)

docclean: examplesclean
	$(RM) $(CLEANSUFFIXES:%=doc/%)
177
	$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi
178
	$(RM) -r doc/doxy/html
179 180 181

-include $(wildcard $(DOCS:%=%.d))

182
.PHONY: apidoc doc documentation