diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -3,6 +3,12 @@ include prelude.mk .PHONY: DO DO: +PKG_NAME ?= config-links +DESTDIR ?= + +$(eval $(call noexpand,PKG_NAME)) +$(eval $(call noexpand,DESTDIR)) + .PHONY: all all: test @@ -22,3 +28,17 @@ test/docker/%: DO # Keep the list repositories synced with the GitHub actions workflow. .PHONY: test/docker test/docker: test/docker/xenial test/docker/focal + +.PHONY: install +install: + install -D -m 0644 -t '$(call escape,$(DESTDIR)/usr/share/$(PKG_NAME))' LICENSE.txt + install -D -m 0644 -t '$(call escape,$(DESTDIR)/usr/share/doc/$(PKG_NAME))' README.md + + find bin -type f -exec install -D -m 0755 -t '$(call escape,$(DESTDIR)/usr/lib/$(PKG_NAME)/bin)' {} ';' + find lib -type f -exec install -D -m 0644 -t '$(call escape,$(DESTDIR)/usr/lib/$(PKG_NAME)/lib)' {} ';' + + install -d '$(call escape,$(DESTDIR)/usr/bin)' + find '$(call escape,$(DESTDIR)/usr/lib/$(PKG_NAME)/bin)' -type f -printf '%P\0' | \ + while IFS= read -d '' -r file; do \ + ln -s -- '$(call escape,/usr/lib/$(PKG_NAME)/bin/)'"$$file" '$(call escape,$(DESTDIR)/usr/bin)' ; \ + done |
