From 40a0135c66e3271eb3842c1b66edef68d00de370 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 9 Oct 2014 10:18:17 +0200 Subject: adaptiosn to use local tolua --- GNUmakefile | 10 +++++++++- makefiles/gmake/platform.mk | 11 +++++++++++ src/modules/urlnormalizer/googleurl/GNUmakefile | 15 +++++++++++---- tests/tolua/libtest1/GNUmakefile | 12 +++++++----- tolua/src/bin/Makefile | 5 +---- tolua/src/tests/Makefile | 5 ----- 6 files changed, 39 insertions(+), 19 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index dcbfbfa..a74de4d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,14 @@ TOPDIR = . -SUBDIRS = libfetch googleurl streamhtmlparser sqlite3 lua src tests +SUBDIRS = libfetch googleurl streamhtmlparser src tests + +ifeq ($(WITH_LOCAL_SQLITE),1) +SUBDIRS += sqlite3 +endif + +ifeq ($(WITH_LUA),1) +SUBDIRS += lua tolua +endif PACKAGE_NAME = crawler PACKAGE_VERSION = 0.0.1 diff --git a/makefiles/gmake/platform.mk b/makefiles/gmake/platform.mk index 8cafc3d..7c53844 100644 --- a/makefiles/gmake/platform.mk +++ b/makefiles/gmake/platform.mk @@ -358,3 +358,14 @@ endif endif endif + +# tolua +####### + +ifeq ($(WITH_LUA),1) +TOLUA_DIR = $(TOPDIR)/tolua +TOLUA = $(TOLUA_DIR)/bin/tolua +TOLUA_INCLUDES = -I$(TOLUA_DIR)/include +TOLUA_LDFLAGS = +TOLUA_LIBS = $(TOLUA_DIR)/lib/libtolua.a +endif diff --git a/src/modules/urlnormalizer/googleurl/GNUmakefile b/src/modules/urlnormalizer/googleurl/GNUmakefile index da181aa..499e02b 100644 --- a/src/modules/urlnormalizer/googleurl/GNUmakefile +++ b/src/modules/urlnormalizer/googleurl/GNUmakefile @@ -9,11 +9,12 @@ INCLUDE_DIRS = \ -I$(TOPDIR)/include/module \ -I$(TOPDIR)/include/util \ -I$(TOPDIR)/include/crawler \ - -I$(TOPDIR)/googleurl + -I$(TOPDIR)/googleurl \ ifeq ($(WITH_LUA),1) INCLUDE_DIRS += \ - -I$(TOPDIR)/include/luaglue + -I$(TOPDIR)/include/luaglue \ + $(TOLUA_INCLUDES) endif INCLUDE_CXXFLAGS = \ @@ -27,6 +28,11 @@ INCLUDE_LDFLAGS = \ -L$(TOPDIR)/googleurl \ -L$(TOPDIR)/src/libcrawler +ifeq ($(WITH_LUA),1) +INCLUDE_LDFLAGS += \ + $(TOLUA_LDFLAGS) +endif + INCLUDE_LIBS = \ -lgoogleurl \ -lcrawler \ @@ -34,7 +40,8 @@ INCLUDE_LIBS = \ ifeq ($(WITH_LUA),1) INCLUDE_LIBS += \ - -ltolua -llua + -llua \ + $(TOLUA_LIBS) endif DYNAMIC_MODULE = \ @@ -54,7 +61,7 @@ endif -include $(TOPDIR)/makefiles/gmake/sub.mk GoogleURLNormalizerLua.cpp: GoogleURLNormalizer.pkg - tolua -H GoogleURLNormalizerLua.hpp -o GoogleURLNormalizerLua.cpp GoogleURLNormalizer.pkg + $(TOLUA) -H GoogleURLNormalizerLua.hpp -o GoogleURLNormalizerLua.cpp GoogleURLNormalizer.pkg local_all: diff --git a/tests/tolua/libtest1/GNUmakefile b/tests/tolua/libtest1/GNUmakefile index a00cbca..2a83f6e 100755 --- a/tests/tolua/libtest1/GNUmakefile +++ b/tests/tolua/libtest1/GNUmakefile @@ -8,17 +8,19 @@ INCLUDE_DIRS = \ -I. -I$(TOPDIR)/src -I.. \ -I$(TOPDIR)/include/module \ -I$(TOPDIR)/include/util \ - -I$(TOPDIR)/include/luaglue + -I$(TOPDIR)/include/luaglue \ + $(TOLUA_INCLUDES) INCLUDE_CXXFLAGS = \ INCLUDE_LDFLAGS = \ - -L$(TOPDIR)/src/libcrawler + -L$(TOPDIR)/src/libcrawler \ + $(TOLUA_LDFLAGS) INCLUDE_LIBS = \ -lcrawler \ - -ltolua \ - -llua + -llua \ + $(TOLUA_LIBS) DYNAMIC_MODULE = \ mod_test.so @@ -33,7 +35,7 @@ CPP_OBJS = \ -include $(TOPDIR)/makefiles/gmake/sub.mk TestModLua.cpp: TestMod.pkg - tolua -H TestModLua.hpp -o TestModLua.cpp TestMod.pkg + $(TOLUA) -H TestModLua.hpp -o TestModLua.cpp TestMod.pkg local_all: diff --git a/tolua/src/bin/Makefile b/tolua/src/bin/Makefile index 4731778..93daf77 100644 --- a/tolua/src/bin/Makefile +++ b/tolua/src/bin/Makefile @@ -29,8 +29,5 @@ tolua_lua.o: tolua.c $(CC) -c -DLUA_SOURCE $(INC) -o $@ $< clean: - rm -f tolua_lua.o $(OBJS) -$(OBJS_D) $(T) $(T_D) - -klean: - rm -f tolua_lua.o $(OBJS) -$(OBJS_D) $(T_D) + rm -f tolua_lua.o $(OBJS) $(OBJS_D) $(T) $(T_D) diff --git a/tolua/src/tests/Makefile b/tolua/src/tests/Makefile index 9fb6bb1..215e586 100644 --- a/tolua/src/tests/Makefile +++ b/tolua/src/tests/Makefile @@ -76,9 +76,4 @@ tvarargbind.cpp: tvararg.pkg clean: rm -f t*bind.* rm -f *.o - -klean: rm -f $(EXE) - - - -- cgit v1.2.3-54-g00ecf