Allow to pass --reflink=auto to cp command in Makefile

Use `make CP_OPTS='--reflink=auto' install` to speed up file coping on
file systems with Copy-on-Write support
This commit is contained in:
Serhii Yeremenko 2023-10-28 12:04:30 +03:00
parent 3d63a18db2
commit efbba7edaa
No known key found for this signature in database
GPG key ID: AB6D54C1C16D2507

View file

@ -4,6 +4,7 @@
PREFIX ?= /usr
ICON_THEMES ?= $(patsubst %/index.theme,%,$(wildcard */index.theme))
EXCLUDE ?=
CP_OPTS ?=
# exclude icon theme(s) from ICON_THEMES list
ICON_THEMES := $(filter-out $(EXCLUDE), $(ICON_THEMES))
@ -12,7 +13,7 @@ all:
install:
mkdir -p "$(DESTDIR)$(PREFIX)/share/icons"
cp -R $(ICON_THEMES) "$(DESTDIR)$(PREFIX)/share/icons"
cp -R $(CP_OPTS) -- $(ICON_THEMES) "$(DESTDIR)$(PREFIX)/share/icons"
# skip building icon caches when packaging
$(if $(DESTDIR),,$(MAKE) $(ICON_THEMES))