comparison doc/devel/make.txt @ 0:13d2b8934445

Import AnaGram (near-)release tree into Mercurial.
author David A. Holland
date Sat, 22 Dec 2007 17:52:45 -0500
parents
children 12171da8943f
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 Things you should do when developing:
2
3 - Configure with --enable-maintainer-mode. (See install.txt.)
4
5 - Set up both a native and a Windows build tree.
6
7 - Create a directory "bin" under the top level of the source tree,
8 and copy a known working version of agcl there. (See below.)
9
10 Useful make targets and options:
11
12 all Compile everything.
13 rules Update the make rules.
14 agfiles Generate AG output from syntax files.
15 agclean Remove AG output files.
16 clean Remove object files and executables.
17 distclean Remove all compiler-generated material.
18 install Install everything.
19
20 SAFE=1 Compile with "safe" AnaGram (see below)
21 UNSAFE=1 Compile with "unsafe" AnaGram (see below)
22
23 If you add a file to the build, rerun "make rules" in the affected
24 build directories. If you add a whole directory, you need to rerun the
25 configure script to generate the new makefile. You can do this in an
26 existing build directory by running "./config.status", which remembers
27 the options you gave to configure.
28
29 Dependency tracking for header files is automatic.
30
31 If you want to remove a header file from the build, the easiest way is
32 to make sure it isn't used (e.g., by putting an #error in it and
33 building) before actually deleting it. Otherwise you may need to blow
34 away the depend files (depend.mk and *.u or *.d) to keep make from
35 complaining that it doesn't exist.
36
37 Bootstrapping notes:
38
39 AnaGram is partly written using itself. This creates the potential for
40 various kinds of problems.
41
42 The distribution archives ship with up-to-date versions of the
43 generated code; if you aren't developing, you should be able to just
44 use those and everything should be ok.
45
46 If you *are* developing, the following precautions are taken:
47
48 - By default, the build runs $(TOP)/bin/agcl, which you should
49 update by hand as you see fit.
50
51 - If you set SAFE (e.g., make SAFE=1) the build system will run
52 $(TOP)/bin/safe-agcl instead, the idea being that you can be
53 be very conservative about updating this and use it as a
54 fallback if you manage to delete or break $(TOP)/bin/agcl.
55
56 - If you set UNSAFE (e.g., make UNSAFE=1) the build system will
57 run the most recent native agcl right out of the build tree.
58 Use with due caution.
59
60 - The AG-generated code used in the build is kept in CVS, so
61 if all else fails you can revert to a clean version that way.
62 Be sure to revert matching .cpp and .h files, or the build
63 will fail.
64
65 Note that $(TOP)/bin is neither created nor populated by default;
66 if developing you should set it up yourself with a suitable agcl
67 executable.
68
69 Also note that if you are developing you should always configure with
70 --enable-maintainer-mode, and this *requires* $(TOP)/bin/agcl to exist
71 in order to test-compile the examples. This also creates a minor
72 bootstrap problem: if you don't already have an agcl to place in
73 $(TOP)/bin, you have to compile one. The easiest way is as follows:
74
75 path-to-source/configure native
76 make rules
77 make
78 mkdir path-to-source/bin
79 cp anagram/run/agcl path-to-source/bin/agcl
80 ./config.status --enable-maintainer-mode
81 make rules
82 make
83