Packages
exqlite
0.2.1
0.39.0
0.38.0
0.37.0
0.36.0
0.35.0
0.34.0
0.33.1
0.33.0
0.32.1
0.32.0
0.31.0
0.30.1
0.30.0
0.29.0
0.28.0
0.27.1
0.27.0
0.26.0
0.25.0
0.24.2
0.24.1
0.24.0
0.23.0
0.22.0
0.21.0
0.20.0
0.19.0
0.18.0
0.17.0
0.16.2
0.16.1
0.16.0
0.15.0
0.14.0
0.13.15
0.13.14
0.13.13
0.13.12
0.13.11
0.13.10
0.13.9
0.13.8
0.13.7
0.13.6
0.13.5
0.13.4
0.13.3
0.13.2
0.13.1
0.13.0
0.12.0
0.11.9
0.11.8
0.11.7
0.11.6
0.11.5
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.10.3
0.10.2
0.10.1
0.10.0
0.9.3
0.9.2
0.9.1
0.9.0
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.9
0.7.8
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0
0.5.11
0.5.10
0.5.9
0.5.8
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.9
0.4.8
0.4.7
0.4.6
0.4.5
0.4.4
0.4.2
0.4.1
0.4.0
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
An Elixir SQLite3 library
Current section
Files
Jump to
Current section
Files
Makefile
SRC = sqlite3/sqlite3.c c_src/sqlite3_nif.c
CFLAGS ?= -g
# TODO: We should allow the person building to be able to specify this
CFLAGS += -O3
CFLAGS += -Wall
CFLAGS += -I"$(ERTS_INCLUDE_DIR)"
CFLAGS += -Isqlite3 -Ic_src
# For more information about these features being enabled, check out
# --> https://sqlite.org/compile.html
CFLAGS += -DSQLITE_THREADSAFE=1
CFLAGS += -DSQLITE_USE_URI
# TODO: The following features should be completely configurable by the person
# installing the nif. Just need to have certain environment variables
# enabled to support them.
CFLAGS += -DSQLITE_ENABLE_FTS4
CFLAGS += -DSQLITE_ENABLE_FTS5
CFLAGS += -DSQLITE_ENABLE_JSON1
CFLAGS += -DSQLITE_ENABLE_GEOPOLY
CFLAGS += -DSQLITE_OMIT_DEPRECATED
CFLAGS += -DSQLITE_ENABLE_RTREE
CFLAGS += -DSQLITE_ENABLE_RBU
# TODO: We should allow the person building to be able to specify this
CFLAGS += -DNDEBUG=1
KERNEL_NAME := $(shell uname -s)
PRIV_DIR = $(MIX_APP_PATH)/priv
LIB_NAME = $(PRIV_DIR)/sqlite3_nif.so
ifneq ($(CROSSCOMPILE),)
LIB_CFLAGS := -shared -fPIC -fvisibility=hidden
SO_LDFLAGS := -Wl,-soname,libsqlite3.so.0
else
ifeq ($(KERNEL_NAME), Linux)
LIB_CFLAGS := -shared -fPIC -fvisibility=hidden
SO_LDFLAGS := -Wl,-soname,libsqlite3.so.0
endif
ifeq ($(KERNEL_NAME), Darwin)
LIB_CFLAGS := -dynamiclib -undefined dynamic_lookup
endif
ifeq ($(KERNEL_NAME), $(filter $(KERNEL_NAME),OpenBSD FreeBSD NetBSD))
LIB_CFLAGS := -shared -fPIC
endif
endif
all: $(PRIV_DIR) $(LIB_NAME)
$(LIB_NAME): $(SRC)
$(CC) $(CFLAGS) $(LIB_CFLAGS) $(SO_LDFLAGS) $^ -o $@
$(PRIV_DIR):
mkdir -p $@
clean:
rm -f $(LIB_NAME)
.PHONY: all clean