Merge branch 'lflags-test-fixes' into maint
[platform/upstream/automake.git] / HACKING
1 ================================================================
2 = This file
3
4 * This file attempts to describe the rules to use when hacking
5   automake.
6
7 * Don't put this file into the distribution.  Don't mention it in the
8   ChangeLog.
9
10 ================================================================
11 = Administrivia
12
13 * If you incorporate a change from somebody on the net:
14   First, if it is a large change, you must make sure they have signed the
15   appropriate paperwork.
16   Second, be sure to add their name and email address to THANKS
17
18 * If a change fixes a test, mention the test in the ChangeLog entry.
19
20 * If somebody reports a new bug, mention his name in the ChangeLog entry
21   and in the test case you write.  Put him into THANKS.
22
23 * The correct response to most actual bugs is to write a new test case
24   which demonstrates the bug.  Then fix the bug, re-run the test suite,
25   and check everything in.
26
27 * Some files in the automake package are not owned by automake.  These
28   files should never be edited here.  These files are
29       COPYING (from FSF),
30       INSTALL (autoconf-patches@gnu.org),
31       config.guess, config.sub (config-patches@gnu.org),
32       texinfo.tex (bug-texinfo@gnu.org),
33   Most of them are updated before release with `make fetch'.
34
35 * Changes other than bug fixes must be mentioned in NEWS.  Important
36   bug fixes should be mentioned in NEWS, too.
37
38 ================================================================
39 = Naming
40
41 * We've adopted the convention that internal AC_SUBSTs should be
42   named with a leading `am__', and internally generated targets
43   should be named with a leading `am--'.  This convention, although
44   in place from at least February 2001, isn't yet universally used.
45   But all new code should use it.
46
47   We used to use `_am_' as the prefix for an internal AC_SUBST.
48   However, it turns out that NEWS-OS 4.2R complains if a Makefile
49   variable begins with `_'.  Yay for them.  I changed the target
50   naming convention just to be safe.
51
52 ================================================================
53 = Editing `.am' files
54
55 * Always use $(...) and not ${...}
56
57 * Use `:', not `true'.  Use `exit 1', not `false'.
58
59 * Use `##' comments liberally.  Comment anything even remotely
60   unusual.
61
62 * Never use basename or dirname.  Instead use sed.
63
64 * Do not use `cd' within back-quotes, use `$(am__cd)' instead.
65   Otherwise the directory name may be printed, depending on CDPATH.
66   More generally, do not ever use plain `cd' together with a relative
67   directory that does not start with a dot, or you might end up in one
68   computed with CDPATH.
69
70 * For install and uninstall rules, if a loop is required, it should be
71   silent.  Then the body of the loop itself should print each
72   "important" command it runs.  The printed commands should be preceded
73   by a single space.
74
75 ================================================================
76 = Editing automake.in and aclocal.in
77
78 * Indent using GNU style.  For historical reasons, the perl code
79   contains portions indented using Larry Wall's style (perl-mode's
80   default), and other portions using the GNU style (cperl-mode's
81   default).  Write new code using GNU style.
82
83 * Don't use & for function calls, unless required.
84   The use of & prevents prototypes from being checked.
85   Just as above, don't change massively all the code to strip the
86   &, just convert the old code as you work on it, and write new
87   code without.
88
89 ================================================================
90 = Working with git
91
92 * To regenerate dependent files created by aclocal and automake,
93   use the `bootstrap' script.  It uses the code from the source
94   tree, so the resulting files (aclocal.m4 and Makefile.in) should
95   be the same as you would get if you install this version of
96   automake and use it to generate those files.  Be sure to have the
97   latest stable version of Autoconf installed.  If such version is
98   not installed as "autoconf", pass it explicitly (along with the
99   accompanying "autom4te") when calling `bootstrap' and `configure'.
100   For example:
101     $ AUTOCONF=autoconf2.67 AUTOM4TE=autom4te2.67 ./bootstrap
102     $ ./configure AUTOCONF=autoconf2.67 AUTOM4TE=autom4te2.67
103
104 * Dependent files aclocal.m4, configure and Makefile.in in all
105   directories should be up to date in the git repository, so that
106   the changes in them can be easily noticed and analyzed.
107
108 * The git tree currently carries a number of branches: master for the
109   current development, and release branches named branch-X.Y.  The maint
110   branch serves as common ground for both master and the active release
111   branches.  Changes intended for both should be applied to maint, which
112   should then be merged to release branches and master, of course after
113   suitable testing.  It is advisable to merge only after a set of related
114   commits have been applied.
115
116 * Example work flow for patches to maint:
117
118   # 1. Checkout the "maint" branch:
119   git checkout maint
120
121   # 2. Apply the patch(es) with "git am" (or create them with $EDITOR):
122   git am -3 0*.patch
123   # 2a. Run required tests, if any ...
124
125   # 3. Merge maint into branch-1.11:
126   git checkout branch-1.11
127   git merge maint
128   # 3a. Run required tests, if any ...
129
130   # 4. Redo steps 3 and 3a for master:
131   git checkout master
132   git merge maint
133   # testing ...
134
135   # 5. Push the maint and master branches:
136   git push --dry-run origin maint branch-1.11 master
137   # if all seems ok, then actually push:
138   git push origin maint branch-1.11 master
139
140 * When fixing a bug (especially a long-standing one), it may be useful
141   to commit the fix to a new temporary branch based off the commit that
142   introduced the bug.  Then this "bugfix branch" can be merged into all
143   the active branches descending from the buggy commit.  This offers a
144   simple way to fix the bug consistently and effectively.
145
146 * When referring to older commits, use 'git describe' output as pointer.
147
148 * There may be a number of longer-lived feature branches for new developments.
149   They should be based off of a common ancestor of all active branches to
150   which the feature should be merged later.  The next branch may serve as
151   common ground for feature merging and testing, should they not be ready
152   for master yet.
153
154 * For merges from branches other than maint, prefer 'git merge --log' over
155   plain 'git merge', so that a later 'git log' gives an indication of which
156   actual patches were merged even when they don't appear early in the list.
157
158 * master and release branches should not be rewound, i.e., should always
159   fast-forward, except maybe for privacy issues.  The maint branch should not
160   be rewound except maybe after retiring a release branch or a new stable
161   release.  For next, and for feature branches, the announcement for the
162   branch should document rewinding policy.
163
164 * In order for rebasing and merging of ChangeLog entries to work seamlessly,
165   install and configure git-merge-changelog, currently available as gnulib
166   module.
167
168 ================================================================
169 = Test suite
170
171 * Use "make check" and "make maintainer-check" liberally.
172
173 * Make sure each test file is executable.
174
175 * Use `keep_testdirs=yes' to keep test directories for successful
176   tests also.
177
178 * See file `tests/README' for more information.
179
180 ================================================================
181 = Release procedure
182
183 * Fetch new versions of the files that are maintained by the FSF.
184   Commit.  Unfortunately you need an FSF account to do this.
185   (You can also use `make fetch', but that is still woefully incomplete.)
186
187 * Update NEWS.  For an alpha release, update README-alpha.
188
189 * Update the version number in configure.ac.
190   (The idea is that every other alpha number will be a net release.
191   The repository will always have its own "odd" number so we can easily
192   distinguish net and repo versions.)
193
194 * Update ChangeLog.
195
196 * Run ./bootstrap, ./configure, make.
197
198 * Run `make release-stats' if release statistics in doc/automake.texi
199   have not been updated yet.
200
201 * Run `make git-release'.
202   This will run distcheck to create the tarballs, commit the last
203   NEWS/configure.ac/ChangeLog changes, tag the repository, sign
204   the tarballs, and upload them.
205   Use `make GNUPLOADFLAGS="--user key" git-release' to sign with
206   a non-default key.
207
208 * Update version number in configure.ac to next alpha number.
209   Re-run ./bootstrap and commit.
210
211 * Don't forget to `git push' your changes so they appear in the public
212   git tree.
213
214 * Update the web pages at sources.redhat.com:
215   - bump version in index.rst,
216   - add entry to news.rst,
217   - run `make' to update .html files,
218   - create manuals:
219       cd doc
220       make pdf
221       make html MAKEINFOFLAGS=--no-split
222   - copy automake.html and automake.pdf to web cvs,
223   - add ChangeLog entry and commit.
224
225 * Update the manuals at www.gnu.org:
226   - Generate manuals:
227     cd doc
228     wget "http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs.sh"
229     wget "http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs_template"
230     sh ./gendocs.sh --email bug-automake@gnu.org automake "GNU Automake"
231   - copy manuals recursively to web cvs,
232   - commit.
233   - Check for link errors, fix them, recheck until convergence:
234     <http://validator.w3.org/checklink>
235
236 * Send announcement at least to autotools-announce@gnu.org, and
237   automake@gnu.org.  If not an alpha, announcement must also go to
238   info-gnu@gnu.org.  Copy this announcement into the NEWS feed at
239   <https://savannah.gnu.org/projects/automake>.
240
241 -----
242
243 Copyright (C) 2003, 2007, 2008, 2010 Free Software Foundation, Inc.
244
245 This program is free software; you can redistribute it and/or modify
246 it under the terms of the GNU General Public License as published by
247 the Free Software Foundation; either version 2, or (at your option)
248 any later version.
249
250 This program is distributed in the hope that it will be useful,
251 but WITHOUT ANY WARRANTY; without even the implied warranty of
252 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
253 GNU General Public License for more details.
254
255 You should have received a copy of the GNU General Public License
256 along with this program.  If not, see <http://www.gnu.org/licenses/>.
257
258 Local Variables:
259 mode: text
260 End: