* Remove ffluci.util.__file__ as it relies on debug information
[project/luci.git] / Makefile
1 LUAC = luac
2 LUAC_OPTIONS = -s
3
4 FILES = ffluci/debug.lua
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/model/menu 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 cp src/ffluci/model/menu/* dist/ffluci/model/menu/ -R
29
30 compile:
31 mkdir -p $(DIRECTORIES)
32 $(LUAC) $(LUAC_OPTIONS) -o dist/$(OUTFILE) $(INFILES)
33 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
34 for i in $(FILES); do cp src/$$i dist/$$i; done
35
36 source:
37 mkdir -p $(DIRECTORIES)
38 for i in $(CFILES); do cp src/$$i dist/$$i; done
39 for i in $(FILES); do cp src/$$i dist/$$i; done
40
41 clean:
42 rm dist -rf