diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-20 20:31:32 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-20 23:28:37 -0300 |
commit | cbd4563612993628ecae9516374c13fab2d2ea29 (patch) | |
tree | b6ed724bcedc63e7db411d1368c41e837cf855dd | |
parent | c4938c0e7be45fb03f4f60a92ac7d4548ec89fbd (diff) | |
download | luarocks-cbd4563612993628ecae9516374c13fab2d2ea29.tar.gz luarocks-cbd4563612993628ecae9516374c13fab2d2ea29.tar.bz2 luarocks-cbd4563612993628ecae9516374c13fab2d2ea29.zip |
Makefile: make install target phony
Fixes #1038.
-rw-r--r-- | GNUmakefile | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/GNUmakefile b/GNUmakefile index 22a1d817..afb79cdf 100644 --- a/GNUmakefile +++ b/GNUmakefile | |||
@@ -104,52 +104,50 @@ $(buildbinarydir)/luarocks-admin.exe: src/bin/luarocks-admin $(LUAROCKS_FILES) | |||
104 | # Regular install | 104 | # Regular install |
105 | # ---------------------------------------- | 105 | # ---------------------------------------- |
106 | 106 | ||
107 | INSTALL_FILES = $(DESTDIR)$(bindir)/luarocks \ | 107 | INSTALL_FILES = |
108 | $(DESTDIR)$(bindir)/luarocks-admin \ | 108 | |
109 | $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua \ | 109 | install: all install-config |
110 | $(patsubst src/%, $(DESTDIR)$(luadir)/%, $(LUAROCKS_FILES)) | 110 | mkdir -p '$(DESTDIR)$(bindir)/' |
111 | 111 | $(INSTALL) '$(builddir)/luarocks' '$(DESTDIR)$(bindir)/luarocks' | |
112 | install: $(INSTALL_FILES) | 112 | $(INSTALL) '$(builddir)/luarocks-admin' '$(DESTDIR)$(bindir)/luarocks-admin' |
113 | 113 | find src/luarocks/ -type d | while read f; \ | |
114 | install-config: $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua | 114 | do \ |
115 | 115 | mkdir -p '$(DESTDIR)$(luadir)'/`echo $$f | sed 's,^src/,,'`; \ | |
116 | $(DESTDIR)$(bindir)/luarocks: $(builddir)/luarocks | 116 | done |
117 | mkdir -p "$(@D)" | 117 | find src/luarocks/ -type f -name '*.lua' | while read f; \ |
118 | $(INSTALL) "$<" "$@" | 118 | do \ |
119 | 119 | $(INSTALL_DATA) "$$f" '$(DESTDIR)$(luadir)'/`echo $$f | sed 's,^src/,,'`; \ | |
120 | $(DESTDIR)$(bindir)/luarocks-admin: $(builddir)/luarocks-admin | 120 | done |
121 | mkdir -p "$(@D)" | 121 | |
122 | $(INSTALL) "$<" "$@" | 122 | install-config: |
123 | 123 | mkdir -p '$(DESTDIR)$(luarocksconfdir)/' | |
124 | $(DESTDIR)$(luadir)/luarocks/%.lua: src/luarocks/%.lua | 124 | $(INSTALL_DATA) '$(builddir)/config-$(LUA_VERSION).lua' '$(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua' |
125 | mkdir -p "$(@D)" | ||
126 | $(INSTALL_DATA) "$<" "$@" | ||
127 | |||
128 | $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua: $(builddir)/config-$(LUA_VERSION).lua | ||
129 | mkdir -p "$(@D)" | ||
130 | $(INSTALL_DATA) "$<" "$@" | ||
131 | 125 | ||
132 | uninstall: | 126 | uninstall: |
133 | rm -rf $(INSTALL_FILES) | 127 | rm -rf $(DESTDIR)$(bindir)/luarocks \ |
128 | $(DESTDIR)$(bindir)/luarocks-admin \ | ||
129 | $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua \ | ||
130 | $(patsubst src/%, $(DESTDIR)$(luadir)/%, $(LUAROCKS_FILES)) | ||
134 | 131 | ||
135 | # ---------------------------------------- | 132 | # ---------------------------------------- |
136 | # Binary install | 133 | # Binary install |
137 | # ---------------------------------------- | 134 | # ---------------------------------------- |
138 | 135 | ||
139 | LUAROCKS_CORE_FILES = $(wildcard src/luarocks/core/* src/luarocks/loader.lua) | 136 | install-binary: binary install-config |
140 | INSTALL_BINARY_FILES = $(patsubst src/%, $(DESTDIR)$(luadir)/%, $(LUAROCKS_CORE_FILES)) \ | ||
141 | $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua | ||
142 | |||
143 | install-binary: $(INSTALL_BINARY_FILES) | ||
144 | mkdir -p "$(buildbinarydir)" | 137 | mkdir -p "$(buildbinarydir)" |
145 | $(INSTALL) "$(buildbinarydir)/luarocks.exe" "$(DESTDIR)$(bindir)/luarocks" | 138 | $(INSTALL) "$(buildbinarydir)/luarocks.exe" "$(DESTDIR)$(bindir)/luarocks" |
146 | $(INSTALL) "$(buildbinarydir)/luarocks-admin.exe" "$(DESTDIR)$(bindir)/luarocks-admin" | 139 | $(INSTALL) "$(buildbinarydir)/luarocks-admin.exe" "$(DESTDIR)$(bindir)/luarocks-admin" |
140 | mkdir -p '$(DESTDIR)$(luadir)/luarocks/core' | ||
141 | for f in src/luarocks/core/*.lua src/luarocks/loader.lua; \ | ||
142 | do \ | ||
143 | $(INSTALL_DATA) "$$f" '$(DESTDIR)$(luadir)'/`echo $$f | sed 's,^src/,,'`; \ | ||
144 | done | ||
147 | 145 | ||
148 | # ---------------------------------------- | 146 | # ---------------------------------------- |
149 | # Bootstrap install | 147 | # Bootstrap install |
150 | # ---------------------------------------- | 148 | # ---------------------------------------- |
151 | 149 | ||
152 | bootstrap: luarocks $(DESTDIR)$(luarocksconfdir)/config-$(LUA_VERSION).lua | 150 | bootstrap: luarocks install-config |
153 | ./luarocks make --tree="$(DESTDIR)$(rocks_tree)" | 151 | ./luarocks make --tree="$(DESTDIR)$(rocks_tree)" |
154 | 152 | ||
155 | # ---------------------------------------- | 153 | # ---------------------------------------- |
@@ -185,4 +183,4 @@ clean: windows-clean | |||
185 | ./.luarocks \ | 183 | ./.luarocks \ |
186 | ./lua_modules | 184 | ./lua_modules |
187 | 185 | ||
188 | .PHONY: all build install binary install-binary bootstrap clean windows-binary windows-clean | 186 | .PHONY: all build install install-config binary install-binary bootstrap clean windows-binary windows-clean |