summaryrefslogtreecommitdiffhomepage
path: root/modules/base/Makefile
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-06-11 13:29:05 +0000
committerJo-Philipp Wich <jow@openwrt.org>2014-06-11 13:29:05 +0000
commit7043c30e0e55bbbfacdddf97619b6bae96d20ddb (patch)
treeece3254350b3ba01ba3135caed2364cc7ca7804c /modules/base/Makefile
parentbbb44cf245c11bc0c1d59e836007c9e8c3bfa209 (diff)
build: introduce luci-base
Merges libs/core, libs/ipkg, libs/web, libs/sys, libs/sgi-cgi, libs/sgi-uhttpd, modules/admin-core, themes/base and protcols/core into modules/base and renames luci-lib-core to luci-base.
Diffstat (limited to 'modules/base/Makefile')
-rw-r--r--modules/base/Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/base/Makefile b/modules/base/Makefile
new file mode 100644
index 000000000..ad16ec737
--- /dev/null
+++ b/modules/base/Makefile
@@ -0,0 +1,45 @@
+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) $(TPL_LMO_OBJ) $(TPL_PO2LMO_OBJ)
+ $(LINK) $(SHLIB_FLAGS) $(TPL_LDFLAGS) -o src/$(TPL_SO) \
+ $(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)
+
+install: build
+ cp -pR dist$(LUA_LIBRARYDIR)/* $(LUA_LIBRARYDIR)
+
+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 src/$(TPL_PO2LMO)
+ rm -f ../../build/$(TPL_PO2LMO)