1b9e25916f913ded884c6f65deb5859f1f96d8f1
[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: runhttpd
56
57 runlua: hostenv
58 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) lua
59
60 runshell: hostenv
61 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) $$SHELL
62
63 hostclean: clean
64 rm -rf host
65
66 apidocs: hostenv
67 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "build/makedocs.sh host/luci/ docs"
68
69 uvldocs: hostenv
70 build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) \
71 "build/uvldoc $(realpath host) $(UVL_SCHEMEDIR) uvldocs $(DOCS)"
72
73 po: host
74 for L in $${LANGUAGE:-$$(find i18n/ -path 'i18n/*/luasrc/i18n/*' -name 'default.*.lua' | \
75 sed -e 's!.*/default\.\(.*\)\.lua!\1!')}; do \
76 build/i18n-lua2po.pl . $(realpath host)/po $$L; \
77 done
78
79 run:
80 # make run is deprecated #
81 # Please use: #
82 # #
83 # To run LuCI WebUI using LuCIttpd #
84 # make runhttpd #
85 # #
86 # To run LuCI WebUI using Boa/Webuci #
87 # make runboa #
88 # #
89 # To start a shell in the LuCI environment #
90 # make runshell #
91 # #
92 # To run Lua CLI in the LuCI environment #
93 # make runlua #