/ Check-in [a117005f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a few more issues with the nmake makefile.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a117005f502482c4529661616cbb26eee1fe75d1
User & Date: shaneh 2011-06-17 15:57:07
Context
2011-06-17
16:04
Add a missing declaration to fts3Int.h. check-in: 3bfd4466 user: dan tags: trunk
15:57
Fix a few more issues with the nmake makefile. check-in: a117005f user: shaneh tags: trunk
15:55
Update walro.test script for Windows. check-in: d6443f8e user: shaneh tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to Makefile.msc.

2
3
4
5
6
7
8




9
10
11
12
13
14
15
16
17
18
19









20
21
22
23
24
25
26
..
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
...
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
...
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
...
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
...
710
711
712
713
714
715
716

717
718
719
720
721
722
723
724
725
...
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
...
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
# nmake Makefile for SQLITE
#

# The toplevel directory of the source tree.  This is the directory
# that contains this "Makefile.msc".
#
TOP = .





# C Compiler and options for use in building executables that
# will run on the platform that is doing the build.
#
BCC = cl.exe -O2

# C Compile and options for use in building executables that 
# will run on the target platform.  (BCC and TCC are usually the
# same unless your are cross-compiling.)
#
TCC = cl.exe -W3 -O2 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -I$(TOP)\ext\rtree










# Define -DNDEBUG to compile without debugging (i.e., for production usage)
# Omitting the define will cause extra debugging code to be inserted and
# includes extra comments when "EXPLAIN stmt" is used.
#
TCC = $(TCC) -DNDEBUG

................................................................................

# Flags controlling use of the in memory btree implementation
#
# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
# default to file, 2 to default to memory, and 3 to force temporary
# tables to always be in memory.
#
TEMP_STORE = -DSQLITE_TEMP_STORE=1

# Enable/disable loadable extensions, and other optional features
# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).  
# The same set of OMIT and ENABLE flags should be passed to the 
# LEMON parser generator and the mkkeywordhash tool as well.

# BEGIN standard options
................................................................................

# nawk compatible awk.
NAWK = .\gawk.exe

# You should not have to change anything below this line
###############################################################################

USE_AMALGAMATION = 1

# Object files for the SQLite library (non-amalgamation).
#
LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
         backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
         callback.lo complete.lo ctime.lo date.lo delete.lo \
         expr.lo fault.lo fkey.lo \
         fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo fts3_porter.lo \
................................................................................
#
all:	sqlite3.h libsqlite3.lib sqlite3.exe libtclsqlite3.lib

libsqlite3.lib:	$(LIBOBJ)
	$(LTLIB) -OUT:$@ $(LIBOBJ) $(TLIBS)

libtclsqlite3.lib:	tclsqlite.lo libsqlite3.lib
	$(LTLIB) /LIBPATH:$(TCLLIBDIR) -OUT:$@ $** $(LIBTCL:tcl=tclstub) $(TLIBS)

sqlite3.exe:	$(TOP)\src\shell.c libsqlite3.lib sqlite3.h
	$(LTLINK) $(READLINE_FLAGS) \
		$(TOP)\src\shell.c libsqlite3.lib \
		$(LIBREADLINE) $(TLIBS)

# This target creates a directory named "tsrc" and fills it with
................................................................................

sqlite3.c:	.target_source $(TOP)\tool\mksqlite3c.tcl
	$(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl

# Rule to build the amalgamation
#
sqlite3.lo:	sqlite3.c
	$(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c

# Rules to build the LEMON compiler generator
#
lempar.c:	$(TOP)\src\lempar.c
	copy $(TOP)\src\lempar.c .

lemon.exe:	$(TOP)\tool\lemon.c lempar.c
................................................................................
# Rules to build individual *.lo files from generated *.c files. This
# applies to:
#
#     parse.lo
#     opcodes.lo
#
parse.lo:	parse.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c parse.c

opcodes.lo:	opcodes.c
	$(LTCOMPILE) $(TEMP_STORE) -c opcodes.c

# Rules to build individual *.lo files from files in the src directory.
#
alter.lo:	$(TOP)\src\alter.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\alter.c

analyze.lo:	$(TOP)\src\analyze.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\analyze.c

attach.lo:	$(TOP)\src\attach.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\attach.c

auth.lo:	$(TOP)\src\auth.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\auth.c

backup.lo:	$(TOP)\src\backup.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\backup.c

bitvec.lo:	$(TOP)\src\bitvec.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\bitvec.c

btmutex.lo:	$(TOP)\src\btmutex.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\btmutex.c

btree.lo:	$(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\btree.c

build.lo:	$(TOP)\src\build.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\build.c

callback.lo:	$(TOP)\src\callback.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\callback.c

complete.lo:	$(TOP)\src\complete.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\complete.c

ctime.lo:	$(TOP)\src\ctime.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\ctime.c

date.lo:	$(TOP)\src\date.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\date.c

delete.lo:	$(TOP)\src\delete.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\delete.c

expr.lo:	$(TOP)\src\expr.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\expr.c

fault.lo:	$(TOP)\src\fault.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\fault.c

fkey.lo:	$(TOP)\src\fkey.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\fkey.c

func.lo:	$(TOP)\src\func.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\func.c

global.lo:	$(TOP)\src\global.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\global.c

hash.lo:	$(TOP)\src\hash.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\hash.c

insert.lo:	$(TOP)\src\insert.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\insert.c

journal.lo:	$(TOP)\src\journal.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\journal.c

legacy.lo:	$(TOP)\src\legacy.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\legacy.c

loadext.lo:	$(TOP)\src\loadext.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\loadext.c

main.lo:	$(TOP)\src\main.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\main.c

malloc.lo:	$(TOP)\src\malloc.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\malloc.c

mem0.lo:	$(TOP)\src\mem0.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mem0.c

mem1.lo:	$(TOP)\src\mem1.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mem1.c

mem2.lo:	$(TOP)\src\mem2.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mem2.c

mem3.lo:	$(TOP)\src\mem3.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mem3.c

mem5.lo:	$(TOP)\src\mem5.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mem5.c

memjournal.lo:	$(TOP)\src\memjournal.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\memjournal.c

mutex.lo:	$(TOP)\src\mutex.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mutex.c

mutex_noop.lo:	$(TOP)\src\mutex_noop.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mutex_noop.c

mutex_os2.lo:	$(TOP)\src\mutex_os2.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mutex_os2.c

mutex_unix.lo:	$(TOP)\src\mutex_unix.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mutex_unix.c

mutex_w32.lo:	$(TOP)\src\mutex_w32.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\mutex_w32.c

notify.lo:	$(TOP)\src\notify.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\notify.c

pager.lo:	$(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\pager.c

pcache.lo:	$(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\pcache.c

pcache1.lo:	$(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\pcache1.c

os.lo:	$(TOP)\src\os.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\os.c

os_unix.lo:	$(TOP)\src\os_unix.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\os_unix.c

os_win.lo:	$(TOP)\src\os_win.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\os_win.c

os_os2.lo:	$(TOP)\src\os_os2.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\os_os2.c

pragma.lo:	$(TOP)\src\pragma.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\pragma.c

prepare.lo:	$(TOP)\src\prepare.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\prepare.c

printf.lo:	$(TOP)\src\printf.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\printf.c

random.lo:	$(TOP)\src\random.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\random.c

resolve.lo:	$(TOP)\src\resolve.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\resolve.c

rowset.lo:	$(TOP)\src\rowset.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\rowset.c

select.lo:	$(TOP)\src\select.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\select.c

status.lo:	$(TOP)\src\status.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\status.c

table.lo:	$(TOP)\src\table.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\table.c

tokenize.lo:	$(TOP)\src\tokenize.c keywordhash.h $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\tokenize.c

trigger.lo:	$(TOP)\src\trigger.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\trigger.c

update.lo:	$(TOP)\src\update.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\update.c

utf.lo:	$(TOP)\src\utf.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\utf.c

util.lo:	$(TOP)\src\util.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\util.c

vacuum.lo:	$(TOP)\src\vacuum.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\vacuum.c

vdbe.lo:	$(TOP)\src\vdbe.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\vdbe.c

vdbeapi.lo:	$(TOP)\src\vdbeapi.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\vdbeapi.c

vdbeaux.lo:	$(TOP)\src\vdbeaux.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\vdbeaux.c

vdbeblob.lo:	$(TOP)\src\vdbeblob.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\vdbeblob.c

vdbemem.lo:	$(TOP)\src\vdbemem.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\vdbemem.c

vdbetrace.lo:	$(TOP)\src\vdbetrace.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\vdbetrace.c

vtab.lo:	$(TOP)\src\vtab.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\vtab.c

wal.lo:	$(TOP)\src\wal.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\wal.c

walker.lo:	$(TOP)\src\walker.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\walker.c

where.lo:	$(TOP)\src\where.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)\src\where.c

tclsqlite.lo:	$(TOP)\src\tclsqlite.c $(HDR)
	$(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c

tclsqlite-shell.lo:	$(TOP)\src\tclsqlite.c $(HDR)
	$(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c

................................................................................
	type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk >opcodes.h

# Rules to build parse.c and parse.h - the outputs of lemon.
#
parse.h:	parse.c

parse.c:	$(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk

	copy $(TOP)\src\parse.y .
	del /Q parse.h
	.\lemon.exe $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
	move parse.h parse.h.temp
	$(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp >parse.h

sqlite3.h:	$(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
	$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP) >sqlite3.h

................................................................................
!IF $(USE_AMALGAMATION)==0
TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
!ELSE
TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
!ENDIF

testfixture.exe:	$(TESTFIXTURE_SRC)
	$(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
		-DBUILD_sqlite -I$(TCLINCDIR) \
		$(TESTFIXTURE_SRC) /link /LIBPATH:$(TCLLIBDIR) $(LIBTCL) $(TLIBS)

fulltest:	testfixture.exe sqlite3.exe
	.\testfixture.exe $(TOP)\test\all.test

soaktest:	testfixture.exe sqlite3.exe
................................................................................

spaceanal_tcl.h:	$(TOP)\tool\spaceanal.tcl
	$(NAWK) "/^[^#]/ { gsub(/\\/,\"\\\\\\\\\");gsub(/\\\"/,\"\\\\\\\"\");gsub(/^/,\"\\\"\");gsub(/$$/,\"\\n\\\"\");print }" \
		$(TOP)\tool\spaceanal.tcl >spaceanal_tcl.h

sqlite3_analyzer.exe:	$(TESTFIXTURE_SRC) spaceanal_tcl.h
	$(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
		-DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE $(TEMP_STORE) \
		-DBUILD_sqlite -I$(TCLINCDIR) \
		$(TESTFIXTURE_SRC) /link /LIBPATH:$(TCLLIBDIR) $(LIBTCL) $(TLIBS)

clean:	
	del /Q *.lo *.lib *.obj sqlite3.exe libsqlite3.lib
	del /Q sqlite3.h opcodes.c opcodes.h
	del /Q lemon.exe lempar.c parse.*
	del /Q mkkeywordhash.exe keywordhash.h
	-rmdir /Q/S tsrc
	del /Q .target_source
	del /Q testfixture.exe test.db
	del /Q sqlite3.dll sqlite3.lib sqlite3.def
	del /Q sqlite3.c
	del /Q sqlite3_analyzer.exe spaceanal_tcl.h

#
# Windows section
#
dll: sqlite3.dll

sqlite3.def: $(LIBOBJ)
	echo 'EXPORTS' >sqlite3.def
	dumpbin /symbols $(LIBOBJ) \
		| $(NAWK) "/SECT.*_sqlite3_/ { sub(/^.* _/,\"\");print }" \
		| sort >>sqlite3.def

sqlite3.dll: $(LIBOBJ) sqlite3.def
	$(TCC) -LD -Fo$@ /DEF:sqlite3.def $(LIBOBJ)







>
>
>
>










|
>
>
>
>
>
>
>
>
>







 







|







 







<
<







 







|







 







|







 







|


|




|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|


|







 







>

<







 







|







 







|











|








|
|
|
|



|
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
...
110
111
112
113
114
115
116


117
118
119
120
121
122
123
...
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
...
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
...
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
...
721
722
723
724
725
726
727
728
729

730
731
732
733
734
735
736
...
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
...
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
# nmake Makefile for SQLITE
#

# The toplevel directory of the source tree.  This is the directory
# that contains this "Makefile.msc".
#
TOP = .

# Set this non-0 to create and use the SQLite amalgamation file.
#
USE_AMALGAMATION = 1

# C Compiler and options for use in building executables that
# will run on the platform that is doing the build.
#
BCC = cl.exe -O2

# C Compile and options for use in building executables that
# will run on the target platform.  (BCC and TCC are usually the
# same unless your are cross-compiling.)
#
TCC = cl.exe -W3 -O2 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src

# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in 
# any extension header files by default.  For non-amalgamation
# builds, we need to make sure the compiler can find these.
#
!IF $(USE_AMALGAMATION)==0
TCC = $(TCC) -I$(TOP)\ext\fts3
TCC = $(TCC) -I$(TOP)\ext\rtree
!ENDIF

# Define -DNDEBUG to compile without debugging (i.e., for production usage)
# Omitting the define will cause extra debugging code to be inserted and
# includes extra comments when "EXPLAIN stmt" is used.
#
TCC = $(TCC) -DNDEBUG

................................................................................

# Flags controlling use of the in memory btree implementation
#
# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
# default to file, 2 to default to memory, and 3 to force temporary
# tables to always be in memory.
#
TCC = $(TCC) -DSQLITE_TEMP_STORE=1

# Enable/disable loadable extensions, and other optional features
# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
# The same set of OMIT and ENABLE flags should be passed to the
# LEMON parser generator and the mkkeywordhash tool as well.

# BEGIN standard options
................................................................................

# nawk compatible awk.
NAWK = .\gawk.exe

# You should not have to change anything below this line
###############################################################################



# Object files for the SQLite library (non-amalgamation).
#
LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
         backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
         callback.lo complete.lo ctime.lo date.lo delete.lo \
         expr.lo fault.lo fkey.lo \
         fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo fts3_porter.lo \
................................................................................
#
all:	sqlite3.h libsqlite3.lib sqlite3.exe libtclsqlite3.lib

libsqlite3.lib:	$(LIBOBJ)
	$(LTLIB) -OUT:$@ $(LIBOBJ) $(TLIBS)

libtclsqlite3.lib:	tclsqlite.lo libsqlite3.lib
	$(LTLIB) /LIBPATH:$(TCLLIBDIR) -OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCL:tcl=tclstub) $(TLIBS)

sqlite3.exe:	$(TOP)\src\shell.c libsqlite3.lib sqlite3.h
	$(LTLINK) $(READLINE_FLAGS) \
		$(TOP)\src\shell.c libsqlite3.lib \
		$(LIBREADLINE) $(TLIBS)

# This target creates a directory named "tsrc" and fills it with
................................................................................

sqlite3.c:	.target_source $(TOP)\tool\mksqlite3c.tcl
	$(TCLSH_CMD) $(TOP)\tool\mksqlite3c.tcl

# Rule to build the amalgamation
#
sqlite3.lo:	sqlite3.c
	$(LTCOMPILE) -c sqlite3.c

# Rules to build the LEMON compiler generator
#
lempar.c:	$(TOP)\src\lempar.c
	copy $(TOP)\src\lempar.c .

lemon.exe:	$(TOP)\tool\lemon.c lempar.c
................................................................................
# Rules to build individual *.lo files from generated *.c files. This
# applies to:
#
#     parse.lo
#     opcodes.lo
#
parse.lo:	parse.c $(HDR)
	$(LTCOMPILE) -c parse.c

opcodes.lo:	opcodes.c
	$(LTCOMPILE) -c opcodes.c

# Rules to build individual *.lo files from files in the src directory.
#
alter.lo:	$(TOP)\src\alter.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\alter.c

analyze.lo:	$(TOP)\src\analyze.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\analyze.c

attach.lo:	$(TOP)\src\attach.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\attach.c

auth.lo:	$(TOP)\src\auth.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\auth.c

backup.lo:	$(TOP)\src\backup.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\backup.c

bitvec.lo:	$(TOP)\src\bitvec.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\bitvec.c

btmutex.lo:	$(TOP)\src\btmutex.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\btmutex.c

btree.lo:	$(TOP)\src\btree.c $(HDR) $(TOP)\src\pager.h
	$(LTCOMPILE) -c $(TOP)\src\btree.c

build.lo:	$(TOP)\src\build.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\build.c

callback.lo:	$(TOP)\src\callback.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\callback.c

complete.lo:	$(TOP)\src\complete.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\complete.c

ctime.lo:	$(TOP)\src\ctime.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\ctime.c

date.lo:	$(TOP)\src\date.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\date.c

delete.lo:	$(TOP)\src\delete.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\delete.c

expr.lo:	$(TOP)\src\expr.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\expr.c

fault.lo:	$(TOP)\src\fault.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\fault.c

fkey.lo:	$(TOP)\src\fkey.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\fkey.c

func.lo:	$(TOP)\src\func.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\func.c

global.lo:	$(TOP)\src\global.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\global.c

hash.lo:	$(TOP)\src\hash.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\hash.c

insert.lo:	$(TOP)\src\insert.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\insert.c

journal.lo:	$(TOP)\src\journal.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\journal.c

legacy.lo:	$(TOP)\src\legacy.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\legacy.c

loadext.lo:	$(TOP)\src\loadext.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\loadext.c

main.lo:	$(TOP)\src\main.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\main.c

malloc.lo:	$(TOP)\src\malloc.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\malloc.c

mem0.lo:	$(TOP)\src\mem0.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mem0.c

mem1.lo:	$(TOP)\src\mem1.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mem1.c

mem2.lo:	$(TOP)\src\mem2.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mem2.c

mem3.lo:	$(TOP)\src\mem3.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mem3.c

mem5.lo:	$(TOP)\src\mem5.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mem5.c

memjournal.lo:	$(TOP)\src\memjournal.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\memjournal.c

mutex.lo:	$(TOP)\src\mutex.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mutex.c

mutex_noop.lo:	$(TOP)\src\mutex_noop.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mutex_noop.c

mutex_os2.lo:	$(TOP)\src\mutex_os2.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mutex_os2.c

mutex_unix.lo:	$(TOP)\src\mutex_unix.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mutex_unix.c

mutex_w32.lo:	$(TOP)\src\mutex_w32.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\mutex_w32.c

notify.lo:	$(TOP)\src\notify.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\notify.c

pager.lo:	$(TOP)\src\pager.c $(HDR) $(TOP)\src\pager.h
	$(LTCOMPILE) -c $(TOP)\src\pager.c

pcache.lo:	$(TOP)\src\pcache.c $(HDR) $(TOP)\src\pcache.h
	$(LTCOMPILE) -c $(TOP)\src\pcache.c

pcache1.lo:	$(TOP)\src\pcache1.c $(HDR) $(TOP)\src\pcache.h
	$(LTCOMPILE) -c $(TOP)\src\pcache1.c

os.lo:	$(TOP)\src\os.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\os.c

os_unix.lo:	$(TOP)\src\os_unix.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\os_unix.c

os_win.lo:	$(TOP)\src\os_win.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\os_win.c

os_os2.lo:	$(TOP)\src\os_os2.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\os_os2.c

pragma.lo:	$(TOP)\src\pragma.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\pragma.c

prepare.lo:	$(TOP)\src\prepare.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\prepare.c

printf.lo:	$(TOP)\src\printf.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\printf.c

random.lo:	$(TOP)\src\random.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\random.c

resolve.lo:	$(TOP)\src\resolve.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\resolve.c

rowset.lo:	$(TOP)\src\rowset.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\rowset.c

select.lo:	$(TOP)\src\select.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\select.c

status.lo:	$(TOP)\src\status.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\status.c

table.lo:	$(TOP)\src\table.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\table.c

tokenize.lo:	$(TOP)\src\tokenize.c keywordhash.h $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\tokenize.c

trigger.lo:	$(TOP)\src\trigger.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\trigger.c

update.lo:	$(TOP)\src\update.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\update.c

utf.lo:	$(TOP)\src\utf.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\utf.c

util.lo:	$(TOP)\src\util.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\util.c

vacuum.lo:	$(TOP)\src\vacuum.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\vacuum.c

vdbe.lo:	$(TOP)\src\vdbe.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\vdbe.c

vdbeapi.lo:	$(TOP)\src\vdbeapi.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\vdbeapi.c

vdbeaux.lo:	$(TOP)\src\vdbeaux.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\vdbeaux.c

vdbeblob.lo:	$(TOP)\src\vdbeblob.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\vdbeblob.c

vdbemem.lo:	$(TOP)\src\vdbemem.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\vdbemem.c

vdbetrace.lo:	$(TOP)\src\vdbetrace.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\vdbetrace.c

vtab.lo:	$(TOP)\src\vtab.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\vtab.c

wal.lo:	$(TOP)\src\wal.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\wal.c

walker.lo:	$(TOP)\src\walker.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\walker.c

where.lo:	$(TOP)\src\where.c $(HDR)
	$(LTCOMPILE) -c $(TOP)\src\where.c

tclsqlite.lo:	$(TOP)\src\tclsqlite.c $(HDR)
	$(LTCOMPILE) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c

tclsqlite-shell.lo:	$(TOP)\src\tclsqlite.c $(HDR)
	$(LTCOMPILE) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c

................................................................................
	type parse.h $(TOP)\src\vdbe.c | $(NAWK) -f $(TOP)\mkopcodeh.awk >opcodes.h

# Rules to build parse.c and parse.h - the outputs of lemon.
#
parse.h:	parse.c

parse.c:	$(TOP)\src\parse.y lemon.exe $(TOP)\addopcodes.awk
	del /Q parse.y parse.h parse.h.temp
	copy $(TOP)\src\parse.y .

	.\lemon.exe $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
	move parse.h parse.h.temp
	$(NAWK) -f $(TOP)\addopcodes.awk parse.h.temp >parse.h

sqlite3.h:	$(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
	$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP) >sqlite3.h

................................................................................
!IF $(USE_AMALGAMATION)==0
TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
!ELSE
TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
!ENDIF

testfixture.exe:	$(TESTFIXTURE_SRC)
	$(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
		-DBUILD_sqlite -I$(TCLINCDIR) \
		$(TESTFIXTURE_SRC) /link /LIBPATH:$(TCLLIBDIR) $(LIBTCL) $(TLIBS)

fulltest:	testfixture.exe sqlite3.exe
	.\testfixture.exe $(TOP)\test\all.test

soaktest:	testfixture.exe sqlite3.exe
................................................................................

spaceanal_tcl.h:	$(TOP)\tool\spaceanal.tcl
	$(NAWK) "/^[^#]/ { gsub(/\\/,\"\\\\\\\\\");gsub(/\\\"/,\"\\\\\\\"\");gsub(/^/,\"\\\"\");gsub(/$$/,\"\\n\\\"\");print }" \
		$(TOP)\tool\spaceanal.tcl >spaceanal_tcl.h

sqlite3_analyzer.exe:	$(TESTFIXTURE_SRC) spaceanal_tcl.h
	$(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
		-DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE \
		-DBUILD_sqlite -I$(TCLINCDIR) \
		$(TESTFIXTURE_SRC) /link /LIBPATH:$(TCLLIBDIR) $(LIBTCL) $(TLIBS)

clean:
	del /Q *.lo *.lib *.obj sqlite3.exe libsqlite3.lib
	del /Q sqlite3.h opcodes.c opcodes.h
	del /Q lemon.exe lempar.c parse.*
	del /Q mkkeywordhash.exe keywordhash.h
	-rmdir /Q/S tsrc
	del /Q .target_source
	del /Q testfixture.exe test.db
	del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
	del /Q sqlite3.c
	del /Q sqlite3_analyzer.exe spaceanal_tcl.h

#
# Windows section
#
dll: sqlite3.dll

sqlite3.def: libsqlite3.lib
	echo EXPORTS >sqlite3.def
	dumpbin /all libsqlite3.lib \
		| $(NAWK) "/ 1 _sqlite3_/ { sub(/^.* _/,\"\");print }" \
		| sort >>sqlite3.def

sqlite3.dll: $(LIBOBJ) sqlite3.def
	link /DLL /OUT:$@ /DEF:sqlite3.def $(LIBOBJ)