aboutsummaryrefslogtreecommitdiff
path: root/Makefile.luarocks
blob: f0652891f47bbb367522763f76228d8ed94c98cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

include Makefile.setup.inc
include Makefile.install.inc

.PHONY: all install copy_site_config

all:
	@echo This Makefile is used by the LuaRocks rockspec for upgrading itself.

install: install_bins install_luas copy_site_config

copy_site_config:
	luaver="$(LUA_VERSION)" && [ -n "$$luaver" ] || luaver=`$(LUA) -e 'print(_VERSION:sub(5))'`; \
	mkdir -p "$(DESTDIR)$(LUADIR)/luarocks"; \
	site_config="site_config_$(echo "$luaver" | sed 's,\.,_,').lua"
	lprefix=$(echo "$(LUADIR)" | sed 's,/lib/luarocks/.*,,'); sed "s,LUAROCKS_PREFIX=.*,LUAROCKS_PREFIX=[[$$lprefix]],g" "$(LUAROCKS_PREFIX)/share/lua/$$luaver/luarocks/core/$$site_config" > "$(DESTDIR)$(LUADIR)/luarocks/core/$$site_config"