Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jb55 committed Dec 23, 2023
1 parent ded5b85 commit a6b3c7d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand All @@ -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

Expand Down Expand Up @@ -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

0 comments on commit a6b3c7d

Please sign in to comment.