Commit cafd9d66 authored by James Almer's avatar James Almer

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: 's avatarClément Bœsch <u@pkh.me>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 0a499d6a
...@@ -120,11 +120,9 @@ install: install-libs install-headers ...@@ -120,11 +120,9 @@ install: install-libs install-headers
install-libs: install-libs-yes install-libs: install-libs-yes
install-data: $(DATA_FILES) $(EXAMPLES_FILES) $(EXAMPLE_MAKEFILE) install-data: $(DATA_FILES)
$(Q)mkdir -p "$(DATADIR)/examples" $(Q)mkdir -p "$(DATADIR)"
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)" $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
$(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
$(INSTALL) -m 644 $(EXAMPLE_MAKEFILE:%=%.example) "$(DATADIR)/examples/Makefile"
uninstall: uninstall-libs uninstall-headers uninstall-data uninstall: uninstall-libs uninstall-headers uninstall-data
......
...@@ -26,8 +26,8 @@ ALL_EXAMPLES := $(EXAMPLES) $(EXAMPLES-:%=doc/examples/%$(PROGSSUF)$(EXESUF)) ...@@ -26,8 +26,8 @@ ALL_EXAMPLES := $(EXAMPLES) $(EXAMPLES-:%=doc/examples/%$(PROGSSUF)$(EXESUF))
ALL_EXAMPLES_G := $(EXAMPLES_G) $(EXAMPLES-:%=doc/examples/%$(PROGSSUF)_g$(EXESUF)) ALL_EXAMPLES_G := $(EXAMPLES_G) $(EXAMPLES-:%=doc/examples/%$(PROGSSUF)_g$(EXESUF))
PROGS += $(EXAMPLES) PROGS += $(EXAMPLES)
EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/README
EXAMPLE_MAKEFILE := $(SRC_PATH)/doc/examples/Makefile 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)) $(foreach P,$(EXAMPLES),$(eval OBJS-$(P:%$(PROGSSUF)$(EXESUF)=%) = $(P:%$(PROGSSUF)$(EXESUF)=%).o))
$(EXAMPLES_G): %$(PROGSSUF)_g$(EXESUF): %.o $(EXAMPLES_G): %$(PROGSSUF)_g$(EXESUF): %.o
...@@ -39,6 +39,18 @@ OBJDIRS += doc/examples ...@@ -39,6 +39,18 @@ OBJDIRS += doc/examples
DOXY_INPUT += $(EXAMPLES:%$(PROGSSUF)$(EXESUF)=%.c) 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: examplesclean:
$(RM) $(ALL_EXAMPLES) $(ALL_EXAMPLES_G) $(RM) $(ALL_EXAMPLES) $(ALL_EXAMPLES_G)
$(RM) $(CLEANSUFFIXES:%=doc/examples/%) $(RM) $(CLEANSUFFIXES:%=doc/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