Index: main.mk ================================================================== --- main.mk +++ main.mk @@ -24,10 +24,12 @@ # # Once the macros above are defined, the rest of this make script will # build the SQLite library and testing tools. ################################################################################ +TCLSH = tclsh.docsrc + default: @echo 'make base; # Build base documents' @echo 'make evidence; # Gather evidence marks' @echo 'make matrix; # Build the traceability matrix' @echo 'make all; # Do all of the above' @@ -39,17 +41,12 @@ private: base evidence private_evidence matrix doc fast: base doc -tclsh: $(TCLSQLITE3C) - $(CC) -g -o tclsh -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS5 -DTCLSH=1 -DSQLITE_TCLMD5 $(TCLINC) $(TCLSQLITE3C) $(TCLFLAGS) - - - -sqlite3.h: tclsh $(SRC)/src/sqlite.h.in $(SRC)/manifest.uuid $(SRC)/VERSION - ./tclsh $(SRC)/tool/mksqlite3h.tcl $(SRC) | \ +sqlite3.h: $(TCLSH) $(SRC)/src/sqlite.h.in $(SRC)/manifest.uuid $(SRC)/VERSION + ./$(TCLSH) $(SRC)/tool/mksqlite3h.tcl $(SRC) | \ sed 's/^SQLITE_API //' >sqlite3.h # Generate the directory into which generated documentation files will # be written. # @@ -60,17 +57,17 @@ # special markup on HTML files used to identify testable statements and # requirements are retained in the HTML and so the HTML generated by # this rule is not suitable for publication. This is the first step # only. # -base: tclsh sqlite3.h docdir always parsehtml.so +base: $(TCLSH) sqlite3.h docdir always rm -rf doc/images cp -r $(DOC)/images doc mkdir doc/images/syntax cp $(DOC)/art/syntax/*.gif doc/images/syntax cp $(DOC)/rawpages/* doc - ./tclsh $(DOC)/wrap.tcl $(DOC) $(SRC) doc $(DOC)/pages/*.in + ./$(TCLSH) $(DOC)/wrap.tcl $(DOC) $(SRC) doc $(DOC)/pages/*.in cp doc/fileformat2.html doc/fileformat.html # Strip the special markup in HTML files that identifies testable statements # and requirements. # @@ -82,12 +79,12 @@ spell: $(DOC)/spell_chk.sh $(DOC)/custom.txt sh $(DOC)/spell_chk.sh doc '*.html' $(DOC)/custom.txt # Construct the database schema. # -schema: tclsh - ./tclsh $(DOC)/schema.tcl +schema: $(TCLSH) + ./$(TCLSH) $(DOC)/schema.tcl # The following rule scans sqlite3.c source text, the text of the TCL # test cases, and (optionally) the TH3 test case sources looking for # comments that identify assertions and test cases that provide evidence # that SQLite behaves as it says it does. See the comments in @@ -95,51 +92,51 @@ # # The output file evidence.txt is used by requirements coverage analysis. # SCANNER = $(DOC)/scan_test_cases.tcl -evidence: tclsh - ./tclsh $(SCANNER) -reset src $(SRC)/src/*.[chy] - ./tclsh $(SCANNER) src $(SRC)/ext/fts3/*.[ch] - ./tclsh $(SCANNER) src $(SRC)/ext/rtree/*.[ch] - ./tclsh $(SCANNER) tcl $(SRC)/test/*.test +evidence: $(TCLSH) + ./$(TCLSH) $(SCANNER) -reset src $(SRC)/src/*.[chy] + ./$(TCLSH) $(SCANNER) src $(SRC)/ext/fts3/*.[ch] + ./$(TCLSH) $(SCANNER) src $(SRC)/ext/rtree/*.[ch] + ./$(TCLSH) $(SCANNER) tcl $(SRC)/test/*.test if test '' != '$(TH3)'; then \ - ./tclsh $(SCANNER) th3 $(TH3)/mkth3.tcl; \ - ./tclsh $(SCANNER) th3 $(TH3)/base/*.c; \ - ./tclsh $(SCANNER) th3/req1 $(TH3)/req1/*.test; \ - ./tclsh $(SCANNER) th3/cov1 $(TH3)/cov1/*.test; \ - ./tclsh $(SCANNER) th3/stress $(TH3)/stress/*.test; \ + ./$(TCLSH) $(SCANNER) th3 $(TH3)/mkth3.tcl; \ + ./$(TCLSH) $(SCANNER) th3 $(TH3)/base/*.c; \ + ./$(TCLSH) $(SCANNER) th3/req1 $(TH3)/req1/*.test; \ + ./$(TCLSH) $(SCANNER) th3/cov1 $(TH3)/cov1/*.test; \ + ./$(TCLSH) $(SCANNER) th3/stress $(TH3)/stress/*.test; \ fi if test '' != '$(SLT)'; then \ - ./tclsh $(SCANNER) slt $(SLT)/test/evidence/*.test; \ + ./$(TCLSH) $(SCANNER) slt $(SLT)/test/evidence/*.test; \ fi # Copy and HTMLize evidence files # FMT = $(DOC)/format_evidence.tcl -format_evidence: tclsh +format_evidence: $(TCLSH) rm -fr doc/matrix/ev/* - ./tclsh $(FMT) src doc/matrix $(SRC)/src/*.[chy] - ./tclsh $(FMT) src doc/matrix $(SRC)/ext/fts3/*.[ch] - ./tclsh $(FMT) src doc/matrix $(SRC)/ext/rtree/*.[ch] - ./tclsh $(FMT) tcl doc/matrix $(SRC)/test/*.test + ./$(TCLSH) $(FMT) src doc/matrix $(SRC)/src/*.[chy] + ./$(TCLSH) $(FMT) src doc/matrix $(SRC)/ext/fts3/*.[ch] + ./$(TCLSH) $(FMT) src doc/matrix $(SRC)/ext/rtree/*.[ch] + ./$(TCLSH) $(FMT) tcl doc/matrix $(SRC)/test/*.test if test '' != '$(SLT)'; then \ - ./tclsh $(FMT) slt doc/matrix $(SLT)/test/evidence/*.test; \ + ./$(TCLSH) $(FMT) slt doc/matrix $(SLT)/test/evidence/*.test; \ fi private_evidence: format_evidence - ./tclsh $(FMT) th3 doc/matrix $(TH3)/mkth3.tcl - ./tclsh $(FMT) th3/req1 doc/matrix $(TH3)/req1/*.test - ./tclsh $(FMT) th3/cov1 doc/matrix $(TH3)/cov1/*.test + ./$(TCLSH) $(FMT) th3 doc/matrix $(TH3)/mkth3.tcl + ./$(TCLSH) $(FMT) th3/req1 doc/matrix $(TH3)/req1/*.test + ./$(TCLSH) $(FMT) th3/cov1 doc/matrix $(TH3)/cov1/*.test # Generate the traceability matrix # matrix: rm -rf doc/matrix/images cp -r doc/images doc/matrix - ./tclsh $(DOC)/matrix.tcl + ./$(TCLSH) $(DOC)/matrix.tcl #------------------------------------------------------------------------- # Source files for the [tclsqlite3.search] executable. @@ -149,20 +146,20 @@ $(DOC)/search/fts5ext.c \ $(TCLSQLITE3C) # Flags to build [tclsqlite3.search] with. # -SFLAGS = -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_FTS5 +SFLAGS = $(TCLINC) -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_FTS5 -DSQLITE_TCLMD5 -DTCLSH -Dmain=xmain -tclsqlite3.search: $(SSRC) - $(CC) -static -O2 -o $@ -I. $(SFLAGS) $(SSRC) $(STATICTCLFLAGS) +$(TCLSH): $(SSRC) + $(CC) -O2 -o $@ -I. $(SFLAGS) $(SSRC) $(TCLFLAGS) -searchdb: tclsqlite3.search - ./tclsqlite3.search $(DOC)/search/buildsearchdb.tcl +searchdb: $(TCLSH) + ./$(TCLSH) $(DOC)/search/buildsearchdb.tcl cp $(DOC)/document_header.tcl doc/document_header.tcl cp $(DOC)/search/search.tcl doc/search chmod +x doc/search always: clean: - rm -rf tclsh doc sqlite3.h + rm -rf $(TCLSH) doc sqlite3.h Index: search/search.tcl ================================================================== --- search/search.tcl +++ search/search.tcl @@ -1,6 +1,6 @@ -#!/usr/bin/tclsqlite3.search +#!/usr/bin/tclsh.docsrc source [file dirname [info script]]/document_header.tcl # Decode an HTTP %-encoded string # Index: search/searchc.c ================================================================== --- search/searchc.c +++ search/searchc.c @@ -4,10 +4,14 @@ #include int Sqlite3_Init(Tcl_Interp*); int Parsehtml_Init(Tcl_Interp*); int Fts5ext_Init(Tcl_Interp*); + +#ifdef SQLITE_TCLMD5 +int Md5_Init(Tcl_Interp*); +#endif static int AppInit(Tcl_Interp *interp) { int rc; rc = Sqlite3_Init(interp); if( rc!=TCL_OK ) return rc; @@ -15,14 +19,23 @@ rc = Parsehtml_Init(interp); if( rc!=TCL_OK ) return rc; rc = Fts5ext_Init(interp); if( rc!=TCL_OK ) return rc; + +#ifdef SQLITE_TCLMD5 + rc = Md5_Init(interp); + if( rc!=TCL_OK ) return rc; +#endif return TCL_OK; } + +#ifdef main +# undef main +#endif int main(int argc, char *argv[]) { Tcl_Main(argc, argv, AppInit); return 0; }