Pikchr

Check-in [2972d1d248]
Login

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

Overview
Comment:Update the how-to-build documentation.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA3-256: 2972d1d24849d4c347203ec378fcf95e406d63f2d40c770631ff472e245e6271
User & Date: drh 2025-05-12 15:38:13.998
Context
2025-05-12
15:38
Update the how-to-build documentation. (Leaf check-in: 2972d1d248 user: drh tags: trunk)
2025-05-09
00:38
Make the default compiler "cc" instead of "gcc" for systems that don't have gcc. (check-in: fe3788e59d user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to doc/build.md.
1
2
3
4
5
6
7



8
9
10
11
12
13
14
# How To Compile Pikchr

## Overview

  *  Primary source file: "`pikchr.y`"
  *  Process "`pikchr.y`" using Lemon (sources provided in tree)
     to create "`pikchr.c`"



  *  Compile "`pikchr.c`" into an object file, or add the
     "`-DPIKCHR_SHELL`" command-line option to generate a stand-alone
     executable.

[src]: /file/pikchr.c

~~~ pikchr







>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# How To Compile Pikchr

## Overview

  *  Primary source file: "`pikchr.y`"
  *  Process "`pikchr.y`" using Lemon (sources provided in tree)
     to create "`pikchr.c`"
  *  *(Not shown)* Use files `manifest`, `manifest.uuid`, and
     `mkversion.c` to create the `VERSION.h` header file used by
     `pikchr.c`.
  *  Compile "`pikchr.c`" into an object file, or add the
     "`-DPIKCHR_SHELL`" command-line option to generate a stand-alone
     executable.

[src]: /file/pikchr.c

~~~ pikchr
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  Lemon:    oval "lemon" ht 50%
            arrow from Src chop down until even with CC1 \
              then to Lemon.nw rad 10px
            "Pikchr source " rjust "code input " rjust \
              at 2nd vertex of previous
            arrow from Lempar chop down until even with CC1 \
              then to Lemon.ne rad 10px
            " parser template" ljust " resource file" ljust \
              at 2nd vertex of previous
  PikSrc:   file "pikchr.c" with .n at lineht below Lemon.s
            arrow from Lemon to PikSrc chop
            arrow down from PikSrc.s
  CC2:      oval "C-Compiler" ht 50%
            arrow
  Out:      file "pikchr.o" "or" "pikchr.exe" wid 110%
            spline <- from 1mm west of Src.w go 60% heading 250 \
               then go 40% heading 45 then go 60% heading 250 \
               thin color gray
            box invis "Canonical" ljust small "Source code" ljust small fit \
               with .e at end of last spline width 90%
            spline <- from 1mm west of PikSrc.w go 60% heading 250 \
               then go 40% heading 45 then go 60% heading 250 \
               thin color gray
            box invis "Preprocessed" ljust small \
              "C-code" ljust small "also in-tree" ljust small fit \
               with .e at end of last spline width 90%
~~~

## Details:

The source code for Pikchr is in the file named "`pikchr.y`".  As
the ".y" suffix implies, this file is a grammar specification intended







|















|
|







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  Lemon:    oval "lemon" ht 50%
            arrow from Src chop down until even with CC1 \
              then to Lemon.nw rad 10px
            "Pikchr source " rjust "code input " rjust \
              at 2nd vertex of previous
            arrow from Lempar chop down until even with CC1 \
              then to Lemon.ne rad 10px
            " parser" ljust " template" ljust \
              at 2nd vertex of previous
  PikSrc:   file "pikchr.c" with .n at lineht below Lemon.s
            arrow from Lemon to PikSrc chop
            arrow down from PikSrc.s
  CC2:      oval "C-Compiler" ht 50%
            arrow
  Out:      file "pikchr.o" "or" "pikchr.exe" wid 110%
            spline <- from 1mm west of Src.w go 60% heading 250 \
               then go 40% heading 45 then go 60% heading 250 \
               thin color gray
            box invis "Canonical" ljust small "Source code" ljust small fit \
               with .e at end of last spline width 90%
            spline <- from 1mm west of PikSrc.w go 60% heading 250 \
               then go 40% heading 45 then go 60% heading 250 \
               thin color gray
            box invis "Generated" ljust small \
              "C-code" ljust small fit \
               with .e at end of last spline width 90%
~~~

## Details:

The source code for Pikchr is in the file named "`pikchr.y`".  As
the ".y" suffix implies, this file is a grammar specification intended
76
77
78
79
80
81
82











83
84
85
86
87
88
89
90
91
92
93
94
any ordinary C-compiler.

When the lemon executable runs, it looks for the "`lempar.c`" template
in the working directory.  The "`lempar.c`" template is also included
in the Pikchr source repository for convenience.

[lemon]: https://www.sqlite.org/lemon.html












## Preprocessed Sources: `pikchr.c` and `pikchr.h`

Prior to version 1.1, the pre-processed "`pikchr.c`" C-code
file was checked into the Pikchr source tree, as a convenience
to programmers.  However, beginning with version 1.1, the check-in
name is stored in the "`pikchr.c`" file itself, so that file
cannot be checked in itself.

If you want to work with Pikchr, and want the pikchr.c and pikchr.h
source files, just download the canonical source tree and
run "`make pikchr.c`" or on Windows "`nmake /f Makefile.msc pikchr.c`".







>
>
>
>
>
>
>
>
>
>
>












79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
any ordinary C-compiler.

When the lemon executable runs, it looks for the "`lempar.c`" template
in the working directory.  The "`lempar.c`" template is also included
in the Pikchr source repository for convenience.

[lemon]: https://www.sqlite.org/lemon.html

## Version information in `VERSION.h`

Beginning with Pikchr version 1.1, the `pikchr.c` source file does
a #include of a new version-information file named `VERSION.h`.
`VERSION.h` is a short file that contains a handful of C-preprocessor
macros definitions.  The `VERSION.h` files is built automatically
from on information provide in the `manifest` and `manifest.uuid`
files of the source tree - files that are automatically generated
by the [Fossil version control system](https://fossil-scm.org/home)
that manages the Pikchr source code.

## Preprocessed Sources: `pikchr.c` and `pikchr.h`

Prior to version 1.1, the pre-processed "`pikchr.c`" C-code
file was checked into the Pikchr source tree, as a convenience
to programmers.  However, beginning with version 1.1, the check-in
name is stored in the "`pikchr.c`" file itself, so that file
cannot be checked in itself.

If you want to work with Pikchr, and want the pikchr.c and pikchr.h
source files, just download the canonical source tree and
run "`make pikchr.c`" or on Windows "`nmake /f Makefile.msc pikchr.c`".