aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index ca2f379b..1b582933 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,9 @@
1 1
2-include config.unix 2-include config.unix
3 3
4INSTALL ?= install
5
6
4all: luarocks luarocks-admin 7all: luarocks luarocks-admin
5 8
6# ---------------------------------------- 9# ----------------------------------------
@@ -40,23 +43,27 @@ install: all $(DESTDIR)$(prefix)/bin/luarocks $(DESTDIR)$(prefix)/bin/luarocks-a
40 mkdir -p "$(DESTDIR)$(prefix)/share/lua/$(LUA_VERSION)/luarocks" 43 mkdir -p "$(DESTDIR)$(prefix)/share/lua/$(LUA_VERSION)/luarocks"
41 cp -a src/luarocks/* "$(DESTDIR)$(prefix)/share/lua/$(LUA_VERSION)/luarocks" 44 cp -a src/luarocks/* "$(DESTDIR)$(prefix)/share/lua/$(LUA_VERSION)/luarocks"
42 45
43$(DESTDIR)$(prefix)/bin/luarocks: src/bin/luarocks config.unix 46./build/luarocks: src/bin/luarocks config.unix
44 mkdir -p "$(@D)" 47 mkdir -p "$(@D)"
45 (printf '#!$(LUA_BINDIR)/$(LUA_INTERPRETER)\n'\ 48 (printf '#!$(LUA_BINDIR)/$(LUA_INTERPRETER)\n'\
46 'package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ 49 'package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\
47 'package.path=[[$(prefix)/share/lua/$(LUA_VERSION)/?.lua;]] .. package.path\n'; \ 50 'package.path=[[$(prefix)/share/lua/$(LUA_VERSION)/?.lua;]] .. package.path\n'; \
48 tail -n +2 src/bin/luarocks \ 51 tail -n +2 src/bin/luarocks \
49 )> "$@" 52 )> "$@"
50 chmod +rx $@
51 53
52$(DESTDIR)$(prefix)/bin/luarocks-admin: src/bin/luarocks-admin config.unix 54./build/luarocks-admin: src/bin/luarocks-admin config.unix
53 mkdir -p "$(@D)" 55 mkdir -p "$(@D)"
54 (printf '#!$(LUA_BINDIR)/$(LUA_INTERPRETER)\n'\ 56 (printf '#!$(LUA_BINDIR)/$(LUA_INTERPRETER)\n'\
55 'package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ 57 'package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\
56 'package.path=[[$(prefix)/share/lua/$(LUA_VERSION)/?.lua;]] .. package.path\n'; \ 58 'package.path=[[$(prefix)/share/lua/$(LUA_VERSION)/?.lua;]] .. package.path\n'; \
57 tail -n +2 src/bin/luarocks-admin \ 59 tail -n +2 src/bin/luarocks-admin \
58 )> "$@" 60 )> "$@"
59 chmod +rx $@ 61
62$(DESTDIR)$(prefix)/bin/luarocks: ./build/luarocks
63 $(INSTALL) -D "$<" "$@"
64
65$(DESTDIR)$(prefix)/bin/luarocks-admin: ./build/luarocks-admin
66 $(INSTALL) -D "$<" "$@"
60 67
61$(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua: config-$(LUA_VERSION).lua.in 68$(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua: config-$(LUA_VERSION).lua.in
62 mkdir -p "$(DESTDIR)$(luarocksconfdir)" 69 mkdir -p "$(DESTDIR)$(luarocksconfdir)"
@@ -115,6 +122,7 @@ clean:
115 rm -f ./config.unix 122 rm -f ./config.unix
116 rm -f ./luarocks 123 rm -f ./luarocks
117 rm -f ./luarocks-admin 124 rm -f ./luarocks-admin
125 rm -rf ./build/
118 rm -rf build-binary 126 rm -rf build-binary
119 rm -rf ./.luarocks 127 rm -rf ./.luarocks
120 rm -rf ./lua_modules 128 rm -rf ./lua_modules