From 8dd1e1460282f5fc992d838ec2411f4d1bc7b2b7 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 2 Jul 2018 19:27:48 -0300 Subject: Experimental Windows cross-compiled binary build This commit consolidates the work that has been ongoing over the last few weeks in producing the single-binary builds of LuaRocks based on the new distribution model described in https://github.com/luarocks/luarocks/wiki/Project:-LuaRocks-new-distribution-model The single-binary build is in a good shape for Linux, it's a work-in-progress for Windows (binaries do build, but some work on the dependencies is still necessary), and is untested in macOS. --- Makefile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4e528db8..8f772dae 100644 --- a/Makefile +++ b/Makefile @@ -64,13 +64,15 @@ $(SYSCONFDIR)/config-$(LUA_VERSION).lua: config-$(LUA_VERSION).lua.in # Binary build # ---------------------------------------- -binary: build-binary/luarocks.exe build-binary/luarocks-admin.exe +BINARY_TARGET=build-binary -build-binary/luarocks.exe: ./luarocks - LUA_PATH="$(PWD)/src/?.lua;;" "$(LUA_BINDIR)/$(LUA_INTERPRETER)" ./all_in_one "src/bin/luarocks" "$(LUA_DIR)" "^src/luarocks/admin/" "$(SYSCONFDIR)" "build-binary" +binary: $(BINARY_TARGET)/luarocks.exe $(BINARY_TARGET)/luarocks-admin.exe -build-binary/luarocks-admin.exe: ./luarocks - LUA_PATH="$(PWD)/src/?.lua;;" "$(LUA_BINDIR)/$(LUA_INTERPRETER)" ./all_in_one "src/bin/luarocks-admin" "$(LUA_DIR)" "^src/luarocks/cmd/" "$(SYSCONFDIR)" "build-binary" +$(BINARY_TARGET)/luarocks.exe: ./luarocks + LUA_PATH="$(PWD)/src/?.lua;;" "$(LUA_BINDIR)/$(LUA_INTERPRETER)" binary/all_in_one "src/bin/luarocks" "$(LUA_DIR)" "^src/luarocks/admin/" "$(SYSCONFDIR)" $(BINARY_TARGET) $(BINARY_PLATFORM) $(BINARY_CC) $(BINARY_NM) $(BINARY_SYSROOT) + +$(BINARY_TARGET)/luarocks-admin.exe: ./luarocks + LUA_PATH="$(PWD)/src/?.lua;;" "$(LUA_BINDIR)/$(LUA_INTERPRETER)" binary/all_in_one "src/bin/luarocks-admin" "$(LUA_DIR)" "^src/luarocks/cmd/" "$(SYSCONFDIR)" $(BINARY_TARGET) $(BINARY_PLATFORM) $(BINARY_CC) $(BINARY_NM) $(BINARY_SYSROOT) # ---------------------------------------- # Binary install @@ -93,6 +95,16 @@ install-binary: build-binary/luarocks.exe build-binary/luarocks-admin.exe bootstrap: ./luarocks $(SYSCONFDIR)/config-$(LUA_VERSION).lua ./luarocks make --tree="$(ROCKS_TREE)" +# ---------------------------------------- +# Windows binary build +# ---------------------------------------- + +windows-binary: ./luarocks + make -f binary/Makefile.windows windows-binary + +windows-clean: + make -f binary/Makefile.windows windows-clean + # ---------------------------------------- # Clean # ---------------------------------------- @@ -105,4 +117,4 @@ clean: rm -rf ./.luarocks rm -rf ./lua_modules -.PHONY: all build install binary install-binary bootstrap clean +.PHONY: all build install binary install-binary bootstrap clean windows-binary windows-clean -- cgit v1.2.3-55-g6feb