Artifact Content
Not logged in

Artifact 4f7988767e4e48b29f7eddd0e2cdea4555b9161c

File BUILD.txt part of check-in [fb1fa7f1a6] - Make it easier to do out of source builds by optionally including config.mak or config.w32. by jeremy_c on 2009-12-09 22:05:46. Also file BUILD.txt part of check-in [1c2d878d12] - Merge with trunk by btheado on 2009-12-13 01:16:13.

All of the source code for fossil is contained in the src/ subdirectory.
But there is a lot of generated code, so you will probably want to
use the Makefile.  To do a complete build, just type:

   make

That should work out-of-the-box on Macs and Linux systems. If you are
building on a Windows box, install MinGW as well as MinGW's make (or
MSYS). You can then type:

  make -f Makefile.w32

If you have trouble, or you want to do something fancy, just look at
top level makefile. There are 5 configuration options that are all well
commented. Instead of editing the Makefile, create a new file named
config.mak (for Macs and Linux systems) or config.w32 (for Windows) and
override any settings you wish there.

Out of source builds?
--------------------------------------------------------------------------

An out of source build is pretty easy:

  1. Make a new directory to do the builds in.
  2. Create a config.mak (or .w32 ... explained above) and add something
  along the lines of:

    SRCDIR=../src

  3. From that directory, type:

    Macs and Linux:
      $ make -f ../Makefile

    Windows:
      C:\fossil\build> make -f ../Makefile.w32

This will now keep all generates files seperate from the maintained
source code.

--------------------------------------------------------------------------

Here are some notes on what is happening behind the scenes:

* The Makefile just sets up a few macros and then invokes the
  real makefile in src/main.mk.  The src/main.mk makefile is
  automatically generated by a TCL script found at src/makemake.tcl.
  Do not edit src/main.mk directly.  Update src/makemake.tcl and
  then rerun it.

* The *.h header files are automatically generated using a program
  called "makeheaders".  Source code to the makeheaders program is
  found in src/makeheaders.c.  Documentation is found in 
  src/makeheaders.html.

* Most *.c source files are preprocessed using a program called
  "translate".  The sources to translate are found in src/translate.c.
  A header comment in src/translate.c explains in detail what it does.

* The src/mkindex.c program generates some C code that implements
  static lookup tables.  See the header comment in the source code
  for details on what it does.