]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Move some work out of the makefiles and into awk scripts in separate files.
authordrh <drh@noemail.net>
Wed, 6 Oct 2004 15:03:57 +0000 (15:03 +0000)
committerdrh <drh@noemail.net>
Wed, 6 Oct 2004 15:03:57 +0000 (15:03 +0000)
Ticket #940. (CVS 2005)

FossilOrigin-Name: 4d0f29d54c0ccb153abd77d9b62b6461ec1e978f

Makefile.in
main.mk
manifest
manifest.uuid
mkopcodec.awk [new file with mode: 0644]
mkopcodeh.awk

index acb93b99ec3e6cd5f93e51e712cddc687246f09a..3136476bcfa340247f24c282ec1c87807125ad99 100644 (file)
@@ -286,16 +286,11 @@ pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
 opcodes.lo:    opcodes.c
        $(LTCOMPILE) -c opcodes.c
 
-opcodes.c:     opcodes.h
-       echo '/* Automatically generated file.  Do not edit */' >opcodes.c
-       echo 'char *sqlite3OpcodeNames[] = { "???", ' >>opcodes.c
-       grep OP_ opcodes.h | sort -n +2 | \
-         sed -e 's/^.*OP_/  "/' -e 's/ [ 0-9]*$$/", /' >>opcodes.c
-       echo '};' >>opcodes.c
+opcodes.c:     opcodes.h $(TOP)/mkopcodec.awk
+       sort -n +2 opcodes.h | awk -f $(TOP)/mkopcodec.awk >opcodes.c
 
 opcodes.h:     parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
-       echo '/* Automatically generated file.  Do not edit */' >opcodes.h
-       cat parse.h $(TOP)/src/vdbe.c | awk -f $(TOP)/mkopcodeh.awk >>opcodes.h
+       cat parse.h $(TOP)/src/vdbe.c | awk -f $(TOP)/mkopcodeh.awk >opcodes.h
 
 os_mac.lo:     $(TOP)/src/os_mac.c $(HDR)
        $(LTCOMPILE) $(THREADSAFE) -c $(TOP)/src/os_mac.c
diff --git a/main.mk b/main.mk
index 533fc222833f619a78b04b5d04bd4b1e8cb0dc80..e79e0926ba70078e73ae0587669db8739b48c04a 100644 (file)
--- a/main.mk
+++ b/main.mk
@@ -255,16 +255,11 @@ pager.o:  $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
 opcodes.o:     opcodes.c
        $(TCCX) -c opcodes.c
 
-opcodes.c:     opcodes.h
-       echo '/* Automatically generated file.  Do not edit */' >opcodes.c
-       echo 'char *sqlite3OpcodeNames[] = { "???", ' >>opcodes.c
-       grep OP_ opcodes.h | sort -n +2 | \
-         sed -e 's/^.*OP_/  "/' -e 's/ [ 0-9]*$$/", /' >>opcodes.c
-       echo '};' >>opcodes.c
+opcodes.c:     opcodes.h $(TOP)/mkopcodec.awk
+       sort -n +2 opcodes.h | awk -f $(TOP)/mkopcodec.awk >opcodes.c
 
 opcodes.h:     parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
-       echo '/* Automatically generated file.  Do not edit */' >opcodes.h
-       cat parse.h $(TOP)/src/vdbe.c | awk -f $(TOP)/mkopcodeh.awk >>opcodes.h
+       cat parse.h $(TOP)/src/vdbe.c | awk -f $(TOP)/mkopcodeh.awk >opcodes.h
 
 os_mac.o:      $(TOP)/src/os_mac.c $(HDR)
        $(TCCX) -c $(TOP)/src/os_mac.c
index 30746d5845bd47f25cf0afa1c3d62223b0923aee..61e6a46cc957757139c7f2a74a73346f782b021a 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,6 +1,6 @@
-C Size\soptimization\sin\sthe\sparser.\s(CVS\s2004)
-D 2004-10-06T14:39:29
-F Makefile.in 78ddc9fca09ab6e3b75a79ecf8d490e34cd0519c
+C Move\ssome\swork\sout\sof\sthe\smakefiles\sand\sinto\sawk\sscripts\sin\sseparate\sfiles.\nTicket\s#940.\s(CVS\s2005)
+D 2004-10-06T15:03:57
+F Makefile.in 52c1cc106cad9148d4b7cb387b458e82dc86b339
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
 F VERSION 0aeddfe96f008f6cbe2c7167a782f3133e118d8d
@@ -17,9 +17,10 @@ F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538
 F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac
 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895
 F ltmain.sh f6b283068efa69f06eb8aa1fe4bddfdbdeb35826
-F main.mk cabfd4a3e786840e8924689b04751a8c48dc4a42
+F main.mk bf65bb9f839aa8777796c9846816be590a7cd4b0
 F mkdll.sh 468d4f41d3ea98221371df4825cfbffbaac4d7e4
-F mkopcodeh.awk a80e53c2f41cd89b1355c2e3d9389e3f6f8e017d
+F mkopcodec.awk d9620352d5990ef671d4338cf6b21c98704c4a3b
+F mkopcodeh.awk 0e4d553956adecb750b7311d7a443cf203379b92
 F mkso.sh 7b67da1d63070875ba948e749aee9ef50ce36e3d
 F publish.sh 72bde067dda3fc2d33e92f20253b924e3b97da30
 F spec.template b2f6c4e488cbc3b993a57deba22cbc36203c4da3
@@ -250,7 +251,7 @@ F www/tclsqlite.tcl 560ecd6a916b320e59f2917317398f3d59b7cc25
 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P dcbf4817a7a3ce18a2d5ed008346933a36acd543
-R bb6840d2828634b7f251d4000a4ec78a
+P 8e2ae2449882f70fe4e77c100193c053d7669ae6
+R fe02750a1c7687399dff07e7e1f48b3a
 U drh
-Z 908fa14825ec85f62b3b4f967c9ab77f
+Z 93f242f1b58f7a18d2bf8d0d42656954
index c0d0a3496489435cde875b4bfc7922b79775b73d..8442478659a855f6f425348e164bd4c6efcb2092 100644 (file)
@@ -1 +1 @@
-8e2ae2449882f70fe4e77c100193c053d7669ae6
\ No newline at end of file
+4d0f29d54c0ccb153abd77d9b62b6461ec1e978f
\ No newline at end of file
diff --git a/mkopcodec.awk b/mkopcodec.awk
new file mode 100644 (file)
index 0000000..9e2122b
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/awk -f
+#
+# This AWK script scans the opcodes.h file (which is itself generated by
+# another awk script) and uses the information gleaned to create the
+# opcodes.c source file.
+#
+# Opcodes.c contains strings which are the symbolic names for the various
+# opcodes used by the VDBE.  These strings are used when disassembling a
+# VDBE program during tracing or as a result of the EXPLAIN keyword.
+#
+BEGIN {
+  print "/* Automatically generated.  Do not edit */"
+  print "/* See the mkopcodec.h script for details. */"
+  print "const char *sqlite3OpcodeNames[] = { \"?\","
+}
+/^#define OP_/ {
+  sub("OP_","",$2)
+  print "  \"" $2 "\","
+}
+END {
+  print "};"
+}
index 49e2498b35e06901306f549efeaa3b578a53634c..7f60e1afb1d7db79d45de5beac6b323a372dbb6b 100644 (file)
@@ -34,6 +34,8 @@
 # Assign numbers to all opcodes and output the result.
 END {
   cnt = 0
+  print "/* Automatically generated.  Do not edit */"
+  print "/* See the mkopcodeh.awk script for details */"
   for(name in op){
     if( op[name]<0 ){
       cnt++