Welcome to little lamb

Code » comain » commit c57e4bb

common.mk: Fix install-data

author Olivier Brunel
2023-07-18 11:53:52 UTC
committer Olivier Brunel
2023-07-18 16:29:11 UTC
parent 97eb89ef44de46dae4325a21f680f08e044c34cf

common.mk: Fix install-data

DATA are expected to be built (in build/) but shouldn't be installed in
a build directory.

common.mk +3 -3

diff --git a/common.mk b/common.mk
index 581a0e3..dd339fd 100644
--- a/common.mk
+++ b/common.mk
@@ -170,8 +170,8 @@ dummy%:
 	@:
 
 # install data
-$(DESTDIR)$(SHAREDIR)/$(PROJECT_NAME)/%: %
-	$(_INST) install -D -m 644 $< $@
+$(DESTDIR)$(SHAREDIR)/$(PROJECT_NAME)/%:
+	$(_INST) install -D -m 644 $(@:$(DESTDIR)$(SHAREDIR)/$(PROJECT_NAME)/%=build/%) $@
 
 
 install-bins: $(BINS:%=$(DESTDIR)$(BINDIR)/%)
@@ -185,7 +185,7 @@ install-priv: $(PRIV_STATIC_LIBS:%=$(DESTDIR)$(LIBDIR)/$(PROJECT_NAME)/%) \
 
 install-docs: $(DOCS:%=$(DESTDIR)$(SHAREDIR)/doc/$(PROJECT_NAME)/%)
 
-install-data: $(DATA:%=$(DESTDIR)$(SHAREDIR)/$(PROJECT_NAME)/%)
+install-data: $(DATA) $(DATA:build/%=$(DESTDIR)$(SHAREDIR)/$(PROJECT_NAME)/%)
 
 install: install-bins install-libs install-priv install-docs install-data