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 touse the Makefile. To do a complete build on unix, just type:
make
On a windows box, use one of the Makefiles in the win/ subdirectory,
according to your compiler and environment. For example:
make -f win/Makefile.w32
If you have trouble, or you want to do something fancy, just look at
top level makefile. There are 6 configuration options that are all well
commented. Instead of editing the Makefile, consider copying the Makefile
to an alternative name such as "GNUMakefile", "BSDMakefile", or "makefile"
and editing the copy.
BUILDING OUTSIDE THE SOURCE TREE
An out of source build is pretty easy:
1. Make a new directory to do the builds in.
2. Copy "Makefile" from the source into the build directory andmodify the SRCDIR macro along the lines of: SRCDIR=../src3. type: "make"
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.
................................................................................
* 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.

To do a complete build, just type:
./configure; make
The ./configure script builds Makefile from Makefile.in based onyour system and any options you select (run "./configure --help"for a listing of the available options.)If you wish to use the original Makefile with no configuration, you caninstead use: make -f Makefile.classic
On a windows box, use one of the Makefiles in the win/ subdirectory,
according to your compiler and environment. If you have GCC and MSYSinstalled on your system, then consider:
make -f win/Makefile.mingwIf you have VC++ installed on your system, then consider: cd win; nmake /f Makefile.msc
If you have trouble, or you want to do something fancy, just look at
Makefile.classic. There are 6 configuration options that are all well
commented. Instead of editing the Makefile.classic, consider copying
Makefile.classic to an alternative name such as "GNUMakefile",
"BSDMakefile", or "makefile" and editing the copy.
BUILDING OUTSIDE THE SOURCE TREE
An out of source build is pretty easy:
1. Make and change to a new directory to do the builds in.
2. Run the "configure" script from this directory.3. Type: "make"For example: mkdir build cd build ../configuremake
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 configure script (if used) examines the options given and runs various tests with the C compiler to create Makefile from the Makefile.in template as well as autoconfig.h
* 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.
................................................................................
* 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.
Additional information on the build process is available fromhttp://www.fossil-scm.org/fossil/doc/trunk/www/makefile.wiki

#!/usr/bin/make## This is the top-level makefile for Fossil when the build is occurring# on a unix platform. This works out-of-the-box on most unix platforms.# But you are free to vary some of the definitions if desired.##### The toplevel directory of the source tree. Fossil can be built# in a directory that is separate from the source tree. Just change# the following to point from the build directory to the src/ folder.#SRCDIR = @srcdir@/src#### The directory into which object code files should be written.##OBJDIR = ./bld#### C Compiler and options for use in building executables that# will run on the platform that is doing the build. This is used# to compile code-generator programs as part of the build process.# See TCC below for the C compiler for building the finished binary.#BCC = @CC_FOR_BUILD@#### The suffix to add to final executable file. When cross-compiling# to windows, make this ".exe". Otherwise leave it blank.#E = @EXEEXT@TCC = @CC@#### Tcl shell for use in running the fossil testsuite. If you do not# care about testing the end result, this can be blank.#TCLSH = tclshLIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_HINSTALLDIR = $(DESTDIR)@prefix@/binUSE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@include $(SRCDIR)/main.mkdistclean: clean rm -f autoconfig.h config.log Makefile

Unless explicitly stated, all files which form part of autosetupare released under the following license:---------------------------------------------------------------------autosetup - A build environment "autoconfigurator"Copyright (c) 2010-2011, WorkWare Systems <http://workware.net.au/>Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.THIS SOFTWARE IS PROVIDED BY THE WORKWARE SYSTEMS ``AS IS'' AND ANYEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR APARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WORKWARESYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODSOR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IFADVISED OF THE POSSIBILITY OF SUCH DAMAGE.The views and conclusions contained in the software and documentationare those of the authors and should not be interpreted as representingofficial policies, either expressed or implied, of WorkWare Systems.