2 Commits fd1746dd1c ... 11f463ecc5

Author SHA1 Message Date
  Stefano Cossu 11f463ecc5 Update submodules. 3 years ago
  Stefano Cossu 375f139f27 Include all dependent ext libraries in static lib. 3 years ago
6 changed files with 22 additions and 21 deletions
  1. 17 16
      Makefile
  2. 1 1
      ext/openldap
  3. 1 1
      ext/re2c
  4. 1 1
      ext/tpl
  5. 1 1
      ext/uthash
  6. 1 1
      include/graph.h

+ 17 - 16
Makefile

@@ -14,17 +14,19 @@ PREFIX = /usr/local
 bindir = $(PREFIX)/bin
 libdir = $(PREFIX)/lib
 includedir = $(PREFIX)/include/lsup_rdf
+MDB_DIR = ext/openldap/libraries/liblmdb
+XXHASH_DIR = ext/xxHash
 CALLGRIND_DUMP = /tmp/lsup_callgrind.%p.out
 
-INCLUDE_BASE = . -Iinclude -Iext/xxHash -Iext/openldap/libraries/liblmdb \
+INCLUDE_BASE = . -Iinclude -I$(MDB_DIR) -I$(XXHASH_DIR) \
 	-Iext/tpl/src -Iext/uthash/src -Iext/log/src
 INCLUDE = -I$(INCLUDE_BASE)
 CFLAGS += -Wall -fPIC -MMD -DLOG_USE_COLOR $(INCLUDE)
 TEST_CFLAGS = -Itest -O0 -g3 -DDEBUG
 # NOTE: -luuid is a Linux system library. Other OS's might need a different
 # link or a non-system library built.
-LDFLAGS = -Lext/openldap/libraries/liblmdb -Lext/xxHash \
-		  -llmdb -lxxhash -luuid
+LDFLAGS = -L$(MDB_DIR) -L$(XXHASH_DIR) \
+		  -llmdb -lxxhash
 
 CODEC_DIR = src/codec
 #CODEC_SRC = $(wildcard src/codec/*_parser.c)
@@ -42,11 +44,10 @@ EXT_H = $(wildcard ext/log/src/*.h) \
 	  	$(wildcard ext/uthash/src/*.h)
 
 SRC = $(EXT_SRC) $(wildcard src/*.c)
-#CODEC_OBJ = $(wildcard src/codec/*.o)
-OBJ = $(SRC:.c=.o) $(CODEC_OBJ)
-
 TEST_SRC = $(wildcard test/*.c) test.c
-#TEST_OBJ = $(TEST_SRC:.c=.o)
+
+EXT_OBJ = $(MDB_DIR)/{mdb,midl}.o $(XXHASH_DIR)/xxhash.o
+OBJ = $(SRC:.c=.o) $(CODEC_OBJ)
 
 DEPLIBS = libxxhash liblmdb
 LIBS = liblsuprdf.a liblsuprdf.so
@@ -61,7 +62,7 @@ DOCS = docs
 all: $(DEPLIBS) $(LIBS)
 
 liblsuprdf.a: $(OBJ)
-	$(AR) rs $@ $^
+	$(AR) rs $@ $(EXT_OBJ) $^
 
 liblsuprdf.so: $(OBJ)
 	$(CC) -shared $(LDFLAGS) -o $@ $^
@@ -74,20 +75,15 @@ $(CODEC_OBJ): $(CODEC_SRC)
 %_grammar.c: %_grammar.y
 	$(PARSER) $< -q -m -T$(CODEC_DIR)/lempar.c -d$(CODEC_DIR)
 
-
-# Build all external dependencies in core object.
-core.o: core.c $(EXT_SRC) $(EXT_H)
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
-
-# Ext libraries compiled as shared objects.
+# Ext libraries.
 
 .PHONY: libxxhash
 libxxhash:
-	$(MAKE) -C ext/xxHash
+	$(MAKE) -C $(XXHASH_DIR)
 		
 .PHONY: liblmdb
 liblmdb:
-	$(MAKE) -C ext/openldap/libraries/liblmdb
+	$(MAKE) -C $(MDB_DIR)
 
 install: all
 	mkdir -p $(DESTDIR)$(libdir)
@@ -99,6 +95,11 @@ install: all
 clean:
 	rm -rf src/*.[aod] ./*[aod] src/codec/*[aod]
 
+.PHONY: deepclean
+deepclean: clean
+	cd $(MDB_DIR); make clean
+	cd $(XXHASH_DIR); make clean
+
 .PHONY: uninstall
 uninstall:
 	rm -f $(DESTDIR)$(libdir)/liblsuprdf.*

+ 1 - 1
ext/openldap

@@ -1 +1 @@
-Subproject commit 37ebb6b46b5240c1f2a37d037c54334ada31d357
+Subproject commit f9d01f4722ac7ad91dbb796dc9a512562ab6acd0

+ 1 - 1
ext/re2c

@@ -1 +1 @@
-Subproject commit 342e53a71e87dec549a029a815f443fb9cbf66b3
+Subproject commit 62fe269e84c99f11d8faf841eb451d4becb99323

+ 1 - 1
ext/tpl

@@ -1 +1 @@
-Subproject commit 6569fcc176d6ec0a91776d5d0ba712f753b84466
+Subproject commit f8138ad393f4b1985c916029ab6d703e4e7a1c4c

+ 1 - 1
ext/uthash

@@ -1 +1 @@
-Subproject commit 66e2668795d0aaf4977523f828e548470a680c33
+Subproject commit 86e677629ab5feb477f3f0c85d94a7beeefef3b5

+ 1 - 1
include/graph.h

@@ -247,7 +247,7 @@ LSUP_graph_add_init (LSUP_Graph *gr);
  *
  * @param[in] it Iterator obtained with #LSUP_graph_add_init().
  *
- * @param[in] sspo Serialized triple to add.
+ * @param[in] spo Triple to add. Caller retains ownership.
  */
 LSUP_rc
 LSUP_graph_add_iter (LSUP_GraphIterator *it, const LSUP_Triple *spo);