sqlite/Makefile.in

307 lines
9.5 KiB
Makefile
Raw Normal View History

#!/usr/bin/make
#
# Makefile for SQLITE
#
# This makefile is intended to be configured automatically using the
# configure script. Hand editing may not work as expected because
# certain blocks are added or removed depending on configure-time
# information.
#
all:
#XX# Lines starting with #XX# are TODOs for the port to autosetup
# The toplevel directory of the source tree. This is the directory
# that contains this "Makefile.in" and the "configure" script.
#
TOP = @abs_top_srcdir@
# Just testing expansions...
# srcdir = @srcdir@
# top_srcdir = @top_srcdir@
# abs_top_srcdir = @abs_top_srcdir@
# abs_top_builddir = @abs_top_builddir@
LDFLAGS_ZLIB ?= @LDFLAGS_ZLIB@
LDFLAGS_MATH ?= @LDFLAGS_MATH@
LDFLAGS_RPATH ?= @LDFLAGS_RPATH@
LDFLAGS_READLINE ?= @LDFLAGS_READLINE@
LDFLAGS_PTHREAD ?= @LDFLAGS_PTHREAD@
LDFLAGS_SHOBJ ?= @SHOBJ_LDFLAGS@
ENABLE_SHARED ?= @ENABLE_SHARED@
HAVE_WASI_SDK ?= @HAVE_WASI_SDK@
AR = @AR@
CC = @CC@
# C Compiler and options for use in building executables that
# will run on the platform that is doing the build.
#
BCC = @BUILD_CC@ @BUILD_CFLAGS@
#
# TCC is the C Compile and options for use in building executables that
# will run on the target platform. (BCC and TCC are usually the
# same unless your are cross-compiling.) Separate CC and CFLAGS macros
# are provide so that these aspects of the build process can be changed
# on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined"
#
CFLAGS = @CFLAGS@ @SH_CFLAGS@
CPPFLAGS = @CPPFLAGS@
# CFLAGS_stdio3 ==> for sqlite3_stdio.h
CFLAGS_stdio3 := -I$(TOP)/ext/misc
TCC ?= $(CC) $(CFLAGS)
# Define -DNDEBUG to compile without debugging (i.e., for production usage)
# Omitting the define will cause extra debugging code to be inserted and
# includes extra comments when "EXPLAIN stmt" is used.
#
TCCX ?= $(TCC) @TARGET_DEBUG@
# Define this for the autoconf-based build, so that the code knows it can
# include the generated sqlite_cfg.h
#
TCCX += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
#
# main.mk will fill out TCCX with some flags common to all builds.
#XX#
#XX## Compiler options needed for programs that use the TCL library.
#XX##
#XX#TCC += @TCL_INCLUDE_SPEC@
#XX#
#XX## The library that programs using TCL must link against.
#XX##
LIBTCL = @TCL_LIB_SPEC@
#
# Compiler options needed for programs that use the readline() library.
#
CFLAGS_readline = -DHAVE_READLINE=@HAVE_READLINE@ @CFLAGS_READLINE@
#XX#CFLAGS_readline += -DHAVE_EDITLINE=@TARGET_HAVE_EDITLINE@
#XX#CFLAGS_readline += -DHAVE_LINENOISE=@TARGET_HAVE_LINENOISE@
#XX#
#XX## The library that programs using readline() must link against.
#XX##
#XX#LIBREADLINE = @TARGET_READLINE_LIBS@
#XX#
#XX## Should the database engine be compiled threadsafe
#XX##
#XX#TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
#
# Any target libraries which libsqlite must be linked against
#
# With the autosetup build, the intended way to do this is to set
# those in $(LDFLAGS_libsqlite3) and include those flags for both
# $(libsqlite3.SO) and any apps which directly link in either
# sqlite3.o or its origin sources.
LIBS += @LIBS@
TLIBS = $(LIBS)
#
# JimTCL is part of the autosetup suite and is suitable for all
# current in-tree code-generation TCL jobs, but it requires that we
# build it with non-default flags. Note that the build tree will, if
# no system-level tclsh is found, also have a ./jimsh0. That one is a
# bare-bones build for the configure process, whereas we need to build
# it with another option enabled for use with the various code
# generators.
#
JIMSH = @srcdir@/jimsh
CFLAGS_JIMSH ?= @CFLAGS_JIMSH@
$(JIMSH): $(TOP)/autosetup/jimsh0.c
$(BCC) -o $(JIMSH) $(CFLAGS_JIMSH) $(TOP)/autosetup/jimsh0.c
# BTCLSH is the tclsh-compatible app used for running various code
# generators and other in-tree tools, as opposed to the TCL-based
# tests, which must be built and run using the canonical TCL
# distribution.
BTCLSH = @BTCLSH@
$(BTCLSH):
# Flags controlling use of the in memory btree implementation
#
# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
# default to file, 2 to default to memory, and 3 to force temporary
# tables to always be in memory.
#
TEMP_STORE ?= -DSQLITE_TEMP_STORE=@TEMP_STORE@
# Enable/disable loadable extensions, and other optional features
# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
# The same set of OMIT and ENABLE flags should be passed to the
# LEMON parser generator and the mkkeywordhash tool as well.
#
# Add OPTIONS=... on the command line to append additional options
# to the OPT_FEATURE_FLAGS. Note that some flags only work if
# the build is specifically configured to account for them.
#
OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@ $(OPTIONS)
TCC += $(OPT_FEATURE_FLAGS)
# Add in any optional parameters specified on the make commane line
# ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1".
TCC += $(OPTS)
# Add in compile-time options for some libraries used by extensions
TCC += @CFLAGS_ZLIB@
# Version numbers and release number for the SQLite being compiled.
#
VERSION = @VERSION@
RELEASE = @RELEASE@
# Filename extensions for binaries and libraries
#
BEXE = @BUILD_EXEEXT@
TEXE = @TARGET_EXEEXT@
BDLL = @BUILD_DLLEXT@
TDLL = @TARGET_DLLEXT@
BLIB = @BUILD_LIBEXT@
TLIB = @TARGET_LIBEXT@
# The following variable is "1" if the configure script was able to locate
# the tclConfig.sh file. It is an empty string otherwise. When this
# variable is "1", the TCL extension library (libtclsqlite3.so) is built
# and installed.
#
HAVE_TCL = @HAVE_TCL@
# This is the command to use for tclsh - normally just "tclsh", but we may
# know the specific version we want to use. This must point to the canonical
# TCL interpreter, not JimTCL.
#
TCLSH_CMD = @TCLSH_CMD@
TCL_CONFIG_SH = @TCL_CONFIG_SH@
# TCL config info from tclConfig.sh
TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@
TCL_LIB_SPEC = @TCL_LIB_SPEC@
TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@
TCL_VERSION = @TCL_VERSION@
TCLLIB_RPATH = @TCLLIB_RPATH@
TCLLIBDIR = @TCLLIBDIR@
# EMCC_WRAPPER must refer to the genuine emcc binary, or a
# call-compatible wrapper, e.g. $(TOP)/tool/emcc.sh. If it's empty,
# build components requiring Emscripten will not build.
EMCC_WRAPPER = @EMCC_WRAPPER@
# Additional options when running tests using testrunner.tcl
# This is usually either blank, or else --status
#
TSTRNNR_OPTS = @TSTRNNR_OPTS@
# Where do we want to install the tcl plugin
#
TCLLIBDIR = @TCLLIBDIR@
#
# If gcov support was enabled by the configure script, add the appropriate
# flags here. It's not always as easy as just having the user add the right
# CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which
# causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
# Supposedly GCC does the right thing if you use --coverage, but in
# practice it still fails. See:
#
# http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html
#
# for more info.
#
GCOV_CFLAGS1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage
GCOV_LDFLAGS1 = -lgcov
USE_GCOV = @USE_GCOV@
TCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV))
TLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
# The directory into which to store package information for
# Some standard variables and programs
#
prefix ?= @prefix@
exec_prefix ?= @exec_prefix@
libdir ?= @libdir@
pkgconfigdir ?= $(libdir)/pkgconfig
bindir ?= @bindir@
includedir ?= @includedir@
INSTALL = @BIN_INSTALL@
#
# You should not have to change anything below this line
################################################################################
#
# Vars with the AS_ prefix are specifically related to AutoSetup.
#
# AS_AUTO_DEF is the main configure script.
#
AS_AUTO_DEF = $(TOP)/auto.def
USE_AMALGAMATION ?= @USE_AMALGAMATION@
AMALGAMATION_LINE_MACROS ?= --linemacros=@AMALGAMATION_LINE_MACROS@
SHELL_OPT ?= @OPT_SHELL@
# In wasi-sdk builds, remove the CLI shell build from 'all'.
target_sqlite3_shell_0 = sqlite3$(TEXE)
target_sqlite3_shell = $(target_sqlite3_shell_$(HAVE_WASI_SDK))
#
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
all: sqlite3.h sqlite3.c shell.c $(target_sqlite3_shell)
# Re-run $(TOP)/configure with the same args invoked to produce this
# makefile.
#
AS_AUTOREMAKE = @SQLITE_AUTOREMAKE@
Makefile: $(TOP)/Makefile.in $(AS_AUTO_DEF)
$(AS_AUTOREMAKE)
@touch $@
sqlite3.pc: $(TOP)/sqlite3.pc.in $(AS_AUTO_DEF)
$(AS_AUTOREMAKE)
@touch $@
install-pc: sqlite3.pc $(install.pkgconfigdir)
$(INSTALL_noexec) sqlite3.pc $(install.pkgconfigdir)
install: install-pc
sqlite_cfg.h: $(TOP)/sqlite_cfg.h.in $(AS_AUTO_DEF)
$(AS_AUTOREMAKE)
@touch $@
#
# Fiddle app
#
fiddle: sqlite3.c shell.c
@if [ x = "x$(EMCC_WRAPPER)" ]; then \
echo "Emscripten's emcc not found. Cannot build fiddle." 1&>2; \
exit 1; \
fi
make -C ext/wasm fiddle emcc_opt=-Os
#
# Spell-checking for source comments
# The sources checked are either C sources or C source templates.
# Their comments are extracted and processed through aspell using
# a custom dictionary that contains scads of odd identifiers that
# find their way into the comments.
#
# Currently, this target is setup to be "made" in-tree only.
# The output is ephemeral. Redirect it to guide spelling fixups,
# either to correct spelling or add words to tool/custom.txt.
#
./custom.rws: ./tool/custom.txt
@echo 'Updating custom dictionary from tool/custom.txt'
aspell --lang=en create master ./custom.rws < ./tool/custom.txt
# Note that jimsh does not work here:
# https://github.com/msteveb/jimtcl/issues/319
misspell: ./custom.rws has_tclsh84
$(TCLSH_CMD) ./tool/spellsift.tcl ./src/*.c ./src/*.h ./src/*.in
include $(TOP)/main.mk