summaryrefslogtreecommitdiffhomepage
path: root/libs/web/Makefile
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-11-25 19:17:55 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-11-25 19:17:55 +0000
commit0e50aa690af6cd9f37fa97b4a521fe523cce3c39 (patch)
treec0ab4edc0dd221dfa3e6fb4eeba049ecc05326fe /libs/web/Makefile
parentc647ff9f0e1af211a762dc9a773c1b5c4aacd168 (diff)
libs/web: rewrite template engine, merge lmo library
- template parser: merge lmo library - template parser: rewrite to operate on memory mapped files - template parser: implement proper line number reporting on syntax errors - template parser: process translate tags directly and bypass Lua - template lmo: introduce load_catalog(), change_catalog() and close_catalog() - template lmo: rewrite index processing to operate directly on the memory mapped file - template lmo: implement binary search keys, reducing the lookup complexity to O(log n) - po2lmo: write sorted indixes when generating *.lmo archives - i18n: use the template parser for translations - i18n: stub load(), loadc() and clear() - i18n: map setlanguage() to load_catalog()
Diffstat (limited to 'libs/web/Makefile')
-rw-r--r--libs/web/Makefile22
1 files changed, 20 insertions, 2 deletions
diff --git a/libs/web/Makefile b/libs/web/Makefile
index d9f9700c1c..1d28a3a4ce 100644
--- a/libs/web/Makefile
+++ b/libs/web/Makefile
@@ -1,19 +1,28 @@
+ifneq (,$(wildcard ../../build/config.mk))
include ../../build/config.mk
include ../../build/module.mk
include ../../build/gccconfig.mk
+else
+include standalone.mk
+endif
TPL_LDFLAGS =
TPL_CFLAGS =
TPL_SO = parser.so
+TPL_PO2LMO = po2lmo
+TPL_PO2LMO_OBJ = src/po2lmo.o
+TPL_LMO_OBJ = src/template_lmo.o
TPL_COMMON_OBJ = src/template_parser.o src/template_utils.o
TPL_LUALIB_OBJ = src/template_lualib.o
%.o: %.c
$(COMPILE) $(TPL_CFLAGS) $(LUA_CFLAGS) $(FPIC) -c -o $@ $<
-compile: build-clean $(TPL_COMMON_OBJ) $(TPL_LUALIB_OBJ)
+compile: build-clean $(TPL_COMMON_OBJ) $(TPL_LUALIB_OBJ) $(TPL_LMO_OBJ) $(TPL_PO2LMO_OBJ)
$(LINK) $(SHLIB_FLAGS) $(TPL_LDFLAGS) -o src/$(TPL_SO) \
- $(TPL_COMMON_OBJ) $(TPL_LUALIB_OBJ)
+ $(TPL_COMMON_OBJ) $(TPL_LMO_OBJ) $(TPL_LUALIB_OBJ)
+ $(LINK) -o src/$(TPL_PO2LMO) \
+ $(TPL_LMO_OBJ) $(TPL_PO2LMO_OBJ)
mkdir -p dist$(LUCI_LIBRARYDIR)/template
cp src/$(TPL_SO) dist$(LUCI_LIBRARYDIR)/template/$(TPL_SO)
@@ -24,3 +33,12 @@ clean: build-clean
build-clean:
rm -f src/*.o src/$(TPL_SO)
+
+host-compile: build-clean host-clean $(TPL_LMO_OBJ) $(TPL_PO2LMO_OBJ)
+ $(LINK) -o src/$(TPL_PO2LMO) $(TPL_LMO_OBJ) $(TPL_PO2LMO_OBJ)
+
+host-install: host-compile
+ cp src/$(TPL_PO2LMO) ../../build/$(TPL_PO2LMO)
+
+host-clean:
+ rm -f ../../build/$(TPL_PO2LMO)