diff options
author | daurnimator <quae@daurnimator.com> | 2018-08-05 11:35:12 +1000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-08-10 16:52:18 -0300 |
commit | ad717af4711046700ebe63ad8cff064faf990158 (patch) | |
tree | 34334532cd03febaab1be32dd1ca84586ebe2329 | |
parent | 8a56ab88813e0a2546c3358f02731c407c1658d3 (diff) | |
download | luarocks-ad717af4711046700ebe63ad8cff064faf990158.tar.gz luarocks-ad717af4711046700ebe63ad8cff064faf990158.tar.bz2 luarocks-ad717af4711046700ebe63ad8cff064faf990158.zip |
Makefile: Use printf and single file redirection instead of multiple echos
-rw-r--r-- | Makefile | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -42,18 +42,20 @@ install: all $(DESTDIR)$(prefix)/bin/luarocks $(DESTDIR)$(prefix)/bin/luarocks-a | |||
42 | 42 | ||
43 | $(DESTDIR)$(prefix)/bin/luarocks: src/bin/luarocks config.unix | 43 | $(DESTDIR)$(prefix)/bin/luarocks: src/bin/luarocks config.unix |
44 | mkdir -p "$(@D)" | 44 | mkdir -p "$(@D)" |
45 | echo "#!$(LUA_BINDIR)/$(LUA_INTERPRETER)" > $@ | 45 | (printf '#!$(LUA_BINDIR)/$(LUA_INTERPRETER)\n'\ |
46 | echo "package.loaded['luarocks.core.hardcoded'] = { SYSCONFDIR = [[$(luarocksconfdir)]] }" >> $@ | 46 | 'package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ |
47 | echo "package.path=[[$(prefix)/share/lua/$(LUA_VERSION)/?.lua;]] .. package.path" >> $@ | 47 | 'package.path=[[$(prefix)/share/lua/$(LUA_VERSION)/?.lua;]] .. package.path\n'; \ |
48 | tail -n +2 src/bin/luarocks >> $@ | 48 | tail -n +2 src/bin/luarocks \ |
49 | )> "$@" | ||
49 | chmod +rx $@ | 50 | chmod +rx $@ |
50 | 51 | ||
51 | $(DESTDIR)$(prefix)/bin/luarocks-admin: src/bin/luarocks-admin config.unix | 52 | $(DESTDIR)$(prefix)/bin/luarocks-admin: src/bin/luarocks-admin config.unix |
52 | mkdir -p "$(@D)" | 53 | mkdir -p "$(@D)" |
53 | echo "#!$(LUA_BINDIR)/$(LUA_INTERPRETER)" > $@ | 54 | (printf '#!$(LUA_BINDIR)/$(LUA_INTERPRETER)\n'\ |
54 | echo "package.loaded['luarocks.core.hardcoded'] = { SYSCONFDIR = [[$(luarocksconfdir)]] }" >> $@ | 55 | 'package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ |
55 | echo "package.path=[[$(prefix)/share/lua/$(LUA_VERSION)/?.lua;]] .. package.path" >> $@ | 56 | 'package.path=[[$(prefix)/share/lua/$(LUA_VERSION)/?.lua;]] .. package.path\n'; \ |
56 | tail -n +2 src/bin/luarocks-admin >> $@ | 57 | tail -n +2 src/bin/luarocks-admin \ |
58 | )> "$@" | ||
57 | chmod +rx $@ | 59 | chmod +rx $@ |
58 | 60 | ||
59 | $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua: config-$(LUA_VERSION).lua.in | 61 | $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua: config-$(LUA_VERSION).lua.in |