Files
MINGW-packages/mingw-w64-sqlite3/Makefile.ext.in
Jannick dcab627324 sqlite3: add sqlite extensions to package
sqlite extensions are shared libraries loadable at run-time enhancing
sqlite's SQl code.

The source code of each of the sqlite extensions is located in directory
'ext/misc' of the source code package.  A hand-written Makefile, adjusted
using a project's autoconf tool (config.status), is generated in the
extensions build folder.

The extensions (together with each of the source c-files containing the
extension documentation in the file header) are installed in the directory
'${prefix}/share/sqlite/extensions'.

* PKGBUILD:
  - increase pkgrel
  - add build and install routines for sqlite extensions.
* Makefile.ext.in: add file.
* README.md.in: add file.
2020-08-05 21:30:07 +02:00

48 lines
1.3 KiB
Makefile

# Makefile template to generate sqlite extensions in sub-folder ext/misc
DLL_PREFIX =
DLL_SUFFIX =
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
vpath %.c $(srcdir)
vpath %.in ../$(top_srcdir)
PACKAGE_VERSION = @PACKAGE_VERSION@
prefix = @prefix@
datadir = @datadir@
extdir = $(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
# c-source to be ignored because of compilation errors
CSRCS_IGNORE += fileio.c
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)/.libs -lsqlite3 -lz
.PHONY : all
all : $(DLLS)
$(DLL_PREFIX)%$(DLL_SUFFIX).dll: %.c
$(CC) -shared $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LIBS)
%.i: %.c
$(CC) -E $(CPPFLAGS) -o $@ $<
.PHONY: clean install
clean:
-rm -f $(DLLS) 2> /dev/nul
install: $(DLLS) $(CSRCS)
mkdir -p $(DESTDIR)$(extdir)
cp -vp $^ $(DESTDIR)$(extdir)