contrib/package: remove dependency on remote-update in community package, this preven...
[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         make -C libs/lmo CC="cc" CFLAGS="" LDFLAGS="" host-install
16         for i in $(MODULES); do \
17                 make -C$$i compile || { \
18                         echo "*** Compilation of $$i failed!"; \
19                         exit 1; \
20                 }; \
21         done
22
23 luabuild: i18nbuild
24         for i in $(MODULES); do HOST=$(realpath host) make -C$$i luabuild; done
25
26 i18nbuild:
27         mkdir -p host/lua-po
28         ./build/i18n-po2lua.pl ./po host/lua-po
29
30 clean:
31         rm -rf docs
32         make -C libs/lmo host-clean
33         for i in $(MODULES); do make -C$$i clean; done
34
35
36 host: build hostcopy
37
38 gcchost: gccbuild hostcopy
39
40 luahost: luabuild hostcopy
41
42 hostcopy: 
43         mkdir -p host/tmp
44         for i in $(MODULES); do cp -pR $$i/dist/* host/ 2>/dev/null || true; done
45         for i in $(MODULES); do cp -pR $$i/hostfiles/* host/ 2>/dev/null || true; done
46         rm -f host/luci
47         ln -s .$(LUCI_MODULEDIR) host/luci
48         rm -rf /tmp/luci-* || true
49
50 hostenv: host ucidefaults
51
52 ucidefaults:
53         build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "$(realpath host)/bin/uci-defaults --exclude luci-freifunk-*"
54
55 runhttpd: hostenv
56         build/hostenv.sh $(realpath host) $(LUA_MODULEDIR) $(LUA_LIBRARYDIR) "lua build/lucid.lua"
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                                     #