vendor/rlite/src/Makefile in hirlite-0.0.2.2 vs vendor/rlite/src/Makefile in hirlite-0.1.0

- old
+ new

@@ -6,11 +6,12 @@ # Partially based on hiredis's Makefile # https://github.com/redis/hiredis/blob/master/Makefile uname_S:= $(shell sh -c 'uname -s 2>/dev/null || echo not') -OBJ=rlite.o page_skiplist.o page_string.o page_list.o page_btree.o page_key.o page_multi_string.o page_long.o type_string.o type_list.o type_set.o type_zset.o type_hash.o util.o restore.o dump.o sort.o pqsort.o utilfromredis.o hyperloglog.o sha1.o crc64.o lzf_c.o lzf_d.o scripting.o rand.o hirlite.o +OBJ=rlite.o page_skiplist.o page_string.o page_list.o page_btree.o page_key.o page_multi_string.o page_long.o type_string.o type_list.o type_set.o type_zset.o type_hash.o util.o restore.o dump.o sort.o pqsort.o utilfromredis.o hyperloglog.o sha1.o crc64.o lzf_c.o lzf_d.o scripting.o rand.o flock_posix.o signal_posix.o pubsub.o wal.o hirlite.o +LUA_OBJ=../deps/lua/src/lapi.o ../deps/lua/src/lcode.o ../deps/lua/src/ldebug.o ../deps/lua/src/ldo.o ../deps/lua/src/ldump.o ../deps/lua/src/lfunc.o ../deps/lua/src/lgc.o ../deps/lua/src/llex.o ../deps/lua/src/lmem.o ../deps/lua/src/lobject.o ../deps/lua/src/lopcodes.o ../deps/lua/src/lparser.o ../deps/lua/src/lstate.o ../deps/lua/src/lstring.o ../deps/lua/src/ltable.o ../deps/lua/src/ltm.o ../deps/lua/src/lundump.o ../deps/lua/src/lvm.o ../deps/lua/src/lzio.o ../deps/lua/src/strbuf.o ../deps/lua/src/fpconv.o ../deps/lua/src/lauxlib.o ../deps/lua/src/lbaselib.o ../deps/lua/src/ldblib.o ../deps/lua/src/liolib.o ../deps/lua/src/lmathlib.o ../deps/lua/src/loslib.o ../deps/lua/src/ltablib.o ../deps/lua/src/lstrlib.o ../deps/lua/src/loadlib.o ../deps/lua/src/linit.o ../deps/lua/src/lua_cjson.o ../deps/lua/src/lua_struct.o ../deps/lua/src/lua_cmsgpack.o ../deps/lua/src/lua_bit.o LIBNAME=libhirlite PKGCONFNAME=hirlite.pc HIRLITE_MAJOR=$(shell grep HIRLITE_MAJOR hirlite.h | awk '{print $$3}') HIRLITE_MINOR=$(shell grep HIRLITE_MINOR hirlite.h | awk '{print $$3}') @@ -25,22 +26,21 @@ DEBUG?=-g -ggdb endif CFLAGS += -I./ -I../deps/lua/src/ -DEBUG.gcc += -rdynamic CFLAGS.gcc += -std=c99 ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) DEBUG += ${DEBUG.clang} CFLAGS += ${CFLAGS.clang} else DEBUG += ${DEBUG.gcc} CFLAGS += ${CFLAGS.gcc} endif -LIBS=-lm +LIBS=-lm -lpthread INSTALL?= cp -a # Installation related variables and target PREFIX?=/usr/local INCLUDE_PATH?=include/hirlite @@ -68,23 +68,15 @@ STLIBSUFFIX=a STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) all: $(DYLIBNAME) $(STLIBNAME) -gcov: CFLAGS += -fprofile-arcs -ftest-coverage -gcov: clean test - -builddebug: CFLAGS += -DDEBUG=1 -builddebug: clean buildtest - -debug: builddebug vtest - ifeq ($(uname_S),SunOS) # Make isinf() available LUA_CFLAGS= -D__C99FEATURES__=1 endif -LUA_CFLAGS+= -O2 -Wall -DENABLE_CJSON_GLOBAL $(CFLAGS) +LUA_CFLAGS+= -O2 -Wall -DENABLE_CJSON_GLOBAL -fPIC $(CFLAGS) LUA_LDFLAGS+= $(LDFLAGS) LUA_STLIB=../deps/lua/src/liblua.a AR=ar ARFLAGS=rcu @@ -94,37 +86,31 @@ lcov: gcov mkdir -p lcov lcov --directory . --capture --output-file lcov/app.info genhtml lcov/app.info -o lcov/html -full-lcov: CFLAGS += -fprofile-arcs -ftest-coverage -DDEBUG=1 -full-lcov: clean buildtest - clang-analyzer: rm -rf analyzer scan-build -o analyzer $(MAKE) .c.o: $(CC) $(ARCH) $(DEBUG) $(CFLAGS) -c $< $(DYLIBNAME): $(OBJ) lua - $(DYLIB_MAKE_CMD) $(LUA_STLIB) $(OBJ) + $(DYLIB_MAKE_CMD) $(LUA_OBJ) $(OBJ) $(STLIBNAME): $(OBJ) ar -cq libhirlite.a $(OBJ) -buildtest: $(STLIBNAME) test/rlite-test.o test/btree-test.o test/list-test.o test/string-test.o test/multi_string-test.o test/multi-test.o test/key-test.o test/type_string-test.o test/type_list-test.o test/type_set-test.o test/type_zset-test.o test/type_hash-test.o test/skiplist-test.o test/long-test.o test/restore-test.o test/hyperloglog-test.o test/dump-test.o test/sort-test.o test/test_util.o test/test.o test/echo.o test/hash.o test/list.o test/parser.o test/set.o test/string.o test/test_hirlite.o test/zset.o test/db.o test/multi.o test/hsort.o test/scripting-test.o - $(CC) $(DEBUG) $(CFLAGS) -o rlite-test test.o rlite-test.o btree-test.o list-test.o string-test.o multi_string-test.o multi-test.o key-test.o type_string-test.o type_list-test.o type_set-test.o type_zset-test.o type_hash-test.o skiplist-test.o long-test.o restore-test.o hyperloglog-test.o dump-test.o sort-test.o test_util.o $(STLIBNAME) $(LIBS) - $(CC) $(DEBUG) $(CFLAGS) -o hirlite-test echo.o hash.o list.o parser.o set.o string.o test_hirlite.o zset.o db.o multi.o hsort.o scripting-test.o $(STLIBNAME) $(LUA_STLIB) $(LIBS) +buildtest: $(STLIBNAME) + cd ../tests/ && $(MAKE) buildtest -test: buildtest - ./rlite-test - ./hirlite-test +test: $(STLIBNAME) + cd ../tests/ && $(MAKE) test -vtest: buildtest - valgrind --track-origins=yes --leak-check=full --show-reachable=yes ./rlite-test - valgrind --track-origins=yes --leak-check=full --show-reachable=yes ./hirlite-test +vtest: $(STLIBNAME) + cd ../tests/ && $(MAKE) vtest $(PKGCONFNAME): hirlite.h @echo "Generating $@ for pkgconfig..." @echo prefix=$(PREFIX) > $@ @echo exec_prefix=$${prefix} >> $@ @@ -147,5 +133,6 @@ mkdir -p $(INSTALL_PKGCONF_PATH) $(INSTALL) $(PKGCONFNAME) $(INSTALL_PKGCONF_PATH) clean: rm -rf *-test *.o *.a *.dSYM *.gcda *.gcno lcov *.dylib ./deps/lua/src/*.a + cd ../tests && $(MAKE) clean