From 2944a0bf20710144f58dd166374c6e48c66e2865 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 5 Aug 2018 16:15:27 +1000 Subject: GNUmakefile: Clean up the install-binary target --- GNUmakefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 31620502..97fada4d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -132,15 +132,12 @@ build-binary/luarocks-admin.exe: luarocks # Binary install # ---------------------------------------- -install-binary: build-binary/luarocks.exe build-binary/luarocks-admin.exe - mkdir -p "$(DESTDIR)$(bindir)" - cp build-binary/luarocks.exe "$(DESTDIR)$(bindir)/luarocks" - chmod +rx "$(DESTDIR)$(bindir)/luarocks" - cp build-binary/luarocks-admin.exe "$(DESTDIR)$(bindir)/luarocks-admin" - chmod +rx "$(DESTDIR)$(bindir)/luarocks-admin" - mkdir -p "$(DESTDIR)$(luadir)/luarocks/core" - cp -a src/luarocks/core/* "$(DESTDIR)$(luadir)/luarocks/core" - cp -a src/luarocks/loader.lua "$(DESTDIR)$(luadir)/luarocks/" +LUAROCKS_CORE_FILES = $(wildcard src/luarocks/core/* src/luarocks/loader.lua) +INSTALL_BINARY_FILES = $(patsubst src/%, $(DESTDIR)$(luadir)/%, $(LUAROCKS_CORE_FILES)) + +install-binary: $(INSTALL_BINARY_FILES) build-binary/luarocks.exe build-binary/luarocks-admin.exe + $(INSTALL) -D build-binary/luarocks.exe "$(DESTDIR)$(bindir)/luarocks" + $(INSTALL) -D build-binary/luarocks-admin.exe "$(DESTDIR)$(bindir)/luarocks-admin" # ---------------------------------------- # Bootstrap install -- cgit v1.2.3-55-g6feb