Simplify how the targets which may or may not be enabled, depending on config flags, are formulated in main.mk.

FossilOrigin-Name: 7bea793ce46ab5c41b242c5e69b4f9bd8536a9b106e8c39f7ac002451d5db6ea
This commit is contained in:
stephan
2024-10-21 20:12:03 +00:00
parent 5bae363b99
commit ad8e79ce53
4 changed files with 41 additions and 33 deletions
+1 -4
View File
@@ -94,9 +94,6 @@ CFLAGS_READLINE = -DHAVE_READLINE=@HAVE_READLINE@ @CFLAGS_READLINE@
ENABLE_SHARED = @ENABLE_SHARED@
HAVE_WASI_SDK = @HAVE_WASI_SDK@
# TCCX is $(TCC) plus any flags which are desired for the library
# as a whole, but not necessarily needed for every binary.
#
TCCX = $(TCC) @TARGET_DEBUG@
# Define this for the autoconf-based build, so that the code knows it
# can include the generated sqlite_cfg.h.
@@ -261,7 +258,7 @@ Makefile: $(TOP)/Makefile.in $(AS_AUTO_DEF)
sqlite3.pc: $(TOP)/sqlite3.pc.in $(AS_AUTO_DEF)
$(AS_AUTOREMAKE)
@touch $@
install: install-pc
install: install-pc # defined in main.mk
sqlite_cfg.h: $(TOP)/sqlite_cfg.h.in $(AS_AUTO_DEF)
$(AS_AUTOREMAKE)
+32 -21
View File
@@ -137,12 +137,6 @@ USE_AMALGAMATION ?= 1
# Optional flags for the amalgamation generator.
AMALGAMATION_GEN_FLAGS ?= --linemacros=0
#
# $(HAVE_WASI_SDK) =
#
# 1 when building with the WASI SDK. This disables certain build
# targets.
HAVE_WASI_SDK ?= 0
#
# $(OPT_FEATURE_FLAGS) =
#
# Preprocessor flags for enabling and disabling specific libsqlite3
@@ -156,6 +150,12 @@ HAVE_WASI_SDK ?= 0
# when compiling the amalgamation, may or may not work.
OPT_FEATURE_FLAGS ?=
#
# $(SHELL_OPT) =
#
# CFLAGS specific to the sqlite3 CLI shell app and its close cousins.
#
SHELL_OPT ?=
#
# The following TCL_vars come from tclConfig.sh
#
# Potential TODO: a shell script, similar tool/tclConfigShToTcl.sh,
@@ -171,6 +171,12 @@ TCLLIBDIR ?=
# libsqlite3, and will usually differ from $(LDFLAGS_RPATH).
TCLLIB_RPATH ?=
#
# $(HAVE_WASI_SDK) =
#
# 1 when building with the WASI SDK. This disables certain build
# targets.
HAVE_WASI_SDK ?= 0
#
# ... and many, many more. Sane defaults are selected where possible.
#
# With the above-described defined, the rest of this make script will
@@ -1114,6 +1120,13 @@ mkkeywordhash$(BEXE): $(TOP)/tool/mkkeywordhash.c
keywordhash.h: mkkeywordhash$(BEXE)
./mkkeywordhash$(BEXE) > $@
#
# sqlite3.c split into many smaller files.
#
sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl $(BTCLSH) # has_tclsh84
$(BTCLSH) $(TOP)/tool/split-sqlite3c.tcl
#
# Static libsqlite3
#
$(libsqlite3.LIB): $(LIBOBJ)
@@ -1121,18 +1134,16 @@ $(libsqlite3.LIB): $(LIBOBJ)
lib: $(libsqlite3.LIB)
all: lib
#
# Dynamic libsqlite3
#
$(libsqlite3.SO): $(LIBOBJ)
$(TLINK_shared) -o $@ $(LIBOBJ) $(LDFLAGS_libsqlite3)
target_libsqlite3_so_1 = $(libsqlite3.SO)
target_libsqlite3_so = $(target_libsqlite3_so_$(ENABLE_SHARED))
so: $(target_libsqlite3_so)
$(libsqlite3.SO)-1: $(libsqlite3.SO)
$(libsqlite3.SO)-0 $(libsqlite3.SO)-:
so: $(libsqlite3.SO)-$(ENABLE_SHARED)
all: so
sqlite3-all.c: sqlite3.c $(TOP)/tool/split-sqlite3c.tcl $(BTCLSH) # has_tclsh84
$(BTCLSH) $(TOP)/tool/split-sqlite3c.tcl
#
# Install the $(libsqlite3.SO) as $(libsqlite3.SO).$(RELEASE) and
# create symlinks which point to it. Do we really need all of this
@@ -1175,17 +1186,17 @@ install: install-includes
pkgIndex.tcl:
echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
libtclsqlite3.SO = libtclsqlite3$(TDLL)
target_libtclsqlite3_1 = $(libtclsqlite3.SO)
target_libtclsqlite3 = $(target_libtclsqlite3_$(HAVE_TCL))
$(libtclsqlite3.SO): tclsqlite.o $(libsqlite3.LIB)
$(TLINK_shared) -o $@ tclsqlite.o \
$(TCL_INCLUDE_SPEC) $(TCL_STUB_LIB_SPEC) $(LDFLAGS_libsqlite3) \
$(libsqlite3.LIB) $(TCLLIB_RPATH)
libtcl: $(target_libtclsqlite3)
all: libtcl
$(libtclsqlite3.SO)-1: $(libtclsqlite3.SO)
$(libtclsqlite3.SO)-0 $(libtclsqlite3.SO)-:
libtcl: $(libtclsqlite3.SO)-$(HAVE_TCL)
all: libtcl
install.tcldir = $(DESTDIR)$(TCLLIBDIR)
install-tcl-1: install-lib $(target_libtclsqlite3) pkgIndex.tcl
install-tcl-1: install-lib $(libtclsqlite3.SO) pkgIndex.tcl
@if [ "x$(DESTDIR)" = "x$(install.tcldir)" ]; then echo "TCLLIBDIR is not set." 1>&2; exit 1; fi
$(INSTALL) -d $(install.tcldir)
$(INSTALL) $(libtclsqlite3.SO) $(install.tcldir)
@@ -1557,16 +1568,16 @@ threadtest5: sqlite3.c $(TOP)/test/threadtest5.c
$(TLINK) $(TOP)/test/threadtest5.c sqlite3.c -o $@ $(LDFLAGS_libsqlite3)
sqlite3$(TEXE): shell.c sqlite3.c
$(TCCX) $(CFLAGS_READLINE) $(SHELL_OPT) -o $@ \
$(TLINK) $(CFLAGS_READLINE) $(SHELL_OPT) -o $@ \
shell.c sqlite3.c \
$(LDFLAGS_libsqlite3) $(LDFLAGS_READLINE)
#
# Build sqlite3$(TEXE) by default except in wasi-sdk builds. Yes, the
# semantics of 0 and 1 are confusingly swapped here.
#
target_sqlite3_shell_1 =
target_sqlite3_shell_0 = sqlite3$(TEXE)
all: $(target_sqlite3_shell_$(HAVE_WASI_SDK))
sqlite3$(TEXE)-1:
sqlite3$(TEXE)-0 sqlite3$(TEXE)-: sqlite3$(TEXE)
all: sqlite3$(TEXE)-$(HAVE_WASI_SDK)
install-shell-0: sqlite3$(TEXT) $(install-dir.bin)
$(INSTALL) -s sqlite3$(TEXT) $(install-dir.bin)
+7 -7
View File
@@ -1,9 +1,9 @@
C More\sbuild\sdoc\stweaks\sand\sget\s./startup\sbuilding.
D 2024-10-21T19:51:32.121
C Simplify\show\sthe\stargets\swhich\smay\sor\smay\snot\sbe\senabled,\sdepending\son\sconfig\sflags,\sare\sformulated\sin\smain.mk.
D 2024-10-21T20:12:03.749
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F Makefile.in cc4a99cf1a47782713206d07ab1ddd18b21e2ba44406696bed649523561f97e5
F Makefile.in fe28490b3f7a785623b7ad6852c2b2069ee685d6dcf654730829827db65d66d1
F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
F Makefile.msc 58b69eda1faad5d475092b8aeffab9156ee4901a82db089b166607f2ec907ee4
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
@@ -711,7 +711,7 @@ F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b5
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
F main.mk 24bd22f0842104f6087eba735c346b232547b83200fd00a0af376c0a38cad554
F main.mk ca16a0ccaeefd27b882f5d9dbf7d21d94c0ecd3334f6012e6cc14fbc967dea37
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
@@ -2240,8 +2240,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 5b154e08ab5e8a8fd1ac1b28debd46824ef55b533a60ca5711c55b5a59a871cd
R a48807d1193f2982a4a8c8a20649c7aa
P cee285029c7225a2457062eb2b4ea7c6a17a3a5ba5fb776ebbb4ea8be62b9fff
R 711c4e9e2bfbd6aa9dec039b634bf530
U stephan
Z 65a54bc5359adb6f88f5fee08eab16c3
Z a23261a16f21cdb759a93ef73201f9de
# Remove this line to create a well-formed Fossil manifest.
+1 -1
View File
@@ -1 +1 @@
cee285029c7225a2457062eb2b4ea7c6a17a3a5ba5fb776ebbb4ea8be62b9fff
7bea793ce46ab5c41b242c5e69b4f9bd8536a9b106e8c39f7ac002451d5db6ea