+
+host: build hostcopy
+
+gcchost: gccbuild hostcopy
+
+luahost: luabuild hostcopy
+
+hostcopy:
+ mkdir -p host/tmp
+ mkdir -p host/var/state
+ for i in $(MODULES); do cp -pR $$i/dist/* host/ 2>/dev/null || true; done
+ for i in $(MODULES); do cp -pR $$i/hostfiles/* host/ 2>/dev/null || true; done
+ rm -f host/luci
+ ln -s .$(LUCI_MODULEDIR) host/luci
+ rm -rf /tmp/luci-* || true
+
+hostenv: sdk host ucidefaults
+
+sdk:
+ touch .running-sdk
+
+ucidefaults:
+ build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "$(realpath host)/bin/uci-defaults --exclude luci-freifunk-*"
+
+runhttpd: hostenv
+ build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "lua build/lucid.lua"
+
+runuhttpd: hostenv
+ cp $(realpath build)/luci.cgi $(realpath host)/www/cgi-bin/luci
+ build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "$(realpath host)/usr/sbin/uhttpd -p 8080 -h $(realpath host)/www -f"
+
+runlua: hostenv
+ build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "lua -i build/setup.lua"
+
+runshell: hostenv
+ build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) $$SHELL
+