Skip to content

Commit

Permalink
remove sqlite3
Browse files Browse the repository at this point in the history
  • Loading branch information
inimino committed Jun 22, 2024
1 parent dc359fe commit ae4b9e5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 362 deletions.
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,25 @@ CC := gcc

all: dist/cmpr

CFLAGS := -O2 -Wall -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
CFLAGS := -O2 -Wall
LDFLAGS := -lm

debug: CFLAGS := -g -O0 -Wall -fsanitize=address -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
debug: CFLAGS := -g -O0 -Wall -fsanitize=address
debug: dist/cmpr

dev: CFLAGS := -O2 -Wall -Werror -fsanitize=address -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
dev: CFLAGS := -O2 -Wall -Werror -fsanitize=address
dev: dist/cmpr

dist/cmpr: cmpr.c fdecls.h spanio.c siphash/siphash.o siphash/halfsiphash.o libs/sqlite3.o
dist/cmpr: cmpr.c fdecls.h spanio.c siphash/siphash.o siphash/halfsiphash.o
mkdir -p dist
(VER=8; D=$$(date +%Y%m%d-%H%M%S); GIT=$$(git log -1 --pretty="%h %f"); echo '#line 1 "cmpr.c"' >cmpr-sed.c; sed 's/\$$VERSION\$$/'"$$VER"' (build: '"$$D"' '"$$GIT"')/' <cmpr.c >>cmpr-sed.c; echo "Version: $$VER (build: $$D $$GIT)"; $(CC) -o dist/cmpr-$$D cmpr-sed.c siphash/siphash.o siphash/halfsiphash.o libs/sqlite3.o $(CFLAGS) $(LDFLAGS) && rm -f dist/cmpr && ln -s cmpr-$$D dist/cmpr)
(VER=8; D=$$(date +%Y%m%d-%H%M%S); GIT=$$(git log -1 --pretty="%h %f"); echo '#line 1 "cmpr.c"' >cmpr-sed.c; sed 's/\$$VERSION\$$/'"$$VER"' (build: '"$$D"' '"$$GIT"')/' <cmpr.c >>cmpr-sed.c; echo "Version: $$VER (build: $$D $$GIT)"; $(CC) -o dist/cmpr-$$D cmpr-sed.c siphash/siphash.o siphash/halfsiphash.o $(CFLAGS) $(LDFLAGS) && rm -f dist/cmpr && ln -s cmpr-$$D dist/cmpr)

siphash/siphash.o: siphash/siphash.c
$(CC) -c siphash/siphash.c $(CFLAGS) -o siphash/siphash.o

siphash/halfsiphash.o: siphash/halfsiphash.c
$(CC) -c siphash/halfsiphash.c $(CFLAGS) -o siphash/halfsiphash.o

libs/sqlite3.o: libs/sqlite3.c
$(CC) -c libs/sqlite3.c $(CFLAGS) -o libs/sqlite3.o

fdecls.h: cmpr.c
python3 extract_decls.py < cmpr.c > fdecls.h

Expand Down
Loading

0 comments on commit ae4b9e5

Please sign in to comment.