Commit acb0dea2 authored by Diego Biurrun's avatar Diego Biurrun

build: Split logic for building examples off into a separate Makefile

parent db4903eb
......@@ -154,6 +154,7 @@ endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
include $(SRC_PATH)/doc/Makefile
include $(SRC_PATH)/doc/examples/Makefile
define DOPROG
OBJS-$(1) += $(1).o $(OBJS-$(1)-yes)
......@@ -239,5 +240,4 @@ $(sort $(OBJDIRS)):
# so this saves some time on slow systems.
.SUFFIXES:
.PHONY: all all-yes alltools check *clean config examples install*
.PHONY: testprogs uninstall*
.PHONY: all all-yes alltools check *clean config install* testprogs uninstall*
......@@ -16,27 +16,11 @@ DOCS-$(CONFIG_POD2MAN) += $(MANPAGES) $(PODPAGES)
DOCS-$(CONFIG_TEXI2HTML) += $(HTMLPAGES)
DOCS = $(DOCS-yes)
DOC_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE) += decode_audio
DOC_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE) += decode_video
DOC_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE) += encode_audio
DOC_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE) += encode_video
DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE) += filter_audio
DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata
DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE) += output
DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE) += qsvdec
DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE) += transcode_aac
DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF))
ALL_DOC_EXAMPLES := $(DOC_EXAMPLES) $(DOC_EXAMPLES-:%=doc/examples/%$(EXESUF))
PROGS += $(DOC_EXAMPLES)
all: $(DOCS)
apidoc: doc/doxy/html
documentation: $(DOCS)
examples: $(DOC_EXAMPLES)
TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
GENTEXI = format codec
......@@ -63,10 +47,8 @@ doc/%.1: doc/%.pod
$(M)pod2man --section=1 --center=" " --release=" " $< > $@
$(DOCS) doc/doxy/html: | doc/
$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
OBJDIRS += doc/examples
DOXY_INPUT = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c))
DOXY_INPUT = $(addprefix $(SRC_PATH)/, $(INSTHEADERS))
DOXY_TEMPLATES = doxy_stylesheet.css footer.html header.html
DOXY_TEMPLATES := $(addprefix $(SRC_PATH)/doc/doxy/, $(DOXY_TEMPLATES))
......@@ -93,8 +75,7 @@ uninstall-man:
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
clean::
$(RM) $(ALL_DOC_EXAMPLES)
$(RM) $(CLEANSUFFIXES:%=doc/%) $(CLEANSUFFIXES:%=doc/examples/%)
$(RM) $(CLEANSUFFIXES:%=doc/%)
$(RM) doc/*.html doc/*.pod doc/*.1 doc/avoptions_*.texi
$(RM) -r doc/doxy/html
......
DOC_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE) += decode_audio
DOC_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE) += decode_video
DOC_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE) += encode_audio
DOC_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE) += encode_video
DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE) += filter_audio
DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata
DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE) += output
DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE) += qsvdec
DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE) += transcode_aac
DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF))
ALL_DOC_EXAMPLES := $(DOC_EXAMPLES) $(DOC_EXAMPLES-:%=doc/examples/%$(EXESUF))
PROGS += $(DOC_EXAMPLES)
examples: $(DOC_EXAMPLES)
$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
OBJDIRS += doc/examples
DOXY_INPUT += $(addprefix $(SRC_PATH)/, $(DOC_EXAMPLES:%$(EXESUF)=%.c))
clean::
$(RM) $(ALL_DOC_EXAMPLES)
$(RM) $(CLEANSUFFIXES:%=doc/examples/%)
.PHONY: examples
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment