interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / autoconf / Makefile.in

301 lines · 9903 bytes Raw Blame History
1########################################################################
2# This is a main makefile for the "autoconf" bundle of SQLite. This is
3# a trimmed-down version of the canonical makefile, devoid of most
4# documentation. For the full docs, see /main.mk in the canonical
5# source tree.
6#
7# Maintenance reminders:
8#
9# - To keep this working with an out-of-tree build, be sure to prefix
10# input file names with $(TOP)/ where appropriate (which is most
11# places).
12#
13# - The original/canonical recipes can be found in /main.mk in the
14# canonical source tree.
15all:
16
17TOP = @abs_top_srcdir@
18
19PACKAGE_VERSION = @PACKAGE_VERSION@
20
21#
22# Filename extensions for binaries and libraries
23#
24B.exe = @BUILD_EXEEXT@
25T.exe = @TARGET_EXEEXT@
26B.dll = @BUILD_DLLEXT@
27T.dll = @TARGET_DLLEXT@
28B.lib = @BUILD_LIBEXT@
29T.lib = @TARGET_LIBEXT@
30
31#
32# Autotools-compatibility dirs
33#
34prefix = @prefix@
35datadir = @datadir@
36mandir = @mandir@
37includedir = @includedir@
38exec_prefix = @exec_prefix@
39bindir = @bindir@
40libdir = @libdir@
41
42#
43# Required binaries
44#
45INSTALL = @BIN_INSTALL@
46AR = @AR@
47AR.flags = cr
48CC = @CC@
49
50
51ENABLE_LIB_SHARED = @ENABLE_LIB_SHARED@
52ENABLE_LIB_STATIC = @ENABLE_LIB_STATIC@
53HAVE_WASI_SDK = @HAVE_WASI_SDK@
54
55CFLAGS = @CFLAGS@ @CPPFLAGS@
56#
57# $(LDFLAGS.configure) represents any LDFLAGS=... the client passes to
58# configure. See main.mk.
59#
60LDFLAGS.configure = @LDFLAGS@
61
62CFLAGS.core = @SH_CFLAGS@
63LDFLAGS.shlib = @SH_LDFLAGS@
64LDFLAGS.zlib = @LDFLAGS_ZLIB@
65LDFLAGS.math = @LDFLAGS_MATH@
66LDFLAGS.rpath = @LDFLAGS_RPATH@
67LDFLAGS.pthread = @LDFLAGS_PTHREAD@
68LDFLAGS.dlopen = @LDFLAGS_DLOPEN@
69LDFLAGS.readline = @LDFLAGS_READLINE@
70CFLAGS.readline = @CFLAGS_READLINE@
71LDFLAGS.rt = @LDFLAGS_RT@
72LDFLAGS.icu = @LDFLAGS_ICU@
73CFLAGS.icu = @CFLAGS_ICU@
74
75# INSTALL reminder: we specifically do not strip binaries,
76# as discussed in https://sqlite.org/forum/forumpost/9a67df63eda9925c.
77INSTALL.noexec = $(INSTALL) -m 0644
78
79install-dir.bin = $(DESTDIR)$(bindir)
80install-dir.lib = $(DESTDIR)$(libdir)
81install-dir.include = $(DESTDIR)$(includedir)
82install-dir.pkgconfig = $(DESTDIR)$(libdir)/pkgconfig
83install-dir.man1 = $(DESTDIR)$(mandir)/man1
84install-dir.all = $(install-dir.bin) $(install-dir.include) \
85 $(install-dir.lib) $(install-dir.man1) \
86 $(install-dir.pkgconfig)
87$(install-dir.all):
88 @if [ ! -d "$@" ]; then set -x; $(INSTALL) -d "$@"; fi
89# ^^^^ on some platforms, install -d fails if the target already exists.
90
91
92#
93# Vars with the AS_ prefix are specifically related to AutoSetup.
94#
95# AS_AUTO_DEF is the main configure script.
96#
97AS_AUTO_DEF = $(TOP)/auto.def
98
99#
100# Shell commands to re-run $(TOP)/configure with the same args it was
101# invoked with to produce this makefile.
102#
103AS_AUTORECONFIG = @SQLITE_AUTORECONFIG@
104Makefile: $(TOP)/Makefile.in $(AS_AUTO_DEF)
105 $(AS_AUTORECONFIG)
106 @touch $@
107
108sqlite3.pc: $(TOP)/sqlite3.pc.in $(AS_AUTO_DEF)
109 $(AS_AUTORECONFIG)
110 @touch $@
111
112sqlite_cfg.h: $(AS_AUTO_DEF)
113 $(AS_AUTORECONFIG)
114 @touch $@
115
116#
117# CFLAGS for sqlite3$(T.exe)
118#
119SHELL_OPT ?= @OPT_SHELL@
120
121#
122# Library-level feature flags
123#
124OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
125
126LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@
127# soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded
128LDFLAGS.libsqlite3.os-specific = \
129 @LDFLAGS_MAC_CVERSION@ @LDFLAGS_MAC_INSTALL_NAME@ @LDFLAGS_OUT_IMPLIB@
130
131LDFLAGS.libsqlite3 = \
132 $(LDFLAGS.rpath) $(LDFLAGS.pthread) \
133 $(LDFLAGS.math) $(LDFLAGS.dlopen) \
134 $(LDFLAGS.zlib) $(LDFLAGS.icu) \
135 $(LDFLAGS.rt) $(LDFLAGS.configure)
136CFLAGS.libsqlite3 = -I. $(CFLAGS.core) $(CFLAGS.icu) $(OPT_FEATURE_FLAGS)
137
138sqlite3.o: $(TOP)/sqlite3.h $(TOP)/sqlite3.c
139 $(CC) -c $(TOP)/sqlite3.c -o $@ $(CFLAGS) $(CFLAGS.libsqlite3)
140
141libsqlite3.LIB = libsqlite3$(T.lib)
142libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@
143libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@
144libsqlite3.DLL = $(libsqlite3.DLL.basename)$(T.dll)
145libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@
146
147$(libsqlite3.DLL): sqlite3.o
148 $(CC) -o $@ sqlite3.o $(LDFLAGS.shlib) \
149 $(LDFLAGS) $(LDFLAGS.libsqlite3) \
150 $(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname)
151$(libsqlite3.DLL)-1: $(libsqlite3.DLL)
152$(libsqlite3.DLL)-0:
153all: $(libsqlite3.DLL)-$(ENABLE_LIB_SHARED)
154
155$(libsqlite3.LIB): sqlite3.o
156 $(AR) $(AR.flags) $@ sqlite3.o
157$(libsqlite3.LIB)-1: $(libsqlite3.LIB)
158$(libsqlite3.LIB)-0:
159all: $(libsqlite3.LIB)-$(ENABLE_LIB_STATIC)
160
161#
162# Maintenance reminder: the install-dll-... rules must be kept in sync
163# with the main copies rom /main.mk.
164#
165install-dll-out-implib: $(install-dir.lib) $(libsqlite3.DLL)
166 if [ x != "x$(libsqlite3.out.implib)" ] && [ -f "$(libsqlite3.out.implib)" ]; then \
167 $(INSTALL) $(libsqlite3.out.implib) "$(install-dir.lib)"; \
168 fi
169
170install-dll-unix-generic: install-dll-out-implib
171 $(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
172 @echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
173 cd "$(install-dir.lib)" || exit $$?; \
174 rm -f $(libsqlite3.DLL).0 $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
175 mv $(libsqlite3.DLL) $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
176 ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL) || exit $$?; \
177 ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0 || exit $$?; \
178 ls -la $(libsqlite3.DLL) $(libsqlite3.DLL).[a03]*; \
179 if [ -e $(libsqlite3.DLL).0.8.6 ]; then \
180 echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
181 rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
182 ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
183 ls -la $(libsqlite3.DLL).0.8.6; \
184 elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \
185 echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \
186 rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
187 ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
188 ls -la $(libsqlite3.DLL).0.8.6; \
189 fi
190
191install-dll-msys: install-dll-out-implib $(install-dir.bin)
192 $(INSTALL) $(libsqlite3.DLL) "$(install-dir.bin)"
193# ----------------------------------------------^^^ yes, bin
194# Each of {msys,mingw,cygwin} uses a different name for the DLL, but
195# that is already accounted for via $(libsqlite3.DLL).
196install-dll-mingw: install-dll-msys
197install-dll-cygwin: install-dll-msys
198
199install-dll-darwin: $(install-dir.lib) $(libsqlite3.DLL)
200 $(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
201 @echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
202 cd "$(install-dir.lib)" || exit $$?; \
203 rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
204 dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
205 mv $(libsqlite3.DLL) $$dllname || exit $$?; \
206 ln -s $$dllname $(libsqlite3.DLL) || exit $$?; \
207 ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
208 ls -la $$dllname $(libsqlite3.DLL) libsqlite3.0$(T.dll)
209
210install-dll-1: install-dll-$(libsqlite3.DLL.install-rules)
211install-dll-0 install-dll-:
212install-dll: install-dll-$(ENABLE_LIB_SHARED)
213install: install-dll
214
215install-lib-1: $(install-dir.lib) $(libsqlite3.LIB)
216 $(INSTALL.noexec) $(libsqlite3.LIB) "$(install-dir.lib)"
217install-lib-0 install-lib-:
218install-lib: install-lib-$(ENABLE_LIB_STATIC)
219install: install-lib
220
221#
222# Flags to link the shell app either directly against sqlite3.c
223# (ENABLE_STATIC_SHELL==1) or libsqlite3.so (ENABLE_STATIC_SHELL==0).
224#
225# Maintenance reminder: placement of $(LDFLAGS) is more relevant for
226# some platforms than others:
227# https://sqlite.org/forum/forumpost/d80ecdaddd
228ENABLE_STATIC_SHELL = @ENABLE_STATIC_SHELL@
229sqlite3-shell-link-flags.1 = $(TOP)/sqlite3.c $(LDFLAGS) $(LDFLAGS.libsqlite3)
230sqlite3-shell-link-flags.0 = $(LDFLAGS) -L. -lsqlite3 $(LDFLAGS.zlib) $(LDFLAGS.math)
231sqlite3-shell-deps.1 = $(TOP)/sqlite3.c
232sqlite3-shell-deps.0 = $(libsqlite3.DLL)
233#
234# STATIC_CLI_SHELL = 1 to statically link sqlite3$(T.exe), else
235# 0. Requires static versions of all requisite libraries. Primarily
236# intended for use with static-friendly environments like Alpine
237# Linux.
238#
239STATIC_CLI_SHELL = @STATIC_CLI_SHELL@
240#
241# sqlite3-shell-static.flags.N = N is $(STATIC_CLI_SHELL)
242#
243sqlite3-shell-static.flags.1 = -static
244sqlite3-shell-static.flags.0 =
245sqlite3$(T.exe): $(TOP)/shell.c $(sqlite3-shell-deps.$(ENABLE_STATIC_SHELL))
246 $(CC) -o $@ \
247 $(TOP)/shell.c $(sqlite3-shell-link-flags.$(ENABLE_STATIC_SHELL)) \
248 $(sqlite3-shell-static.flags.$(STATIC_CLI_SHELL)) \
249 -I. $(OPT_FEATURE_FLAGS) $(SHELL_OPT) \
250 $(CFLAGS) $(CFLAGS.readline) $(CFLAGS.icu) \
251 $(LDFLAGS.readline)
252
253sqlite3$(T.exe)-1:
254sqlite3$(T.exe)-0: sqlite3$(T.exe)
255all: sqlite3$(T.exe)-$(HAVE_WASI_SDK)
256
257install-shell-0: sqlite3$(T.exe) $(install-dir.bin)
258 $(INSTALL) sqlite3$(T.exe) "$(install-dir.bin)"
259install-shell-1:
260install: install-shell-$(HAVE_WASI_SDK)
261
262install-headers: $(TOP)/sqlite3.h $(install-dir.include)
263 $(INSTALL.noexec) $(TOP)/sqlite3.h $(TOP)/sqlite3ext.h "$(install-dir.include)"
264install: install-headers
265
266install-pc: sqlite3.pc $(install-dir.pkgconfig)
267 $(INSTALL.noexec) sqlite3.pc "$(install-dir.pkgconfig)"
268install: install-pc
269
270install-man1: $(TOP)/sqlite3.1 $(install-dir.man1)
271 $(INSTALL.noexec) $(TOP)/sqlite3.1 "$(install-dir.man1)"
272install: install-man1
273
274clean:
275 rm -f *.o sqlite3$(T.exe)
276 rm -f $(libsqlite3.LIB) $(libsqlite3.DLL) libsqlite3$(T.dll).a
277
278distclean: clean
279 rm -f jimsh0$(T.exe) config.* sqlite3.pc sqlite_cfg.h Makefile
280
281DIST_FILES := \
282 README.txt VERSION \
283 auto.def autosetup configure tea \
284 sqlite3.h sqlite3.c shell.c sqlite3ext.h \
285 Makefile.in Makefile.msc Makefile.fallback make.bat \
286 sqlite3.rc sqlite3rc.h Replace.cs \
287 sqlite3.pc.in sqlite3.1
288
289#
290# Maintenance note: dist_name must be sqlite-$(PACKAGE_VERSION) so
291# that tool/mkautoconfamal.sh knows how to find it.
292#
293dist_name = sqlite-$(PACKAGE_VERSION)
294dist_tarball = $(dist_name).tar.gz
295dist:
296 rm -fr $(dist_name)
297 mkdir -p $(dist_name)
298 cp -rp $(DIST_FILES) $(dist_name)/.
299 tar czf $(dist_tarball) $(dist_name)
300 rm -fr $(dist_name)
301 ls -l $(dist_tarball)