* shuffled the docs around
[citadel.git] / citadel / techdoc / build.txt
1 Some notes on the build process...
2   
3   
4   
5  Oct 28 01:57 1998 from LoanShark @uncnsrd 
6 what i've done with the Makefile.in most recently is to replace all the 
7 rules that explicitly generated .o files with a set of suffix rules. these 
8 are the `.c.o:', `.c.mo:', and `.c.ro:' targets that appear in the 
9 Makefile.in. the idea is, make now knows how to generate files named 
10 `foo.o', `foo.mo', or `foo.ro' from a file `foo.c'. a .o file is compiled 
11 with standard compiler flags; a .ro (reentrant object) file is also 
12 compiled with -D_REENTRANT; and a .mo (module object) is compiled with 
13 -D_REENTRANT plus -fPIC and -DPIC to produce position-independent code for 
14 a shared library. the suffix rules, together with auto dependency 
15 generation, accomplish two things: when you want to link a particular 
16 module into a binary, all you have to do is list it, with the appropriate 
17 extension, as a dependency of the binary, and add it to the link command 
18 line for the target. you don't have to worry about writing a rule to 
19 generate the object with the proper flags, or keep the header file 
20 dependencies updated. secondly, using different file extensions allows us 
21 to compile _REENTRANT and non-REENTRANT versions of files like config.c, 
22 tools.c, and snprintf.c that are used in both the clients and the server. 
23
24   autodependency generation is implemented by generating a bunch of .d  
25 files (with another suffix rule) using $(CC) - M and "-include"-ing them 
26 from the main Makefile. the .d files are made to depend on the .c files 
27 they correspond to, and the referenced header files, so they're updated as 
28 needed. the only version of make that I know for sure works with this is 
29 GNU make, but the Makefile should still work on other versions of Unix 
30 make, just without the autodependency stuff. 
31
32
33  Oct 28 20:49 1998 from LoanShark @uncnsrd 
34 one thing I forgot to mention about the autodependency generation: for a 
35 file to be included in the autodepend process, it must be listed in the 
36 SOURCES macro near the top of Makefile.in. 
37   also, I've added an 'install' target to the makefile. this will make it  
38 possible to build RPM's, and bring the installation process closer to that 
39 of other packages, which if you're using the new configure script goes 
40 like this: 
41   ./configure [--enable-ansi-color] [--disable-auto-login] [--prefix=/foo] 
42  
43   
44   --prefix specifies the location the BBS will run from,  
45 /usr/local/citadel by default. 
46   to build a highly optimized version without debugging symbols, you could 
47  do something like this (with the bourne shell): 
48   CC=egcs CFLAGS='-O6 -fomit-frame-pointer' ./configure   
49   after configuring, simply type `make', then su to a user who has  
50 appropriate permissions, and `make install'. then run setup as usual. 
51   are there any other areas that need to be cleared up? 
52