From 449297aa6502e7e8f1f871cc95704dc417a6ed79 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 5 Aug 2018 12:52:10 +1000 Subject: Makefile: Use 'install' for installing lua source files --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fa3ff4e8..5b8f6377 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ INSTALL ?= install INSTALL_DATA ?= $(INSTALL) -m 644 +LUAROCKS_FILES = $(shell find src/luarocks/ -type f -name '*.lua') all: build @@ -56,9 +57,7 @@ luarocks-admin: config.unix # Regular install # ---------------------------------------- -install: all $(DESTDIR)$(prefix)/bin/luarocks $(DESTDIR)$(prefix)/bin/luarocks-admin $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua - mkdir -p "$(DESTDIR)$(prefix)/share/lua/$(LUA_VERSION)/luarocks" - cp -a src/luarocks/* "$(DESTDIR)$(prefix)/share/lua/$(LUA_VERSION)/luarocks" +install: $(DESTDIR)$(prefix)/bin/luarocks $(DESTDIR)$(prefix)/bin/luarocks-admin $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua $(patsubst src/%, $(DESTDIR)$(prefix)/share/lua/$(LUA_VERSION)/%, $(LUAROCKS_FILES)) $(DESTDIR)$(prefix)/bin/luarocks: ./build/luarocks $(INSTALL) -D "$<" "$@" @@ -66,6 +65,9 @@ $(DESTDIR)$(prefix)/bin/luarocks: ./build/luarocks $(DESTDIR)$(prefix)/bin/luarocks-admin: ./build/luarocks-admin $(INSTALL) -D "$<" "$@" +$(DESTDIR)$(prefix)/share/lua/$(LUA_VERSION)/luarocks/%.lua: src/luarocks/%.lua + $(INSTALL_DATA) -D "$<" "$@" + $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua: config-$(LUA_VERSION).lua.in $(INSTALL_DATA) -D "$<" "$@" -- cgit v1.2.3-55-g6feb