sqlite code is available with no restrictions from  https://www.sqlite.org/download.html

The code is downloaded as amalgamation source file with all the functions of the API in one file sqlite3.c and header files sqlite3.h and sqlite3ext.h

shell.c file is also included to create an sqlite3 command line utility.

Currently the latest stable version is https://www.sqlite.org/2021/sqlite-amalgamation-3350500.zip

Sample makefile to create a command line utility and a shared library looks like that:

CC=gcc
PROJECT=/home/dataexplorer1/projects/cplus/sqlite-amalgamation-3350500
LIBS=-lpthread -ldl -lm

default:libsqlite3
sqlite3: sqlite3.c shell.c
${CC} -fPIC -o $@ sqlite3.c shell.c ${LIBS}

libsqlite3: sqlite3.c
${CC} -shared -fPIC -o $@.so sqlite3.c ${LIBS}



sqlite3.c is compiled into a rather small object file, thus can be added the libraries used to access sqlite3 directly to avoid extra linking.