This file is indexed.

/usr/share/doc/makepp/makepp_signatures.html is in makepp 2.0.98.5-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version='1.0'?><!DOCTYPE html><html xmlns='http://www.w3.org/1999/xhtml'><head><link rel='stylesheet' href='makepp.css' type='text/css'/><title>Makepp Signatures — How makepp knows when files have changed</title><link rel='next' href='makepp_statements.html'/><link rel='prev' href='makepp_scanning.html'/><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/><link rel='shortcut icon' type='image/png' href='url.png'/><link rel='top' href='http://makepp.sourceforge.net/'/><link rel='index' href='makepp_index.html'/><link rel='contents' href='index.html'/><link rel='help' href='http://sourceforge.net/projects/makepp/support'/><script src='makepp.js' type='text/javascript'></script><meta name='keywords' content='makepp, make++, Make, build tool, repository, cache, Perl, Make alternative, Make replacement, Make enhancement, Make improvement, Make substitute, dmake, gmake, GNU Make, nmake, pmake, easymake, imake, jmake, maketool, mmake, omake, ppmake, PVM gmake, shake, SMake, ant, maven, cook, jam, Cons, SCons, cc -M, gcc -MM, g++ -MM, makedepend, makedep, mkdep, CCache, Compilercache, cachecc1, Make::Cache, automake'/></head><body><div id='_head'><form action='http://www.google.com/search'><p><input type='hidden' name='as_sitesearch' value='makepp.sourceforge.net/2.1'/><input type='text' name='as_q'/><input type='submit' value='Go'/></p></form><a title='Makepp Homepage' href='http://makepp.sourceforge.net/'><img src='makepp.png' alt='Makepp'/></a><div><a href='http://makepp.sourceforge.net/'><img title='Makepp Homepage' id='_home' src='tabs.png' alt='Home'/></a><a href='makepp_faq.html'><img title='Frequently Asked Questions' id='_faq' src='tabs.png' alt='FAQ'/></a><a href='http://makepp.sourceforge.net/gallery/'><img title='Gallery' id='_gallery' src='tabs.png' alt='Gallery'/></a><a href='http://sourceforge.net/projects/makepp/files/2.1/snapshots/'><img title='Download' id='_download' src='tabs.png' alt='Download'/></a><a href='https://sourceforge.net/projects/makepp/'><img title='Makepp on SourceForge' id='_sourceforge' src='tabs.png' alt='SourceForge'/></a><a href='http://search.cpan.org/dist/makepp/'><img title='Makepp on CPAN' id='_cpan' src='tabs.png' alt='CPAN'/></a></div></div><ul><li id='_close'><script type='text/javascript'>r()</script><span title='Flip side' onclick='lr(this)'></span><span title='Collapse' onclick='roll(this)'></span><span title='Expand' onclick='roll(this,1)'>¤</span><span title='Close' onclick='nonav(this)'>×</span></li><li class='fold' onclick='fold(this)'>Overview<ul><li><a href='index.html'>Introduction</a></li><li><a href='makepp_tutorial.html'>Tutorial</a></li><li><a href='makepp_tutorial_compilation.html'>Compilation Tutorial</a></li><li><a href='makepp_release_notes.html'>Release Notes</a></li><li><a href='makepp_compatibility.html'>Compatibility</a></li><li><a href='makepp_incompatibilities.html'>Incompatibilities</a></li><li><a href='makepp_speedup.html'>Speedup</a></li><li><a href='perl_performance.html'>Perl Performance</a></li></ul></li><li class='fold' onclick='fold(this)'>Q&amp;A<ul><li><a href='makepp_cookbook.html'>Cookbook</a></li><li><a href='makepp_faq.html'>FAQ</a></li></ul></li><li id='_act' class='unfold' onclick='fold(this)'><b>Features</b><ul><li><a href='makepp_build_algorithm.html'>Build Algorithm</a></li><li><a href='makepp_build_cache.html'>Build Cache</a></li><li><a href='makepp_build_check.html'>Build Check Methods</a></li><li><a href='makepp_builtin.html'>Builtin Rules</a></li><li><a href='makepp_builtins.html'>Builtin Commands</a></li><li><a href='makepp_extending.html'>Extending</a></li><li><a href='makepp_functions.html'>Functions</a></li><li><a href='makepp_repositories.html'>Repositories</a></li><li><a href='makepp_rules.html'>Rules</a></li><li><a href='makepp_sandboxes.html'>Sandboxes</a></li><li><a href='makepp_scanning.html'>Scanning</a></li><li><b>Signatures</b></li><li><a href='makepp_statements.html'>Statements</a></li><li><a href='makepp_variables.html'>Variables</a></li></ul></li><li class='fold' onclick='fold(this)'>Commands<ul><li><a href='makepp_command.html'>makepp,&nbsp; mpp</a></li><li><a href='makeppbuiltin.html'>makeppbuiltin,&nbsp; mppb</a></li><li><a href='makeppclean.html'>makeppclean,&nbsp; mppc</a></li><li><a href='makeppgraph.html'>makeppgraph,&nbsp; mppg</a></li><li><a href='makeppinfo.html'>makeppinfo,&nbsp; mppi</a></li><li><a href='makepplog.html'>makepplog,&nbsp; mppl</a></li><li><a href='makeppreplay.html'>makeppreplay,&nbsp; mppr</a></li></ul></li><li><a href='makepp_index.html'>Index</a></li></ul><div id='_main'><h1>Makepp Signatures</h1><p><b>How makepp knows when files have changed</b></p><ul><li><a href="#mpp__signature_methods_included_in_the_distribution">Mpp::Signature methods included in the distribution</a></li><li><a href="#extending_applicability">Extending applicability</a></li><li><a href="#shortcomings">Shortcomings</a></li><li><a href="#custom_methods">Custom methods</a></li></ul><p><b>C:</b>&nbsp;<a href="makeppreplay.html#c">C</a>, <a href="makeppreplay.html#c">c_compilation_md5</a>,&nbsp; <b>M:</b>&nbsp;<a href="#md5">md5</a>,&nbsp; <b>P:</b>&nbsp;<a href="#plain">plain</a>,&nbsp; <b>S:</b>&nbsp;<a href="#shared_object">shared_object</a>,&nbsp; <b>X:</b>&nbsp;<a href="#xml">xml</a>, <a href="#xml">xml_space</a></p><p>Each file is associated with a <i>signature</i>, which is a string that changes if the file has changed. Makepp compares signatures to see whether it needs to rebuild anything. The default signature for files is a concatenation of the file's modification time and its size, unless you're executing a C/C++ compilation command, in which case the default signature is a cryptographic checksum on the file's contents, ignoring comments and whitespace. If you want, you can switch to a different method, or you can define your own signature functions.</p><p>How the signature is actually used is controlled by the <i>build check method</i> (see <a href="makepp_build_check.html">makepp_build_check</a>). Normally, if a file's signature changes, the file itself is considered to have changed, and makepp forces a rebuild.</p><p>If makepp is building a file, and you don't think it should be, you might want to check the build log (see <a href="makepplog.html">makepplog</a>). Makepp writes an explanation of what it thought each file depended on, and why it chose to rebuild.</p><p>There are several signature methods included in makepp. Makepp usually picks the most appropriate standard one automatically. However, you can change the signature method for an individual rule by using <a href="makepp_rules.html#signature_signature_method"><tt>:<b>signature</b></tt></a> modifier on the rule which depends on the files you want to check, or for all rules in a makefile by using the <a href="makepp_statements.html#signature_name"><tt><b>signature</b></tt></a> statement, or for all makefiles at once using the <a href="makepp_command.html#m_method"><tt><b>-</b>m</tt> or <tt><b>--</b>signature-method</tt></a> command line option.</p><p></p><h2 id="mpp__signature_methods_included_in_the_distribution">Mpp::Signature methods included in the distribution</h2><dl><dt id="plain"><b>plain (actually nameless)</b></dt><dd><p>The plain signature method is the file's modification time and the file's size, concatenated. These values are quickly obtainable from the operating system and almost always change when the file changes. For symlinks it uses the values of the linkee. If there is no linkee, i.e. it's a dangling symlink, then it uses its own values, but prepends a <tt>0</tt> to mark the fact.</p><p>Makepp used to look only at the file's modification time, but if you run makepp several times within a second (e.g., in a script that's building several small things), sometimes modification times won't change. Then, hopefully the file's size will change.</p><p>If the case where you may run makepp several times a second is a problem for you, you may find that using the <a href="#md5"><tt>md5</tt></a> method is somewhat more reliable. If makepp builds a file, it flushes its cached MD5 signatures even if the file's date hasn't changed.</p><p>For efficiency's sake, makepp won't reread the file and recompute the complex signatures below if this plain signature hasn't changed since the last time it computed it. This can theoretically cause a problem, since it's possible to change the file's contents without changing its date and size. In practice, this is quite hard to do so it's not a serious danger. In the future, as more filesystems switch to timestamps of under a second, hopefully Perl will give us access to this info, making this failsafe.</p></dd><dt id="c"><b>C</b></dt><dt id="c_compilation_md5"><b>c_compilation_md5</b></dt><dd><p>This is the method for input files to C like compilers. It checks if a file's name looks like C or C++ source code, including things like Corba IDL. If it does, this method applies. If it doesn't, it falls back to plain signatures for binary files (determined by name or else by content) and else to <a href="#md5">md5</a>.</p><p>The idea is to be independent of formatting changes. This is done by pulling everything up as far as possible, and by eliminating insignificant spaces. Words are exempt from pulling up, since they might be macros containing <tt>__LINE__</tt>, so they remain on the line where they were.</p><pre>// ignored comment

#ifdef XYZ
    #include &lt;xyz.h&gt;
#endif

int a = 1;

#line 20
void f
(
    int b
)
{
<i>a</i> += b + ++c;
}

    /* more ignored comment */</pre><p>is treated as though it were</p><pre>#ifdef XYZ
#include&lt;xyz.h&gt;
#endif



int a=1;
#line 20
void f(

int b){


<i>a</i>+=b+ ++c;}</pre><p>That way you can reindent your code or add or change comments without triggering a rebuild, so long as you don't change the line numbers. (This signature method recompiles if line numbers have changed because that causes calls to <tt>__LINE__</tt> and most debugging information to change.) It also ignores whitespace and comments <b>after</b> the last token. This is useful for preventing a useless rebuild if your VC adds lines at a <tt>$</tt><tt>Log$</tt> tag when checking in.</p><p>This method is particularly useful for the following situations:</p><ul><li><p>You want to make changes to the comments in a commonly included header file, or you want to reformat or reindent part of it. For one project that I worked on a long time ago, we were very unwilling to correct inaccurate comments in a common header file, even when they were seriously misleading, because doing so would trigger several hours of rebuilds. With this signature method, this is no longer a problem.</p></li><li><p>You like to save your files often, and your editor (unlike emacs) will happily write a new copy out even if nothing has changed.</p></li><li><p>You have C/C++ source files which are generated automatically by other build commands (e.g., yacc or some other preprocessor). For one system I work with, we have a preprocessor which (like yacc) produces two output files, a <tt>.cxx</tt> and a <a href="makeppreplay.html#h"><tt>.h</tt></a> file:</p><pre><em>%.h %.cxx</em>: %.qtdlg $(<i>HLIB</i>)/Qt/qt_dialog_generator
    $(<i>HLIB</i>)/Qt/qt_dialog_generator $(<i><b>input</b></i>)</pre><p>Every time the input file changed, the resulting <i class="file">.h</i> file also was rewritten, and ordinarily this would trigger a rebuild of everything that included it. However, most of the time the contents of the <i class="file">.h</i> file didn't actually change (except for a comment about the build time written by the preprocessor), so a recompilation was not actually necessary.</p></li></ul><p>Actually in practice this saves less recompiles than you'd hope for, because mere comment changes often add lines. In order for logging with <tt>__LINE__</tt> or the debugger to match your source, this requires recompilation. So this signature is specially useless for the <tt>tangle</tt> family of tools from literate programming, where your code resides in some bigger file and even changes to a documentation section irrelevant to code will be reflected in the extracted source via a <tt>#line</tt> directive.</p><p>If you can live with wrong line numbers during development, you can set the variable <a href="makepp_variables.html#makepp_signature_c_flat"><tt>makepp_signature_C_flat</tt></a> (with an uppercase C) to some true value (like <tt>1</tt>). Then, whereas the compiler still sees the real file, the above example will be flattened for signing as:</p><pre>#ifdef XYZ
#include&lt;xyz.h&gt;
#endif
int a=1;void f(int b){a+=b+ ++c;}</pre><p>Note that signatures are only recalculated when files change. So you can build for everyone in a repository without this option, and those who want the option can set it when building in their sandbox. When they first locally change a file, even only trivially, that will cause a recompilation, because with this option a totally different signature is calculated. But then they can reformat the file as much as they want without further recompilation.</p><p>The opposite is also true: Just omitting this option after it was set and recompiling will not fix your line numbers. So, if line numbers matter, don't do a production build in the same sandbox without <a href="makeppclean.html">cleaning</a> first.</p></dd><dt id="md5"><b>md5</b></dt><dd><p>This is the default method, for files not recognized by the <a href="#c">C</a> method. Computes an MD5 checksum of the file's contents, rather than looking at the file's date or size. This means that if you change the date on the file but don't change its contents, makepp won't try to rebuild anything that depends on it.</p><p>This is particularly useful if you have some file which is often regenerated during the build process that other files depend on, but which usually doesn't actually change. If you use the <a href="#md5"><tt>md5</tt></a> signature checking method, makepp will realize that the file's contents haven't changed even if the file's date has changed. (Of course, this won't help if the files have a timestamp written inside of them, as archive files do for example.)</p></dd><dt id="shared_object"><b>shared_object</b></dt><dd><p>This method only works if you have the utility <tt>nm</tt> in your path, and it accepts the <tt><b>-</b>P</tt> option to output Posix format. In that case only the names and types of symbols in dynamically loaded libraries become part of their signature. The result is that you can change the coding of functions without having to relink the programs that use them.</p><p>In the following command the parser will detect an implicit dependency on <i class="file">$(<i>LIBDIR</i>)/libmylib.so</i>, and build it if necessary. However the link command will only be reperformed whenever the library exports a different set of symbols:</p><pre><em>myprog</em>: $(<i>OBJECTS</i>) :<b>signature</b> <em>shared_object</em>
    $(<i>LD</i>) -L$(<i>LIBDIR</i>) -lmylib $(<i><b>inputs</b></i>) -o <em>$(<i><b>output</b></i>)</em></pre><p>This works as long as the functions' interfaces don't change. But in that case you'd change the declaration, so you'd also need to change the callers.</p><p>Note that this method only applies to files whose name looks like a shared library. For all other files it falls back to <a href="#c_compilation_md5"><tt>c_compilation_md5</tt></a>, which may in turn fall back to others.</p></dd><dt id="xml"><b>xml</b></dt><dt id="xml_space"><b>xml_space</b></dt><dd><p>These are two similar methods which treat xml canonically and differ only in their handling of whitespace. The first completely ignores it around tags and considers it like a single space elsewhere, making the signature immune to formatting changes. The second respects any whitespace in the xml, which is necessary even if just a small part requires that, like a <tt>&lt;pre&gt;</tt> section in an xhtml document.</p><p>Common to both methods is that they sign the essence of each xml document. Presence or not of a BOM or <a href="#xml"><tt>&lt;?xml?&gt;</tt></a> header is ignored. Comments are ignored, as is whether text is protected as <tt>CDATA</tt> or with entities. Order and quoting style of attributes doesn't matter, nor does how you render empty tags.</p><p>For any file which is not valid xml, or if the Expat based <tt>XML::Parser</tt> or the <tt>XML::LibXML</tt> parser is not installed, this falls back to method md5. If you switch your Perl installation from one of the parsers to the others, makepp will think the files are different as soon as their timestamp changes. This is because the result of either parser is logically equivalent, but they produce different signatures. In the unlikely case that this is a problem, you can force use of only <tt>XML::LibXML</tt> by setting in Perl:</p><pre>$Mpp::Signature::xml::libxml = 1;</pre></dd></dl><p></p><h2 id="extending_applicability">Extending applicability</h2><p>The <a href="#c"><tt>C</tt></a> or <a href="#c_compilation_md5"><tt>c_compilation_md5</tt></a> method has a built in list of suffixes it recognizes as being C or C-like. If it gets applied to other files it falls back to simpler signature methods. But many file types are syntactically close enough to C++ for this method to be useful. Close enough means C++ comment and string syntax and whitespace is meaningless except one space between words (and C++'s problem cases <tt><b>-</b> -</tt>, <tt>+ +</tt>, <tt>/ *</tt> and <tt>&lt; &lt;</tt>).</p><p>It (and its subclasses) can now easily be extended to other suffixes. Anyplace you can specify a signature you can now tack on one one of these syntaxes to make the method accept additional filenames:</p><dl><dt id="c_suffix1_suffix2_suffix3"><b>C.<i>suffix1,suffix2,suffix3</i></b></dt><dd><p>One or more comma-separated suffixes can be added to the method by a colon. For example <tt>C.ipp,tpp</tt> means that besides the built in suffixes it will also apply to files ending in <i class="file">.ipp</i> or <i class="file">.tpp</i>, which you might be using for the inline and template part of C++ headers.</p></dd><dt id="c_suffix_regexp"><b>C.(<i>suffix-regexp</i>)</b></dt><dd><p>This is like the previous, but instead of enumerating suffixes, you give a Perl regular expression to match the ones you want. The previous example would be <tt>C.(ipp|tpp)</tt> or <tt>C.([it]pp)</tt> in this syntax.</p></dd><dt><b>C(<i>regexp</i>)</b></dt><dd><p>Without a dot the Perl regular expression can match anywhere in the file name. If it includes a slash, it will be tried against the fully qualified filename, otherwise only against the last part, without any directory. So if you have C++ style suffixless headers in a directory <i class="file">include</i>, use <a href="#c"><tt>C(include/)</tt></a> as your signature method. However the above suffix example would be quite nasty this way, <a href="#c"><tt>C(\.(?:ipp|tpp)$$)</tt></a> or <a href="#c"><tt>C(\.[it]pp$$)</tt></a> because <tt>$</tt> is the expansion character in makefiles.</p></dd></dl><p></p><h2 id="shortcomings">Shortcomings</h2><p>Signature methods apply to all files of a rule. Now if you have a compiler that takes a C like source code and an XML configuration file you'd either need a combined signature method that smartly handles both file types, or you must choose an existing method which will not know whether a change in the other file is significant.</p><p>In the future signature method configuration may be changed to filename-pattern, optionally per command.</p><p></p><h2 id="custom_methods">Custom methods</h2><p>You can, if you want, define your own methods for calculating file signatures and comparing them. You will need to write a Perl module to do this. Have a look at the comments in <tt>Mpp/Signature.pm</tt> in the distribution, and also at the existing signature algorithms in <tt>Mpp/Signature/*.pm</tt> for details.</p><p>Here are some cases where you might want a custom signature method:</p><ul><li><p>When you want all changes in a file to be ignored. Say you always want <i class="file">dateStamp.o</i> to be a dependency (to force a rebuild), but you don't want to rebuild if only <i class="file">dateStamp.o</i> has changed. You could define a signature method that inherits from <a href="#c_compilation_md5"><tt>c_compilation_md5</tt></a> that recognizes the <i class="file">dateStamp.o</i> file by its name, and always returns a constant value for that file.</p></li><li><p>When you want to ignore part of a file. Suppose that you have a program that generates a file that has a date stamp in it, but you don't want to recompile if only the date stamp has changed. Just define a signature method similar to <a href="#c_compilation_md5"><tt>c_compilation_md5</tt></a> that understands your file format and skips the parts you don't want to take into account.</p></li></ul><hr/><address>Last modified: 2012-12-29</address></div><div id='_clear'/></body></html>