Skip to content

Commit

Permalink
make: cleanup a bit, separate bench running
Browse files Browse the repository at this point in the history
  • Loading branch information
jb55 committed Dec 23, 2023
1 parent 3e3cd0f commit c27be43
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ BIN=ndb

CHECKDATA=testdata/db/v0/data.mdb

all: lib ndb libnostrdb.a
all: $(BIN) lib bench

%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c -o $@ $<

libnostrdb.a: $(OBJS)
ar rcs $@ $(OBJS)

lib: benches test
lib: libnostrdb.a

ndb: ndb.c $(DEPS)
$(CC) $(CFLAGS) ndb.c $(LDS) -o $@
Expand All @@ -43,8 +43,6 @@ check: test
clean:
rm -rf test bench bench-ingest bench-ingest-many

benches: bench

distclean: clean
rm -rf deps

Expand Down Expand Up @@ -158,9 +156,12 @@ testdata/many-events.json.zst:
testdata/many-events.json: testdata/many-events.json.zst
zstd -d $<

bench: bench-ingest-many.c $(DEPS) testdata/many-events.json
bench: bench-ingest-many.c $(DEPS)
$(CC) $(CFLAGS) $< $(LDS) -o $@

run-bench: testdata/many-events.json bench
./bench

testdata/db/.dir:
@mkdir -p testdata/db
touch testdata/db/.dir
Expand Down

0 comments on commit c27be43

Please sign in to comment.