| | @@ -1,35 +1,62 @@ |
| 1 | | -All of the source code for fossil is contained in the src/ subdirectory. |
| 2 | | -But there is a lot of generated code, so you will probably want to |
| 3 | | -use the Makefile. To do a complete build, just type: |
| 4 | | - |
| 5 | | - make |
| 6 | | - |
| 7 | | -That should work out-of-the-box on Macs and Linux systems. If |
| 8 | | -you have trouble, or you want to do something fancy, just edit |
| 9 | | -the Makefile in the top-level folder. There are 5 things you |
| 10 | | -might want to change in the Makefile. All 5 things are well |
| 11 | | -commented. The complete Makefile is only a few dozen lines long. |
| 12 | | -Do not be intimidated. |
| 13 | | - |
| 14 | | - |
| 15 | | -Here are some notes on what is happening behind the scenes: |
| 16 | | - |
| 17 | | -* The Makefile just sets up a few macros and then invokes the |
| 18 | | - real makefile in src/main.mk. The src/main.mk makefile is |
| 19 | | - automatically generated by a TCL script found at src/makemake.tcl. |
| 20 | | - Do not edit src/main.mk directly. Update src/makemake.tcl and |
| 21 | | - then rerun it. |
| 22 | | - |
| 23 | | -* The *.h header files are automatically generated using a program |
| 24 | | - called "makeheaders". Source code to the makeheaders program is |
| 25 | | - found in src/makeheaders.c. Documentation is found in |
| 26 | | - src/makeheaders.html. |
| 27 | | - |
| 28 | | -* Most *.c source files are preprocessed using a program called |
| 29 | | - "translate". The sources to translate are found in src/translate.c. |
| 30 | | - A header comment in src/translate.c explains in detail what it does. |
| 31 | | - |
| 32 | | -* The src/mkindex.c program generates some C code that implements |
| 33 | | - static lookup tables. See the header comment in the source code |
| 34 | | - for details on what it does. |
| 1 | +All of the source code for fossil is contained in the src/ subdirectory. |
| 2 | +But there is a lot of generated code, so you will probably want to |
| 3 | +use the Makefile. To do a complete build, just type: |
| 4 | + |
| 5 | + make |
| 6 | + |
| 7 | +That should work out-of-the-box on Macs and Linux systems. If you are |
| 8 | +building on a Windows box, install MinGW as well as MinGW's make (or |
| 9 | +MSYS). You can then type: |
| 10 | + |
| 11 | + make -f Makefile.w32 |
| 12 | + |
| 13 | +If you have trouble, or you want to do something fancy, just look at |
| 14 | +top level makefile. There are 5 configuration options that are all well |
| 15 | +commented. Instead of editing the Makefile, create a new file named |
| 16 | +config.mak (for Macs and Linux systems) or config.w32 (for Windows) and |
| 17 | +override any settings you wish there. |
| 18 | + |
| 19 | +Out of source builds? |
| 20 | +-------------------------------------------------------------------------- |
| 21 | + |
| 22 | +An out of source build is pretty easy: |
| 23 | + |
| 24 | + 1. Make a new directory to do the builds in. |
| 25 | + 2. Create a config.mak (or .w32 ... explained above) and add something |
| 26 | + along the lines of: |
| 27 | + |
| 28 | + SRCDIR=../src |
| 29 | + |
| 30 | + 3. From that directory, type: |
| 31 | + |
| 32 | + Macs and Linux: |
| 33 | + $ make -f ../Makefile |
| 34 | + |
| 35 | + Windows: |
| 36 | + C:\fossil\build> make -f ../Makefile.w32 |
| 37 | + |
| 38 | +This will now keep all generates files seperate from the maintained |
| 39 | +source code. |
| 40 | + |
| 41 | +-------------------------------------------------------------------------- |
| 42 | + |
| 43 | +Here are some notes on what is happening behind the scenes: |
| 44 | + |
| 45 | +* The Makefile just sets up a few macros and then invokes the |
| 46 | + real makefile in src/main.mk. The src/main.mk makefile is |
| 47 | + automatically generated by a TCL script found at src/makemake.tcl. |
| 48 | + Do not edit src/main.mk directly. Update src/makemake.tcl and |
| 49 | + then rerun it. |
| 50 | + |
| 51 | +* The *.h header files are automatically generated using a program |
| 52 | + called "makeheaders". Source code to the makeheaders program is |
| 53 | + found in src/makeheaders.c. Documentation is found in |
| 54 | + src/makeheaders.html. |
| 55 | + |
| 56 | +* Most *.c source files are preprocessed using a program called |
| 57 | + "translate". The sources to translate are found in src/translate.c. |
| 58 | + A header comment in src/translate.c explains in detail what it does. |
| 59 | + |
| 60 | +* The src/mkindex.c program generates some C code that implements |
| 61 | + static lookup tables. See the header comment in the source code |
| 62 | + for details on what it does. |
| 35 | 63 | |