MSYS2-packages/sqlite/Makefile.ext.in
Christoph Reiter c8763c7c64 sqlite: restore pcachetrace extension
we had a mingw patch for this already, so might as well fix it here too
2025-05-04 09:18:32 +02:00

56 lines
1.6 KiB
Makefile

# PLEASE KEEP IN SYNC WITH CORRESPONDING FILE IN MINGW64-SQLITE.
#
# Makefile template to generate sqlite extensions
# in sub-folder ext/misc of sqlite-src-xxxxx package.
DLL_PREFIX = msys-sqlite3
DLL_SUFFIX = -0
extdir = $(prefix)/bin
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
vpath %.c $(srcdir)
vpath %.in ../$(top_srcdir)
prefix = @prefix@
datadir = @datadir@
docdir = $(datadir)/sqlite/extensions
# c-source for each of which an extension is built
CSRCS = $(filter-out $(addprefix $(srcdir)/,$(CSRCS_IGNORE)),$(wildcard $(srcdir)/*.c))
# c-sources not to compile as standalone sqlite-extensions
CSRCS_IGNORE = memtrace.c json1.c vfstrace.c
# c-source already compiled into sqlite3 client
CSRCS_IGNORE += regexp.c
# c-source to be ignored because of compilation errors
#CSRCS_IGNORE +=
DLLS = $(patsubst %.c,$(DLL_PREFIX)%$(DLL_SUFFIX).dll,$(notdir $(CSRCS)))
CC = @CC@
CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)/src
CFLAGS = -pedantic
LIBS = -Wl,--no-undefined -L$(top_builddir) -lsqlite3 -lz
.PHONY : all
all : $(DLLS)
$(DLL_PREFIX)%$(DLL_SUFFIX).dll: %.c
$(CC) -shared $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LIBS)
.PHONY: clean install install-dlls install-c-files
clean:
-rm -f $(DLLS) 2> /dev/nul
install: install-dlls install-c-files
install-dlls: $(DLLS)
mkdir -p $(DESTDIR)$(extdir)
cp -vp $^ $(DESTDIR)$(extdir)
install-c-files: $(CSRCS)
mkdir -p $(DESTDIR)$(docdir)
cp -vp $^ $(DESTDIR)$(docdir)