Mercurial
comparison third_party/sqlite3/Makefile.in @ 167:589bab390fb4
[ThirdParty] Added sqlite3 to the third_party.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 19 Jan 2026 16:28:45 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 166:78ea8d5ccc87 | 167:589bab390fb4 |
|---|---|
| 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. | |
| 15 all: | |
| 16 | |
| 17 TOP = @abs_top_srcdir@ | |
| 18 | |
| 19 PACKAGE_VERSION = @PACKAGE_VERSION@ | |
| 20 | |
| 21 # | |
| 22 # Filename extensions for binaries and libraries | |
| 23 # | |
| 24 B.exe = @BUILD_EXEEXT@ | |
| 25 T.exe = @TARGET_EXEEXT@ | |
| 26 B.dll = @BUILD_DLLEXT@ | |
| 27 T.dll = @TARGET_DLLEXT@ | |
| 28 B.lib = @BUILD_LIBEXT@ | |
| 29 T.lib = @TARGET_LIBEXT@ | |
| 30 | |
| 31 # | |
| 32 # Autotools-compatibility dirs | |
| 33 # | |
| 34 prefix = @prefix@ | |
| 35 datadir = @datadir@ | |
| 36 mandir = @mandir@ | |
| 37 includedir = @includedir@ | |
| 38 exec_prefix = @exec_prefix@ | |
| 39 bindir = @bindir@ | |
| 40 libdir = @libdir@ | |
| 41 | |
| 42 # | |
| 43 # Required binaries | |
| 44 # | |
| 45 INSTALL = @BIN_INSTALL@ | |
| 46 AR = @AR@ | |
| 47 AR.flags = cr | |
| 48 CC = @CC@ | |
| 49 | |
| 50 | |
| 51 ENABLE_LIB_SHARED = @ENABLE_LIB_SHARED@ | |
| 52 ENABLE_LIB_STATIC = @ENABLE_LIB_STATIC@ | |
| 53 HAVE_WASI_SDK = @HAVE_WASI_SDK@ | |
| 54 | |
| 55 CFLAGS = @CFLAGS@ @CPPFLAGS@ | |
| 56 # | |
| 57 # $(LDFLAGS.configure) represents any LDFLAGS=... the client passes to | |
| 58 # configure. See main.mk. | |
| 59 # | |
| 60 LDFLAGS.configure = @LDFLAGS@ | |
| 61 | |
| 62 CFLAGS.core = @SH_CFLAGS@ | |
| 63 LDFLAGS.shlib = @SH_LDFLAGS@ | |
| 64 LDFLAGS.zlib = @LDFLAGS_ZLIB@ | |
| 65 LDFLAGS.math = @LDFLAGS_MATH@ | |
| 66 LDFLAGS.rpath = @LDFLAGS_RPATH@ | |
| 67 LDFLAGS.pthread = @LDFLAGS_PTHREAD@ | |
| 68 LDFLAGS.dlopen = @LDFLAGS_DLOPEN@ | |
| 69 LDFLAGS.readline = @LDFLAGS_READLINE@ | |
| 70 CFLAGS.readline = @CFLAGS_READLINE@ | |
| 71 LDFLAGS.rt = @LDFLAGS_RT@ | |
| 72 LDFLAGS.icu = @LDFLAGS_ICU@ | |
| 73 CFLAGS.icu = @CFLAGS_ICU@ | |
| 74 | |
| 75 # INSTALL reminder: we specifically do not strip binaries, | |
| 76 # as discussed in https://sqlite.org/forum/forumpost/9a67df63eda9925c. | |
| 77 INSTALL.noexec = $(INSTALL) -m 0644 | |
| 78 | |
| 79 install-dir.bin = $(DESTDIR)$(bindir) | |
| 80 install-dir.lib = $(DESTDIR)$(libdir) | |
| 81 install-dir.include = $(DESTDIR)$(includedir) | |
| 82 install-dir.pkgconfig = $(DESTDIR)$(libdir)/pkgconfig | |
| 83 install-dir.man1 = $(DESTDIR)$(mandir)/man1 | |
| 84 install-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 # | |
| 97 AS_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 # | |
| 103 AS_AUTORECONFIG = @SQLITE_AUTORECONFIG@ | |
| 104 Makefile: $(TOP)/Makefile.in $(AS_AUTO_DEF) | |
| 105 $(AS_AUTORECONFIG) | |
| 106 @touch $@ | |
| 107 | |
| 108 sqlite3.pc: $(TOP)/sqlite3.pc.in $(AS_AUTO_DEF) | |
| 109 $(AS_AUTORECONFIG) | |
| 110 @touch $@ | |
| 111 | |
| 112 sqlite_cfg.h: $(AS_AUTO_DEF) | |
| 113 $(AS_AUTORECONFIG) | |
| 114 @touch $@ | |
| 115 | |
| 116 # | |
| 117 # CFLAGS for sqlite3$(T.exe) | |
| 118 # | |
| 119 SHELL_OPT ?= @OPT_SHELL@ | |
| 120 SHELL_OPT += -DSQLITE_DQS=0 | |
| 121 SHELL_OPT += -DSQLITE_ENABLE_FTS4 | |
| 122 #SHELL_OPT += -DSQLITE_ENABLE_FTS5 | |
| 123 SHELL_OPT += -DSQLITE_ENABLE_RTREE | |
| 124 SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS | |
| 125 SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION | |
| 126 SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB | |
| 127 SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB | |
| 128 SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB | |
| 129 SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB | |
| 130 SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC | |
| 131 SHELL_OPT += -DSQLITE_ENABLE_PERCENTILE | |
| 132 SHELL_OPT += -DSQLITE_STRICT_SUBTYPE=1 | |
| 133 | |
| 134 # | |
| 135 # Library-level feature flags | |
| 136 # | |
| 137 OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@ | |
| 138 | |
| 139 LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@ | |
| 140 # soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded | |
| 141 LDFLAGS.libsqlite3.os-specific = \ | |
| 142 @LDFLAGS_MAC_CVERSION@ @LDFLAGS_MAC_INSTALL_NAME@ @LDFLAGS_OUT_IMPLIB@ | |
| 143 | |
| 144 LDFLAGS.libsqlite3 = \ | |
| 145 $(LDFLAGS.rpath) $(LDFLAGS.pthread) \ | |
| 146 $(LDFLAGS.math) $(LDFLAGS.dlopen) \ | |
| 147 $(LDFLAGS.zlib) $(LDFLAGS.icu) \ | |
| 148 $(LDFLAGS.rt) $(LDFLAGS.configure) | |
| 149 CFLAGS.libsqlite3 = -I. $(CFLAGS.core) $(CFLAGS.icu) $(OPT_FEATURE_FLAGS) | |
| 150 | |
| 151 sqlite3.o: $(TOP)/sqlite3.h $(TOP)/sqlite3.c | |
| 152 $(CC) -c $(TOP)/sqlite3.c -o $@ $(CFLAGS) $(CFLAGS.libsqlite3) | |
| 153 | |
| 154 libsqlite3.LIB = libsqlite3$(T.lib) | |
| 155 libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@ | |
| 156 libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@ | |
| 157 libsqlite3.DLL = $(libsqlite3.DLL.basename)$(T.dll) | |
| 158 libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@ | |
| 159 | |
| 160 $(libsqlite3.DLL): sqlite3.o | |
| 161 $(CC) -o $@ sqlite3.o $(LDFLAGS.shlib) \ | |
| 162 $(LDFLAGS) $(LDFLAGS.libsqlite3) \ | |
| 163 $(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname) | |
| 164 $(libsqlite3.DLL)-1: $(libsqlite3.DLL) | |
| 165 $(libsqlite3.DLL)-0: | |
| 166 all: $(libsqlite3.DLL)-$(ENABLE_LIB_SHARED) | |
| 167 | |
| 168 $(libsqlite3.LIB): sqlite3.o | |
| 169 $(AR) $(AR.flags) $@ sqlite3.o | |
| 170 $(libsqlite3.LIB)-1: $(libsqlite3.LIB) | |
| 171 $(libsqlite3.LIB)-0: | |
| 172 all: $(libsqlite3.LIB)-$(ENABLE_LIB_STATIC) | |
| 173 | |
| 174 # | |
| 175 # Maintenance reminder: the install-dll-... rules must be kept in sync | |
| 176 # with the main copies rom /main.mk. | |
| 177 # | |
| 178 install-dll-out-implib: $(install-dir.lib) $(libsqlite3.DLL) | |
| 179 if [ x != "x$(libsqlite3.out.implib)" ] && [ -f "$(libsqlite3.out.implib)" ]; then \ | |
| 180 $(INSTALL) $(libsqlite3.out.implib) "$(install-dir.lib)"; \ | |
| 181 fi | |
| 182 | |
| 183 install-dll-unix-generic: install-dll-out-implib | |
| 184 $(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)" | |
| 185 @echo "Setting up $(libsqlite3.DLL) version symlinks..."; \ | |
| 186 cd "$(install-dir.lib)" || exit $$?; \ | |
| 187 rm -f $(libsqlite3.DLL).0 $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \ | |
| 188 mv $(libsqlite3.DLL) $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \ | |
| 189 ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL) || exit $$?; \ | |
| 190 ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0 || exit $$?; \ | |
| 191 ls -la $(libsqlite3.DLL) $(libsqlite3.DLL).[a03]*; \ | |
| 192 if [ -e $(libsqlite3.DLL).0.8.6 ]; then \ | |
| 193 echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \ | |
| 194 rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \ | |
| 195 ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \ | |
| 196 ls -la $(libsqlite3.DLL).0.8.6; \ | |
| 197 elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \ | |
| 198 echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \ | |
| 199 rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \ | |
| 200 ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \ | |
| 201 ls -la $(libsqlite3.DLL).0.8.6; \ | |
| 202 fi | |
| 203 | |
| 204 install-dll-msys: install-dll-out-implib $(install-dir.bin) | |
| 205 $(INSTALL) $(libsqlite3.DLL) "$(install-dir.bin)" | |
| 206 # ----------------------------------------------^^^ yes, bin | |
| 207 # Each of {msys,mingw,cygwin} uses a different name for the DLL, but | |
| 208 # that is already accounted for via $(libsqlite3.DLL). | |
| 209 install-dll-mingw: install-dll-msys | |
| 210 install-dll-cygwin: install-dll-msys | |
| 211 | |
| 212 install-dll-darwin: $(install-dir.lib) $(libsqlite3.DLL) | |
| 213 $(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)" | |
| 214 @echo "Setting up $(libsqlite3.DLL) version symlinks..."; \ | |
| 215 cd "$(install-dir.lib)" || exit $$?; \ | |
| 216 rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \ | |
| 217 dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \ | |
| 218 mv $(libsqlite3.DLL) $$dllname || exit $$?; \ | |
| 219 ln -s $$dllname $(libsqlite3.DLL) || exit $$?; \ | |
| 220 ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \ | |
| 221 ls -la $$dllname $(libsqlite3.DLL) libsqlite3.0$(T.dll) | |
| 222 | |
| 223 install-dll-1: install-dll-$(libsqlite3.DLL.install-rules) | |
| 224 install-dll-0 install-dll-: | |
| 225 install-dll: install-dll-$(ENABLE_LIB_SHARED) | |
| 226 install: install-dll | |
| 227 | |
| 228 install-lib-1: $(install-dir.lib) $(libsqlite3.LIB) | |
| 229 $(INSTALL.noexec) $(libsqlite3.LIB) "$(install-dir.lib)" | |
| 230 install-lib-0 install-lib-: | |
| 231 install-lib: install-lib-$(ENABLE_LIB_STATIC) | |
| 232 install: install-lib | |
| 233 | |
| 234 # | |
| 235 # Flags to link the shell app either directly against sqlite3.c | |
| 236 # (ENABLE_STATIC_SHELL==1) or libsqlite3.so (ENABLE_STATIC_SHELL==0). | |
| 237 # | |
| 238 # Maintenance reminder: placement of $(LDFLAGS) is more relevant for | |
| 239 # some platforms than others: | |
| 240 # https://sqlite.org/forum/forumpost/d80ecdaddd | |
| 241 ENABLE_STATIC_SHELL = @ENABLE_STATIC_SHELL@ | |
| 242 sqlite3-shell-link-flags.1 = $(TOP)/sqlite3.c $(LDFLAGS) $(LDFLAGS.libsqlite3) | |
| 243 sqlite3-shell-link-flags.0 = $(LDFLAGS) -L. -lsqlite3 $(LDFLAGS.zlib) $(LDFLAGS.math) | |
| 244 sqlite3-shell-deps.1 = $(TOP)/sqlite3.c | |
| 245 sqlite3-shell-deps.0 = $(libsqlite3.DLL) | |
| 246 # | |
| 247 # STATIC_CLI_SHELL = 1 to statically link sqlite3$(T.exe), else | |
| 248 # 0. Requires static versions of all requisite libraries. Primarily | |
| 249 # intended for use with static-friendly environments like Alpine | |
| 250 # Linux. | |
| 251 # | |
| 252 STATIC_CLI_SHELL = @STATIC_CLI_SHELL@ | |
| 253 # | |
| 254 # sqlite3-shell-static.flags.N = N is $(STATIC_CLI_SHELL) | |
| 255 # | |
| 256 sqlite3-shell-static.flags.1 = -static | |
| 257 sqlite3-shell-static.flags.0 = | |
| 258 sqlite3$(T.exe): $(TOP)/shell.c $(sqlite3-shell-deps.$(ENABLE_STATIC_SHELL)) | |
| 259 $(CC) -o $@ \ | |
| 260 $(TOP)/shell.c $(sqlite3-shell-link-flags.$(ENABLE_STATIC_SHELL)) \ | |
| 261 $(sqlite3-shell-static.flags.$(STATIC_CLI_SHELL)) \ | |
| 262 -I. $(OPT_FEATURE_FLAGS) $(SHELL_OPT) \ | |
| 263 $(CFLAGS) $(CFLAGS.readline) $(CFLAGS.icu) \ | |
| 264 $(LDFLAGS.readline) | |
| 265 | |
| 266 sqlite3$(T.exe)-1: | |
| 267 sqlite3$(T.exe)-0: sqlite3$(T.exe) | |
| 268 all: sqlite3$(T.exe)-$(HAVE_WASI_SDK) | |
| 269 | |
| 270 install-shell-0: sqlite3$(T.exe) $(install-dir.bin) | |
| 271 $(INSTALL) sqlite3$(T.exe) "$(install-dir.bin)" | |
| 272 install-shell-1: | |
| 273 install: install-shell-$(HAVE_WASI_SDK) | |
| 274 | |
| 275 install-headers: $(TOP)/sqlite3.h $(install-dir.include) | |
| 276 $(INSTALL.noexec) $(TOP)/sqlite3.h $(TOP)/sqlite3ext.h "$(install-dir.include)" | |
| 277 install: install-headers | |
| 278 | |
| 279 install-pc: sqlite3.pc $(install-dir.pkgconfig) | |
| 280 $(INSTALL.noexec) sqlite3.pc "$(install-dir.pkgconfig)" | |
| 281 install: install-pc | |
| 282 | |
| 283 install-man1: $(TOP)/sqlite3.1 $(install-dir.man1) | |
| 284 $(INSTALL.noexec) $(TOP)/sqlite3.1 "$(install-dir.man1)" | |
| 285 install: install-man1 | |
| 286 | |
| 287 clean: | |
| 288 rm -f *.o sqlite3$(T.exe) | |
| 289 rm -f $(libsqlite3.LIB) $(libsqlite3.DLL) libsqlite3$(T.dll).a | |
| 290 | |
| 291 distclean: clean | |
| 292 rm -f jimsh0$(T.exe) config.* sqlite3.pc sqlite_cfg.h Makefile | |
| 293 | |
| 294 DIST_FILES := \ | |
| 295 README.txt VERSION \ | |
| 296 auto.def autosetup configure tea \ | |
| 297 sqlite3.h sqlite3.c shell.c sqlite3ext.h \ | |
| 298 Makefile.in Makefile.msc Makefile.fallback \ | |
| 299 sqlite3.rc sqlite3rc.h Replace.cs \ | |
| 300 sqlite3.pc.in sqlite3.1 | |
| 301 | |
| 302 # | |
| 303 # Maintenance note: dist_name must be sqlite-$(PACKAGE_VERSION) so | |
| 304 # that tool/mkautoconfamal.sh knows how to find it. | |
| 305 # | |
| 306 dist_name = sqlite-$(PACKAGE_VERSION) | |
| 307 dist_tarball = $(dist_name).tar.gz | |
| 308 dist: | |
| 309 rm -fr $(dist_name) | |
| 310 mkdir -p $(dist_name) | |
| 311 cp -rp $(DIST_FILES) $(dist_name)/. | |
| 312 tar czf $(dist_tarball) $(dist_name) | |
| 313 rm -fr $(dist_name) | |
| 314 ls -l $(dist_tarball) |