MSYS2-packages/sqlite/Makefile.ext.in
Jannick 4558ea2abb sqlite: Upgrade to 3.36.0
* PKGBUILD
  - upgrade version numbers and related hashes
  - rename patch
* Makefile.ext.in
  - add regexp.c to CSRC_IGNORE, since module is compiled into sqlite client
    since version 3.36.0
* 0007-sqlite3.36.0-Makefile.in-fix-libtclsqlite-package-installation-bug.patch
  - renamed from 0007-sqlite3.32.3-Makefile.in-fix-libtclsqlite-package-installation-bug.patch
  - remove patch about 'info sharedlibextension' which now works with tclsh
* 0007-sqlite3.32.3-Makefile.in-fix-libtclsqlite-package-installation-bug.patch
  - renamed
2021-06-21 23:27:33 +02:00

70 lines
1.9 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.
# define MSYSTEM-depending variables
ifeq ($(MSYSTEM),MSYS)
DLL_PREFIX = msys-sqlite3
DLL_SUFFIX = -0
extdir = $(prefix)/bin
else ifeq ($(MSYSTEM),MINGW64)
DLL_PREFIX =
DLL_SUFFIX =
extdir = $(datadir)/sqlite/extensions
else ifeq ($(MSYSTEM),MINGW32)
DLL_PREFIX =
DLL_SUFFIX =
extdir = $(datadir)/sqlite/extensions
else
$(error Unknown system MYSTEM=$(MSYSTEM))
endif
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@
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
# 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)/.libs -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)