* Added Makefile entry for ffluci.model.ipkg
[project/luci.git] / Makefile
1 LUAC = luac
2 LUAC_OPTIONS = -s
3
4 FILES =
5
6 CFILES = ffluci/util.lua ffluci/http.lua ffluci/fs.lua \
7 ffluci/sys.lua ffluci/model/uci.lua ffluci/model/ipkg.lua \
8 ffluci/config.lua ffluci/i18n.lua ffluci/template.lua \
9 ffluci/cbi.lua ffluci/dispatcher.lua ffluci/menu.lua ffluci/init.lua
10
11 DIRECTORIES = dist/ffluci/model/cbi dist/ffluci/controller dist/ffluci/i18n dist/ffluci/view
12
13 INFILES = $(CFILES:%=src/%)
14 OUTFILE = ffluci/init.lua
15
16 .PHONY: all dist-compile dist-source examples-compile examples-source dist examples compile source clean
17
18 all: compile
19
20 dist-compile: compile dist
21 dist-source: source dist
22
23 dist:
24 cp src/ffluci/controller/* dist/ffluci/controller/ -R
25 cp src/ffluci/i18n/* dist/ffluci/i18n/
26 cp src/ffluci/view/* dist/ffluci/view/ -R
27 cp src/ffluci/model/cbi/* dist/ffluci/model/cbi/ -R
28
29 compile:
30 mkdir -p $(DIRECTORIES)
31 $(LUAC) $(LUAC_OPTIONS) -o dist/$(OUTFILE) $(INFILES)
32 for i in $(CFILES); do [ -f dist/$$i ] || ln -s `dirname $$i | cut -s -d / -f 2- | sed -e 's/[^/]*\/*/..\//g'``basename $(OUTFILE)` dist/$$i; done
33 for i in $(FILES); do cp src/$$i dist/$$i; done
34
35 source:
36 mkdir -p $(DIRECTORIES)
37 for i in $(CFILES); do cp src/$$i dist/$$i; done
38 for i in $(FILES); do cp src/$$i dist/$$i; done
39
40 clean:
41 rm dist -rf