aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/Makefile
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-10-05 00:47:41 -0300
committerJames Almer <jamrial@gmail.com>2017-10-05 11:35:56 -0300
commitcafd9d66ed9e1bad4ae579a3935f7af57a567a51 (patch)
tree34f2a7eb69bbf42c9920d9b4a5421c865c5bb701 /doc/examples/Makefile
parent0a499d6a57409926011e1952fcf7ca39224663d6 (diff)
downloadffmpeg-cafd9d66ed9e1bad4ae579a3935f7af57a567a51.tar.gz
build: add install targets for the examples
Split it off from install-data. Among other things, this prevents spamming triplicate log lines during install. Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'doc/examples/Makefile')
-rw-r--r--doc/examples/Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
index af000d9ddb..58afd71b85 100644
--- a/doc/examples/Makefile
+++ b/doc/examples/Makefile
@@ -26,8 +26,8 @@ ALL_EXAMPLES := $(EXAMPLES) $(EXAMPLES-:%=doc/examples/%$(PROGSSUF)$(EXESUF))
ALL_EXAMPLES_G := $(EXAMPLES_G) $(EXAMPLES-:%=doc/examples/%$(PROGSSUF)_g$(EXESUF))
PROGS += $(EXAMPLES)
-EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/README
EXAMPLE_MAKEFILE := $(SRC_PATH)/doc/examples/Makefile
+EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/README $(EXAMPLE_MAKEFILE)
$(foreach P,$(EXAMPLES),$(eval OBJS-$(P:%$(PROGSSUF)$(EXESUF)=%) = $(P:%$(PROGSSUF)$(EXESUF)=%).o))
$(EXAMPLES_G): %$(PROGSSUF)_g$(EXESUF): %.o
@@ -39,6 +39,18 @@ OBJDIRS += doc/examples
DOXY_INPUT += $(EXAMPLES:%$(PROGSSUF)$(EXESUF)=%.c)
+install: install-examples
+
+install-examples: $(EXAMPLES_FILES)
+ $(Q)mkdir -p "$(DATADIR)/examples"
+ $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
+ $(INSTALL) -m 644 $(EXAMPLE_MAKEFILE:%=%.example) "$(DATADIR)/examples/Makefile"
+
+uninstall: uninstall-examples
+
+uninstall-examples:
+ $(RM) -r "$(DATADIR)/examples"
+
examplesclean:
$(RM) $(ALL_EXAMPLES) $(ALL_EXAMPLES_G)
$(RM) $(CLEANSUFFIXES:%=doc/examples/%)