commit a6b3c7ddf17401ec6302822e8f4b40f3a0cc17f1
parent ded5b85c629fe14652cd837bd9e1ec58938c0725
Author: William Casarin <jb55@jb55.com>
Date: Sat, 23 Dec 2023 15:16:51 -0800
fix build
Diffstat:
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/Makefile b/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