Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > by-pkgid > a6d417e36f6bb1154f4c003e6717e298 > files > 159

a-a-p-1.090-2mdv2009.0.noarch.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 27. Differences from make</title><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="A-A-P Recipe Executive"><link rel="up" href="user.html" title="Part II. User Manual"><link rel="prev" href="user-debug.html" title="Chapter 26. Debugging a Recipe"><link rel="next" href="user-filetype.html" title="Chapter 28. Customizing Filetype Detection and Actions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table width="100%" id="navtable"><tbody><tr><td align="left" class="left" width="33%"><b><a href="http://www.a-a-p.org">A-A-P home page</a></b></td><td align="center" class="center" width="34%"><b><a href="index.html">A-A-P Recipe Executive</a></b></td><td align="right" class="right" width="33%"></td></tr><tr><td align="left" class="left"><a accesskey="p" href="user-debug.html">Prev</a></td><td align="center" class="center">User Manual</td><td align="right" class="right"><a accesskey="n" href="user-filetype.html">Next</a></td></tr></tbody></table><hr><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="user-makedif"></a>Chapter 27. Differences from make</h2></div></div></div><p>
An <span class="application">Aap</span> recipe has the same structure as a Makefile.
But there are many differences.
The most important and unexpected ones are mentioned here.
</p><h2><a name="id2659885"></a>Build if file does not exist</h2><p>
In a Makefile a dependency with only a target is not executed if the target
exists.
With <span class="application">Aap</span> the build commands will be executed in more situations:
</p><div class="itemizedlist"><ul type="disc"><li><p>when the build commands were never executed</p></li><li><p>when the build commands have changed</p></li></ul></div><p>

For example, this dependency is often used in a Makefile to create a symbolic
link when it doesn't exist yet:
</p><pre class="programlisting">
    gvim:
        ln -s vim gvim
</pre><p>
  The <span class="application">Aap</span> recipe for this would be:
</p><pre class="programlisting">
    gvim:
        :symlink vim gvim
</pre><p>
When running <span class="application">Aap</span> with this recipe for the first time and the "gvim" link
already exists, you will get an error message.
</p><p>
To avoid this problem, set the buildcheck attribute to an empty string:
</p><pre class="programlisting">
    gvim: {buildcheck=}
        :symlink vim gvim
</pre><p>
Note: if the symbolic link exists but the file that it points to doesn't exist
you still get an error.  That's probably what you want.
</p><h2><a name="id2659819"></a>Use Of Environment Variables</h2><p>
The "make" program uses all environment variables for variables in the
Makefile.  This can cause unexpected results, because you may have a large
number of environment variables and some of them you didn't set yourself thus
don't even know about them.
</p><p>
<span class="application">Aap</span> does not use environment variables for recipe variables.
A few environment variables are explicitly used.  For example, $PATH is used
to locate programs.  To access an environment variable Python code must be
used.  The "os.environ" dictionary stores them.  Example:
</p><pre class="programlisting">
        Home = `os.environ.get("HOME")`
</pre><p>
  Note that some systems are case sensitive (e.g., Unix), some systems are not
  (e.g., MS-Windows).
</p><h2><a name="id2659844"></a>Signatures Instead Of Timestamps</h2><p>
Make checks for outdated files by comparing timestamps.
A target file is considered out-of-date when it's older than one of the source
files.
This means that Make will not notice a source file that was changed back to an
older version.  And Make has big problems when a source file has a timestamp
in the future (happens when the system clock is turned back for some reason).
The target will always be older, thus Make will build it every time.
</p><p>
  The default check for <span class="application">Aap</span> is to use MD5 signatures.
  This means a target is considered out-of-date if one of the source files is
  different from when this target was last build.
  Additionally, a signature is made for the build commands.  If you change the
  commands that build the target it will also be considered out-of-date.
  Mostly this means <span class="application">Aap</span> will build the target in many more situations.
</p><p>
If you want <span class="application">Aap</span> to use timestamps like Make does, set the
<a href="ref-variables.html#var-defaultcheck">$DEFAULTCHECK</a> variable to "newer".
Also see the <a href="ref-attributes.html#check-attribute">check</a> attribute, it can be
used to change the check for a specific dependency.
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="user-debug.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="user.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="user-filetype.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 26. Debugging a Recipe </td><td width="20%" align="center"><a accesskey="h" href="index.html">
		    Contents</a></td><td width="40%" align="right" valign="top"> Chapter 28. Customizing Filetype Detection and Actions</td></tr></table></div></body></html>