X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=Makefile;h=435d59c599b8f908a4cc179e83ac9598d5e8629d;hp=a43766e6698c03916e5aee9e157416ffd64cff7d;hb=d8e5e32ad8af6f49a10dc0fe18c9c2327f924dcd;hpb=1c6c6d62ca665f9d1126b6bad849f7fd584b6a80 diff --git a/Makefile b/Makefile index a43766e669..435d59c599 100644 --- a/Makefile +++ b/Makefile @@ -1,41 +1,42 @@ -LUAC = luac -LUAC_OPTIONS = -s +include build/config.mk -FILES = +MODULES = applications/* libs/* modules/* themes/* i18n/* contrib/luaposix +LUA_TARGET = source -CFILES = ffluci/util.lua ffluci/http.lua ffluci/fs.lua \ -ffluci/sys.lua ffluci/model/uci.lua ffluci/config.lua \ -ffluci/i18n.lua ffluci/template.lua ffluci/cbi.lua \ -ffluci/dispatcher.lua ffluci/menu.lua ffluci/init.lua +OS:=$(shell uname) +export OS -DIRECTORIES = dist/ffluci/model/cbi dist/ffluci/controller dist/ffluci/i18n dist/ffluci/view +.PHONY: all build gccbuild luabuild clean host gcchost luahost hostcopy hostclean -INFILES = $(CFILES:%=src/%) -OUTFILE = ffluci/init.lua +all: build -.PHONY: all dist-compile dist-source examples-compile examples-source dist examples compile source clean +build: luabuild gccbuild -all: compile +gccbuild: + for i in $(MODULES); do make -C$$i compile; done -dist-compile: compile dist -dist-source: source dist +luabuild: + for i in $(MODULES); do make -C$$i lua$(LUA_TARGET); done -dist: - cp src/ffluci/controller/* dist/ffluci/controller/ -R - cp src/ffluci/i18n/* dist/ffluci/i18n/ - cp src/ffluci/view/* dist/ffluci/view/ -R - cp src/ffluci/model/cbi/* dist/ffluci/model/cbi/ -R +clean: + for i in $(MODULES); do make -C$$i clean; done -compile: - mkdir -p $(DIRECTORIES) - $(LUAC) $(LUAC_OPTIONS) -o dist/$(OUTFILE) $(INFILES) - 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 - for i in $(FILES); do cp src/$$i dist/$$i; done -source: - mkdir -p $(DIRECTORIES) - for i in $(CFILES); do cp src/$$i dist/$$i; done - for i in $(FILES); do cp src/$$i dist/$$i; done - -clean: - rm dist -rf +host: build hostcopy + +gcchost: gccbuild hostcopy + +luahost: luabuild hostcopy + +hostcopy: + mkdir -p host + for i in $(MODULES); do cp -a $$i/dist/* host/ -R 2>/dev/null || true; done + rm -f host/luci + ln -s .$(LUCI_INSTALLDIR) host/luci + +run: host + libs/sgi-webuci/host/buildconfig.sh `pwd`/host > host/etc/boa/boa.conf + ./host/usr/bin/boa -c ./host/etc/boa -d + +hostclean: clean + rm -rf host