Wapp

Check-in [b7abbe4090]
Login

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

Overview
Comment:Add a makefile for windows. Improvements, including better comments, in existing makefiles.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b7abbe4090f05a0163fdfe30bcb02efbc136f6509d5d20fd52ec9785c5d12fe8
User & Date: drh 2024-11-09 12:34:10.322
Context
2024-11-09
12:41
Fix to the "clean" target on the MacOS makefile (check-in: 44975d66a9 user: drh tags: trunk)
12:34
Add a makefile for windows. Improvements, including better comments, in existing makefiles. (check-in: b7abbe4090 user: drh tags: trunk)
2024-11-07
19:34
Improved documentation of substitution operators. Documentation for the wapp-crash-handler interface. (check-in: f83e99d413 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to Makefile.
1














2
3
4
5

6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/make















CFLAGS = -Os -static
CC = gcc $(CFLAGS)
OPTS = -DSQLITE_ENABLE_DESERIALIZE

TCLLIB = /home/drh/tcl/tcl9/lib/libtcl9.0.a -lm -lz -lpthread -ldl
TCLINC = /home/drh/tcl/tcl9/include
TCLSH = tclsh

all: wapptclsh

wapptclsh: wapptclsh.c
	$(CC) -I. -I$(TCLINC) -o $@ $(OPTS) wapptclsh.c $(TCLLIB)

wapptclsh.c:	wapptclsh.c.in wapp.tcl wapptclsh.tcl tclsqlite3.c mkccode.tcl
	$(TCLSH) mkccode.tcl wapptclsh.c.in >$@

clean:	
	rm wapptclsh wapptclsh.c

>
>
>
>
>
>
>
>
>
>
>
>
>
>




>
|
|
|










|
1
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
#!/usr/bin/make
#
# Makefile for wapptclsh on unix.  Usage:
#
#    make clean wapptclsh TCLDIR=/home/drh/local
#
# You need a static build of TCL9 in the directory that TCLDIR specifies.
# To construct such a build:
#
#    (1)  Download and untar the TCL9 sources
#    (2)  CD into the unix subdirectory
#    (3)  ./configure --disable-shared --prefix=/home/drh/local
#                        change as appropriate -^^^^^^^^^^^^^^^
#    (4)  make install
#

CFLAGS = -Os -static
CC = gcc $(CFLAGS)
OPTS = -DSQLITE_ENABLE_DESERIALIZE
TCLDIR ?= /home/drh/tcl/tcl9
TCLLIB = $(TCLDIR)/lib/libtcl9.0.a -lm -lz -lpthread -ldl
TCLINC = $(TCLDIR)/include
TCLSH = $(TCLDIR)/bin/tclsh9.0

all: wapptclsh

wapptclsh: wapptclsh.c
	$(CC) -I. -I$(TCLINC) -o $@ $(OPTS) wapptclsh.c $(TCLLIB)

wapptclsh.c:	wapptclsh.c.in wapp.tcl wapptclsh.tcl tclsqlite3.c mkccode.tcl
	$(TCLSH) mkccode.tcl wapptclsh.c.in >$@

clean:	
	rm -f wapptclsh wapptclsh.c
Changes to Makefile.macos.
1
2














3

4
5
6
7
8
9
10
11
12
13
#!/usr/bin/make















CC = gcc -O0 -framework CoreFoundation

TCLLIB = /Users/drh/tcl/tcl9/lib/libtcl9.0.a -lm -lz -lpthread -ldl
TCLINC = /Users/drh/tcl/tcl9/include
TCLSH = /Users/drh/tcl/tcl9/bin/tclsh9.0

all: wapptclsh

wapptclsh: wapptclsh.c
	$(CC) -I. -I$(TCLINC) -o $@ wapptclsh.c $(TCLLIB)

wapptclsh.c:	wapptclsh.c.in wapp.tcl wapptclsh.tcl tclsqlite3.c mkccode.tcl

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
|
|
|







1
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
#!/usr/bin/make
#
# Makefile for wapptclsh on MacOS.  Usage:
#
#    make clean wapptclsh TCLDIR=/Users/drh/local
#
# You need a static build of TCL9 in the directory that TCLDIR specifies.
# To construct such a build:
#
#    (1)  Download and untar the TCL9 sources
#    (2)  CD into the unix subdirectory
#    (3)  ./configure --disable-shared --prefix=/Users/drh/local
#                        change as appropriate -^^^^^^^^^^^^^^^^
#    (4)  make install
#

CC = gcc -O0 -framework CoreFoundation
TCLDIR ?= /Users/drh/tcl/tcl9
TCLLIB = $(TCLDIR)/lib/libtcl9.0.a -lm -lz -lpthread -ldl
TCLINC = $(TCLDIR)/include
TCLSH = $(TCLDIR)/bin/tclsh9.0

all: wapptclsh

wapptclsh: wapptclsh.c
	$(CC) -I. -I$(TCLINC) -o $@ wapptclsh.c $(TCLLIB)

wapptclsh.c:	wapptclsh.c.in wapp.tcl wapptclsh.tcl tclsqlite3.c mkccode.tcl
Added Makefile.msc.








































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
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
# Makefile for nmake on Windows.
#
# Usage:
#
#    nmake /f Makefile.msc wapptclsh.exe  TCLDIR=C:\Tcl
#
# Must have a build of TCL9 installed in whatever directory
# the TCLDIR= argument points to.  To build TCL:
#
#    (1) Download and untar the source tree for TCL9
#    (2) CD into the win/ subdirectory
#    (3) nmake /f makefile.vc release
#    (4) nmake /f makefile.vc INSTALLDIR=C:\Tcl install
#
# Substitute whatever directory you want in place of C:\Tcl
#
CFLAGS = -nologo -MT -fp:precise
CC = cl $(CFLAGS)
OPTS = -DSQLITE_ENABLE_DESERIALIZE
!IFNDEF TCLDIR
TCLDIR = C:\Tcl
!ENDIF
TCLLIB = $(TCLDIR)\lib\tcl90.lib
TCLINC = $(TCLDIR)\include
TCLSH = $(TCLDIR)\bin\tclsh90.exe

all: wapptclsh.exe

wapptclsh.exe: wapptclsh.c
	$(CC) -I. -I$(TCLINC) -Zi /Fe$@ $(OPTS) wapptclsh.c /link /OUT:wapptclsh.exe $(TCLLIB)

wapptclsh.c:	wapptclsh.c.in wapp.tcl wapptclsh.tcl tclsqlite3.c mkccode.tcl
	$(TCLSH) mkccode.tcl wapptclsh.c.in >$@

clean:	
	del /Q wapptclsh.exe wapptclsh.c
Changes to mkccode.tcl.
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
          puts "/* $x */"
        } else {
          set x [string map "\\\\ \\\\\\\\ \\\" \\\\\"" $line]
          puts "\"$x\\n\""
        }
      }
    } else {
      puts [read $in2]
    }
    puts "/* END $path */"
    close $in2
    continue
  }
  if {[regexp {^BEGIN_STRING} $line]} {
    set instr 1







|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
          puts "/* $x */"
        } else {
          set x [string map "\\\\ \\\\\\\\ \\\" \\\\\"" $line]
          puts "\"$x\\n\""
        }
      }
    } else {
      puts [regsub -all {\yEXTERN\y} [read $in2] {}]
    }
    puts "/* END $path */"
    close $in2
    continue
  }
  if {[regexp {^BEGIN_STRING} $line]} {
    set instr 1