d082a9807706543b1f4a5ecf79594b48ea4dcef9
[project/luci.git] / Makefile
1 include build/config.mk
2
3 MODULES = contrib/* applications/* libs/* modules/* themes/* i18n/*
4
5 OS:=$(shell uname)
6 export OS
7
8 .PHONY: all build gccbuild luabuild clean host gcchost luahost hostcopy hostclean
9
10 all: build
11
12 build: gccbuild luabuild
13
14 gccbuild:
15 for i in $(MODULES); do \
16 make -C$$i compile || { \
17 echo "*** Compilation of $$i failed!"; \
18 exit 1; \
19 }; \
20 done
21
22 luabuild: i18nbuild
23 for i in $(MODULES); do HOST=$(realpath host) make -C$$i luabuild; done
24
25 i18nbuild:
26 mkdir -p host/lua-po
27 ./build/i18n-po2lua.pl ./po host/lua-po
28
29 clean:
30 rm -rf docs
31 for i in $(MODULES); do make -C$$i clean; done
32
33
34 host: build hostcopy
35
36 gcchost: gccbuild hostcopy
37
38 luahost: luabuild hostcopy
39
40 hostcopy:
41 mkdir -p host/tmp
42 for i in $(MODULES); do cp -pR $$i/dist/* host/ 2>/dev/null || true; done
43 for i in $(MODULES); do cp -pR $$i/hostfiles/* host/ 2>/dev/null || true; done
44 rm -f host/luci
45 ln -s .$(LUCI_MODULEDIR) host/luci
46 rm -rf /tmp/luci-* || true
47
48 hostenv: host ucidefaults
49
50 ucidefaults:
51 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "$(realpath host)/bin/uci-defaults --exclude luci-freifunk-*"
52
53 runboa: hostenv
54 libs/sgi-webuci/host/buildconfig.sh $(realpath host) > host/etc/boa/boa.conf
55 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "$(realpath host/usr/bin/boa) -c $(realpath host/etc/boa) -d"
56
57 runhttpd: hostenv
58 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "$(realpath host/usr/bin/lucittpd) $(realpath host)/usr/lib/lucittpd/plugins"
59
60 runluci: luahost
61 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "$(realpath libs/httpd/host/runluci) $(realpath host) $(HTDOCS)"
62
63 runlua: hostenv
64 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "lua -i build/setup.lua"
65
66 runshell: hostenv
67 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) $$SHELL
68
69 hostclean: clean
70 rm -rf host
71
72 apidocs: hostenv
73 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "build/makedocs.sh host/luci/ docs"
74
75 uvldocs: hostenv
76 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) \
77 "build/uvldoc $(realpath host) $(UVL_SCHEMEDIR) uvldocs $(DOCS)"
78
79 po: host
80 for L in $${LANGUAGE:-$$(find i18n/ -path 'i18n/*/luasrc/i18n/*' -name 'default.*.lua' | \
81 sed -e 's!.*/default\.\(.*\)\.lua!\1!')}; do \
82 build/i18n-lua2po.pl . $(realpath host)/po $$L; \
83 done
84
85 run:
86 # make run is deprecated #
87 # Please use: #
88 # #
89 # To run LuCI WebUI using LuCIttpd #
90 # make runhttpd #
91 # #
92 # To run LuCI WebUI using Boa/Webuci #
93 # make runboa #
94 # #
95 # To start a shell in the LuCI environment #
96 # make runshell #
97 # #
98 # To run Lua CLI in the LuCI environment #
99 # make runlua #