comparison doc/devel/make.txt @ 20:bb115deb6fb2

Improve agfiles rule. (1) It didn't depend on $(AGCL) and it absolutely should have. (2) allow AGFORCE=1 to make it rebuild whether or not it looks out of date. (3) Document this.
author David A. Holland
date Mon, 13 Jun 2022 00:02:15 -0400
parents 12171da8943f
children
comparison
equal deleted inserted replaced
19:db7ff952e01e 20:bb115deb6fb2
17 distclean Remove all compiler-generated material. 17 distclean Remove all compiler-generated material.
18 install Install everything. 18 install Install everything.
19 19
20 SAFE=1 Compile with "safe" AnaGram (see below) 20 SAFE=1 Compile with "safe" AnaGram (see below)
21 UNSAFE=1 Compile with "unsafe" AnaGram (see below) 21 UNSAFE=1 Compile with "unsafe" AnaGram (see below)
22 AGFORCE=1 Force the agfiles target to rebuild.
22 23
23 If you add a file to the build, rerun "make rules" in the affected 24 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 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 configure script to generate the new makefile. You can do this in an
26 existing build directory by running "./config.status", which remembers 27 existing build directory by running "./config.status", which remembers
32 to make sure it isn't used (e.g., by putting an #error in it and 33 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 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 away the depend files (depend.mk and *.u or *.d) to keep make from
35 complaining that it doesn't exist. 36 complaining that it doesn't exist.
36 37
38 Note that the 'agfiles' target will only rebuild the AnaGram output if
39 it appears to be out of date, unless you specify AGFORCE=1. If you
40 aren't certain whether it really rebuilt, check the date stamp in the
41 output header file.
42
43
37 Bootstrapping notes: 44 Bootstrapping notes:
38 45
39 AnaGram is partly written using itself. This creates the potential for 46 AnaGram is partly written using itself. This creates the potential for
40 various kinds of problems. 47 various kinds of problems.
41 48
44 use those and everything should be ok. 51 use those and everything should be ok.
45 52
46 If you *are* developing, the following precautions are taken: 53 If you *are* developing, the following precautions are taken:
47 54
48 - By default, the build runs $(TOP)/bin/agcl, which you should 55 - By default, the build runs $(TOP)/bin/agcl, which you should
49 update by hand as you see fit. 56 update by hand as you see fit. Note: update it from the copy
57 the build produces in anagram/run, not the one in anagram/agcl.
58 The latter doesn't have the checksums in it and won't run.
50 59
51 - If you set SAFE (e.g., make SAFE=1) the build system will run 60 - 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 61 $(TOP)/bin/safe-agcl instead, the idea being that you can be
53 be very conservative about updating this and use it as a 62 be very conservative about updating this and use it as a
54 fallback if you manage to delete or break $(TOP)/bin/agcl. 63 fallback if you manage to delete or break $(TOP)/bin/agcl.
65 Note that $(TOP)/bin is neither created nor populated by default; 74 Note that $(TOP)/bin is neither created nor populated by default;
66 if developing you should set it up yourself with a suitable agcl 75 if developing you should set it up yourself with a suitable agcl
67 executable. 76 executable.
68 77
69 Also note that if you are developing you should always configure with 78 Also note that if you are developing you should always configure with
70 --enable-maintainer-mode, and this *requires* $(TOP)/bin/agcl to exist 79 --enable-maintainer-mode, and this *requires* $(TOP)/bin/agcl to
71 in order to test-compile the examples. This also creates a minor 80 exist. This also creates a minor bootstrap problem: if you don't
72 bootstrap problem: if you don't already have an agcl to place in 81 already have an agcl to place in $(TOP)/bin, you have to compile
73 $(TOP)/bin, you have to compile one. The easiest way is as follows: 82 one. The easiest way is as follows:
74 83
75 path-to-source/configure native 84 path-to-source/configure native
76 make rules 85 make rules
77 make 86 make
78 mkdir path-to-source/bin 87 mkdir path-to-source/bin
79 cp anagram/run/agcl path-to-source/bin/agcl 88 cp anagram/run/agcl path-to-source/bin/agcl
80 ./config.status --enable-maintainer-mode 89 ./config.status --enable-maintainer-mode
81 make rules 90 make rules
82 make 91 make
83 92
93 And finally, note that the 'agfiles' target depends make-style, that
94 is, by timestamp, on the agcl executable selected. If reverting to an
95 older version, including via SAFE=1, it is a good idea to also
96 AGFORCE=1 on the make command line, or run the 'agclean' target
97 first. (There is also no such dependency when maintainer mode is not
98 enabled, because that would preclude building from scratch.)
99
100 The premise is that changes to the sources are much more common than
101 material changes to the output that require rebuilding the parsers
102 used in AnaGram itself.