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