Skip to content

Commit

Permalink
fix(build): Make sure vendored luarocks isn't a phony target that run…
Browse files Browse the repository at this point in the history
…s repeatedly
  • Loading branch information
alerque committed Oct 10, 2023
1 parent 138cebc commit 713434d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile-luarocks
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ if !SYSTEM_LUAROCKS
LUAMODLOCK := sile-dev-1.rockslock

LOCALLUAROCKS := $(LUAROCKS) --tree lua_modules --lua-version $(LUA_VERSION)
TMPFILE != mktemp
genrockslock := $(LOCALLUAROCKS) $(LUAROCKSARGS) list --porcelain | $(AWK) '{print $$1 " " $$2}'
rocksmatch := ( T=$$(mktemp); trap 'rm -f "$$T"' EXIT HUP TERM; $(genrockslock) > "$$T"; $(CMP) -s $(LUAMODLOCK) "$$T" )

installrocks: $(LUAMODLOCK) $(shell $(rocksmatch) || echo lua_modules)
LUAROCKSMANIFEST := lua_modules/lib/luarocks/rocks-$(LUA_VERSION)/manifest

lua_modules: $(LUAMODSPEC) $(shell $(rocksmatch) || echo force)
installrocks: $(LUAMODLOCK) $(shell $(rocksmatch) || echo $(LUAROCKSMANIFEST))

$(LUAROCKSMANIFEST): $(LUAMODSPEC) $(shell $(rocksmatch) || echo force)
$(LOCALLUAROCKS) $(LUAROCKSARGS) install --only-deps $<
touch $@

$(LUAMODLOCK): lua_modules $(LUAMODSPEC)
$(LUAMODLOCK): $(LUAROCKSMANIFEST) $(LUAMODSPEC)
$(genrockslock) > $@
else
LUAMODLOCK :=
Expand Down

0 comments on commit 713434d

Please sign in to comment.