2010-12-19 19:47:20 +00:00
|
|
|
include build/config.mk
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
MODULES = contrib/* applications/* libs/* modules/* themes/* i18n/*
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
OS:=$(shell uname)
|
|
|
|
export OS
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
.PHONY: all build gccbuild luabuild clean host gcchost luahost hostcopy hostclean
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
all: build
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
build: gccbuild luabuild
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
gccbuild:
|
|
|
|
make -C libs/lmo CC="cc" CFLAGS="" LDFLAGS="" host-install
|
|
|
|
for i in $(MODULES); do \
|
|
|
|
make -C$$i compile || { \
|
|
|
|
echo "*** Compilation of $$i failed!"; \
|
|
|
|
exit 1; \
|
|
|
|
}; \
|
|
|
|
done
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
luabuild: i18nbuild
|
|
|
|
for i in $(MODULES); do HOST=$(realpath host) make -C$$i luabuild; done
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
i18nbuild:
|
|
|
|
mkdir -p host/lua-po
|
|
|
|
./build/i18n-po2lua.pl ./po host/lua-po
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
clean:
|
|
|
|
rm -rf docs
|
|
|
|
make -C libs/lmo host-clean
|
|
|
|
for i in $(MODULES); do make -C$$i clean; done
|
2010-08-07 14:00:06 +00:00
|
|
|
|
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
host: build hostcopy
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
gcchost: gccbuild hostcopy
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
luahost: luabuild hostcopy
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
hostcopy:
|
|
|
|
mkdir -p host/tmp
|
|
|
|
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
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
hostenv: host ucidefaults
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
ucidefaults:
|
|
|
|
build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "$(realpath host)/bin/uci-defaults --exclude luci-freifunk-*"
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
runhttpd: hostenv
|
|
|
|
build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "lua build/lucid.lua"
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
runlua: hostenv
|
|
|
|
build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "lua -i build/setup.lua"
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
runshell: hostenv
|
|
|
|
build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) $$SHELL
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
hostclean: clean
|
|
|
|
rm -rf host
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
apidocs: hostenv
|
|
|
|
build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "build/makedocs.sh host/luci/ docs"
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
uvldocs: hostenv
|
|
|
|
build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) \
|
|
|
|
"build/uvldoc $(realpath host) $(UVL_SCHEMEDIR) uvldocs $(DOCS)"
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
po: host
|
|
|
|
for L in $${LANGUAGE:-$$(find i18n/ -path 'i18n/*/luasrc/i18n/*' -name 'default.*.lua' | \
|
|
|
|
sed -e 's!.*/default\.\(.*\)\.lua!\1!')}; do \
|
|
|
|
build/i18n-lua2po.pl . $(realpath host)/po $$L; \
|
|
|
|
done
|
2010-08-07 14:00:06 +00:00
|
|
|
|
2010-12-19 19:47:20 +00:00
|
|
|
run:
|
|
|
|
# make run is deprecated #
|
|
|
|
# Please use: #
|
|
|
|
# #
|
|
|
|
# To run LuCI WebUI using LuCIttpd #
|
|
|
|
# make runhttpd #
|
|
|
|
# #
|
|
|
|
# To run LuCI WebUI using Boa/Webuci #
|
|
|
|
# make runboa #
|
|
|
|
# #
|
|
|
|
# To start a shell in the LuCI environment #
|
|
|
|
# make runshell #
|
|
|
|
# #
|
|
|
|
# To run Lua CLI in the LuCI environment #
|
|
|
|
# make runlua #
|