From: drh Date: Sat, 23 Jan 2016 19:47:00 +0000 (+0000) Subject: Improved comments on the transformation script and on the generated Makefile. X-Git-Tag: version-3.11.0~92^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06cee48728424701260e2f3215ad75c257bace44;p=thirdparty%2Fsqlite.git Improved comments on the transformation script and on the generated Makefile. FossilOrigin-Name: c6e633ab73812fe38f3e969f1652f1b5759096e4 --- diff --git a/Makefile.min.msc b/Makefile.min.msc index 2ec986fa4b..e2187efad3 100644 --- a/Makefile.min.msc +++ b/Makefile.min.msc @@ -1,3 +1,9 @@ +#### DO NOT EDIT #### +# This makefile is automatically generated from the Makefile.msc at +# the root of the canonical SQLite source tree using the +# tool/mkmsvcmin.tcl script. +# + # # nmake Makefile for SQLite # diff --git a/manifest b/manifest index d24047ded1..504f2ebbaf 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -C Use\sthe\s-integer\soption\swhen\ssorting\slist\selements. -D 2016-01-23T19:24:19.182 +C Improved\scomments\son\sthe\stransformation\sscript\sand\son\sthe\sgenerated\sMakefile. +D 2016-01-23T19:47:00.459 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 -F Makefile.min.msc c805e4a474fc7610d4f0cd0b6a9f56334a14c6ad +F Makefile.min.msc cbbc5e37bfe74583cce7c2585319620b7516e6ed F Makefile.msc 6fca5455aaecbd14479f33f091aa19df2d3d2969 F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7 F VERSION 866588d1edf0ccb5b0d33896974338f97564f719 @@ -1379,7 +1379,7 @@ F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862 F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/mkautoconfamal.sh 5a5441280b509d2bb3bdc71bfb63781b0d570373 F tool/mkkeywordhash.c 06ec0b78bd4fa68c12d90ef2bdfe76b039133ff8 -F tool/mkmsvcmin.tcl a0217f49042ec8160ff8665db638e9b5edc17964 +F tool/mkmsvcmin.tcl a62d398d1304b36dd41b69e655d875728fd9d509 F tool/mkopcodec.tcl edde8adc42621b5e598127f8cdc6d52cfe21f52b F tool/mkopcodeh.tcl e04177031532b7aa9379ded50e820231ac4abd6e F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e @@ -1421,7 +1421,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c46f1a13cb00264d1164399059250884c7be4ea0 -R ce47a7131ea57ef586dba1d328c21253 -U mistachkin -Z c9f6cfce5ff80db91258ef2b40e34be6 +P 949aa614e1401f6ab61cbb2e0469c60d764e6880 +R 52e20c37d886e0ca572199fede1eb984 +U drh +Z 5f79d302a18d7c201b23ed73e75ff6ef diff --git a/manifest.uuid b/manifest.uuid index 0c60eb81fc..876d304c70 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -949aa614e1401f6ab61cbb2e0469c60d764e6880 \ No newline at end of file +c6e633ab73812fe38f3e969f1652f1b5759096e4 \ No newline at end of file diff --git a/tool/mkmsvcmin.tcl b/tool/mkmsvcmin.tcl index 188b73a18e..7414f53000 100644 --- a/tool/mkmsvcmin.tcl +++ b/tool/mkmsvcmin.tcl @@ -1,22 +1,26 @@ #!/usr/bin/tcl # -# Removes and/or replaces specially marked sections from the Makefile -# for MSVC, writing the resulting output to another (different) file. -# In addition, some other strings are also removed and/or replaced if -# they are present in the Makefile. -# -set fromFileName [lindex $argv 0] - -if {![file exists $fromFileName]} then { - error "input file \"$fromFileName\" does not exist" +# This script reads the regular MSVC makefile (../Makefile.msc) and outputs +# a revised version of that Makefile that is "minimal" in the sense that +# it uses the sqlite3.c amalgamation as input and does not require tclsh. +# The resulting "../Makefile.min.msc" is suitable for use in the amalgamation +# tarballs. +# +if {$argc==0} { + set basedir [file dir [file dir [file normalize $argv0]]] + set fromFileName [file join $basedir Makefile.msc] + set toFileName [file join $basedir Makefile.min.msc] +} else { + set fromFileName [lindex $argv 0] + if {![file exists $fromFileName]} then { + error "input file \"$fromFileName\" does not exist" + } + set toFileName [lindex $argv 1] + if {[file exists $toFileName]} then { + error "output file \"$toFileName\" already exists" + } } - -set toFileName [lindex $argv 1] -if {[file exists $toFileName]} then { - error "output file \"$toFileName\" already exists" -} - proc readFile { fileName } { set file_id [open $fileName RDONLY] fconfigure $file_id -encoding binary -translation binary @@ -24,7 +28,7 @@ proc readFile { fileName } { close $file_id return $result } - + proc writeFile { fileName data } { set file_id [open $fileName {WRONLY CREAT TRUNC}] fconfigure $file_id -encoding binary -translation binary @@ -32,17 +36,17 @@ proc writeFile { fileName data } { close $file_id return "" } - + proc escapeSubSpec { data } { regsub -all -- {&} $data {\\\&} data regsub -all -- {\\(\d+)} $data {\\\\\1} data return $data } - + proc substVars { data } { return [uplevel 1 [list subst -nocommands -nobackslashes $data]] } - + # # NOTE: This block is used to replace the section marked <> in # the Makefile, if it exists. @@ -67,8 +71,13 @@ $(LIBRESOBJS): $(TOP)\sqlite3.rc rcver.vc $(SQLITE3H) echo #endif >> sqlite3rc.h $(LTRCOMPILE) -fo $(LIBRESOBJS) -DRC_VERONLY $(TOP)\sqlite3.rc }]] - -set data [readFile $fromFileName] + +set data "#### DO NOT EDIT ####\n" +append data "# This makefile is automatically " +append data "generated from the [file tail $fromFileName] at\n" +append data "# the root of the canonical SQLite source tree using the\n" +append data "# tool/[file tail $argv0] script.\n#\n\n" +append data [readFile $fromFileName] regsub -all -- {# <>\n.*?# <>\n} \ $data "" data