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