commit 88d7eb8a864453521c8e57c2ebc01c36bd688319
parent 76862776b8e19f04d39a74fe234961874f9c863f
Author: William Casarin <jb55@jb55.com>
Date: Sat, 23 Dec 2023 15:16:51 -0800
nostrdb/fix build
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/nostrdb/Makefile b/nostrdb/Makefile
@@ -1,5 +1,5 @@
-CFLAGS = -Wall -Wno-misleading-indentation -Wno-unused-function -Werror -O2 -g -Ideps/secp256k1/include -Ideps/lmdb -Ideps/flatcc/include
-HEADERS = src/sha256.h src/nostrdb.h src/cursor.h src/hex.h src/jsmn.h src/config.h src/sha256.h src/random.h src/memchr.h src/cpu.h $(C_BINDINGS)
+CFLAGS = -Wall -Wno-misleading-indentation -Wno-unused-function -Werror -O2 -g -Isrc -Ideps/secp256k1/include -Ideps/lmdb -Ideps/flatcc/include
+HEADERS = deps/lmdb/lmdb.h deps/secp256k1/include/secp256k1.h src/sha256.h src/nostrdb.h src/cursor.h src/hex.h src/jsmn.h src/config.h src/sha256.h src/random.h src/memchr.h src/cpu.h $(C_BINDINGS)
FLATCC_SRCS=deps/flatcc/src/runtime/json_parser.c deps/flatcc/src/runtime/verifier.c deps/flatcc/src/runtime/builder.c deps/flatcc/src/runtime/emitter.c deps/flatcc/src/runtime/refmap.c
BOLT11_SRCS = src/bolt11/bolt11.c src/bolt11/bech32.c src/bolt11/tal.c src/bolt11/talstr.c src/bolt11/take.c src/bolt11/list.c src/bolt11/utf8.c src/bolt11/amount.c src/bolt11/hash_u5.c
SRCS = src/nostrdb.c src/sha256.c $(BOLT11_SRCS) $(FLATCC_SRCS)
@@ -20,6 +20,9 @@ BIN=ndb
CHECKDATA=testdata/db/v0/data.mdb
+%.o: %.c $(HEADERS)
+ $(CC) $(CFLAGS) -c -o $@ $<
+
all: lib ndb libnostrdb.a
libnostrdb.a: $(OBJS)
@@ -28,7 +31,7 @@ libnostrdb.a: $(OBJS)
lib: benches test
ndb: ndb.c $(DEPS)
- $(CC) -Isrc $(CFLAGS) ndb.c $(LDS) -o $@
+ $(CC) $(CFLAGS) ndb.c $(LDS) -o $@
bindings: bindings-swift bindings-rust bindings-c
@@ -156,13 +159,13 @@ testdata/many-events.json: testdata/many-events.json.zst
zstd -d $<
bench: bench-ingest-many.c $(DEPS) testdata/many-events.json
- $(CC) -Isrc $(CFLAGS) $< $(LDS) -o $@
+ $(CC) $(CFLAGS) $< $(LDS) -o $@
testdata/db/.dir:
@mkdir -p testdata/db
touch testdata/db/.dir
test: test.c $(DEPS) testdata/db/.dir
- $(CC) -Isrc $(CFLAGS) test.c $(LDS) -o $@
+ $(CC) $(CFLAGS) test.c $(LDS) -o $@
.PHONY: tags clean