| 1 |
|
| 2 |
<HTML> |
| 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 |
<HEAD> |
| 29 |
<TITLE>5.10 FunnelWeb and Make</TITLE> |
| 30 |
<STYLE TYPE="text/css"> <!-- A {text-decoration: none} // --> </STYLE> |
| 31 |
</HEAD> |
| 32 |
<BODY BACKGROUND="binary/background.gif" |
| 33 |
BGCOLOR="#FFFFFF" |
| 34 |
TEXT="#000000" |
| 35 |
VLINK="#660000" |
| 36 |
LINK="#FF0000" |
| 37 |
ALINK="#CC0000"> |
| 38 |
|
| 39 |
<TABLE WIDTH="490"> |
| 40 |
<TR> |
| 41 |
<TD WIDTH="130" VALIGN="top"> |
| 42 |
<IMG SRC="binary/d_clear.gif" ALT="" WIDTH="130" HEIGHT="1"><BR> |
| 43 |
|
| 44 |
<FONT SIZE="2"> |
| 45 |
<BR> |
| 46 |
|
| 47 |
<A HREF="http://www.ross.net/" |
| 48 |
TARGET="rosshome" |
| 49 |
onClick="window.open('','rosshome','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 50 |
> |
| 51 |
<IMG SRC="binary/rossnet_logo.gif" |
| 52 |
WIDTH="64" HEIGHT="32" |
| 53 |
BORDER="0" ALT="RossNet" |
| 54 |
HSPACE="0" VSPACE="1"></A><BR> |
| 55 |
<BR> |
| 56 |
|
| 57 |
<A HREF="../index.shtml" |
| 58 |
TARGET="funnelweb" |
| 59 |
onClick="window.open('','funnelweb','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 60 |
> |
| 61 |
<IMG SRC="binary/linklogo.gif" |
| 62 |
WIDTH="64" HEIGHT="32" |
| 63 |
BORDER="0" ALT="FunnelWeb" |
| 64 |
HSPACE="0" VSPACE="1"></A><BR> |
| 65 |
<BR> |
| 66 |
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD BGCOLOR="#000000"> |
| 67 |
<A HREF="../reference/index.html" |
| 68 |
TARGET="funnelwebreference" |
| 69 |
onClick="window.open('','funnelwebreference','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 70 |
><FONT COLOR="#FFFFFF"><B>Reference</B></FONT></A><BR> |
| 71 |
<BR> |
| 72 |
<A HREF="../developer/index.html" |
| 73 |
TARGET="funnelwebdeveloper" |
| 74 |
onClick="window.open('','funnelwebdeveloper','location,status,menubar,scrollbars,resizable',false).focus(); return true;" |
| 75 |
><FONT COLOR="#FFFFFF"><B>Developer</B></FONT></A><BR> |
| 76 |
<BR> |
| 77 |
<A HREF="index.html"><FONT COLOR="#FFFFFF"><B>Tutorial</B></FONT></A><BR> |
| 78 |
<A HREF="intro.html"><FONT COLOR="#FFFFFF">1 Introduction</FONT></A><BR> |
| 79 |
<A HREF="macro.html"><FONT COLOR="#FFFFFF">2 Macros</FONT></A><BR> |
| 80 |
<A HREF="type.html"><FONT COLOR="#FFFFFF">3 Typesetting</FONT></A><BR> |
| 81 |
<A HREF="example.html"><FONT COLOR="#FFFFFF">4 Example</FONT></A><BR> |
| 82 |
<A HREF="hints.html"><FONT COLOR="#FFFFFF">5 Hints</FONT></A><BR> |
| 83 |
<A HREF="examples.html"><FONT COLOR="#FFFFFF">6 Examples</FONT></A><BR> |
| 84 |
<A HREF="web.html"><FONT COLOR="#FFFFFF">7 Webmaking</FONT></A><BR> |
| 85 |
|
| 86 |
<BR> |
| 87 |
<A HREF="search.html"><FONT COLOR="#FFFFFF"><B>SEARCH</B></FONT></A><BR> |
| 88 |
</FONT> |
| 89 |
</TD></TR></TABLE> |
| 90 |
|
| 91 |
|
| 92 |
</TD> |
| 93 |
<TD WIDTH="360" VALIGN="top"> |
| 94 |
<FONT SIZE="3"> |
| 95 |
|
| 96 |
|
| 97 |
<A HREF="../reference/index.html"><IMG SRC="binary/title.gif" |
| 98 |
WIDTH="302" HEIGHT="24" |
| 99 |
BORDER="0" ALT="FunnelWeb Tutorial Manual" |
| 100 |
HSPACE="0" VSPACE="0"></A> |
| 101 |
<P><FONT SIZE="5">5.10 FunnelWeb and Make</FONT><BR> |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
<P>The Unix <SAMP>Make</SAMP> program allows a set of |
| 106 |
dependencies between a set of files to be described, and |
| 107 |
then uses these dependencies to control the way in which the |
| 108 |
files are created and updated. Typically, <SAMP>Make</SAMP> is |
| 109 |
used to control the process of transforming a collection of |
| 110 |
source code files to one or more executable files. As the |
| 111 |
use of FunnelWeb implies an extra stage to this process, it |
| 112 |
is natural to include the transformation of <SAMP>.fw</SAMP> |
| 113 |
files to source code files as part of the <SAMP>Make</SAMP> |
| 114 |
process. This is easy to do, but the user should be aware of |
| 115 |
one aspect of FunnelWeb which can cause problems. |
| 116 |
|
| 117 |
<P>It is often useful, when using FunnelWeb, to create a |
| 118 |
FunnelWeb <SAMP>.fw</SAMP> file that generates more than one |
| 119 |
product file. That is, a single <SAMP>.fw</SAMP> file may have |
| 120 |
many macro definitions connected to product files so that |
| 121 |
when the FunnelWeb <SAMP>.fw</SAMP> file is processed by |
| 122 |
FunnelWeb, several files are created. For example, this |
| 123 |
facility is convenient for placing a single package's |
| 124 |
<SAMP>.h</SAMP> and <SAMP>.c</SAMP> files within the same |
| 125 |
FunnelWeb <SAMP>.fw</SAMP> file. |
| 126 |
|
| 127 |
<P>The use of multiple product files, however, provokes a |
| 128 |
problem with dependencies. Suppose for example that a |
| 129 |
FunnelWeb <SAMP>prog.fw</SAMP> produces two product files |
| 130 |
<SAMP>proc.spec</SAMP> (a package specification) and |
| 131 |
<SAMP>prog.body</SAMP> (a package body). If the package is |
| 132 |
accessed in the way that packages normally are, it will be |
| 133 |
quite common for the programmer to want to modify the |
| 134 |
package body without modifying the program specification. So |
| 135 |
the programmer will edit the <SAMP>prog.fw</SAMP> file to |
| 136 |
change the package body. The result of running this through |
| 137 |
FunnelWeb will be the desired new package body file. |
| 138 |
However, FunnelWeb will also produce a new package |
| 139 |
specification product file <I>even though it may be |
| 140 |
identical to the previous version!</I> The result is that the |
| 141 |
newly created (with a recent file date) specification |
| 142 |
package file could provoke a huge remake of much of the |
| 143 |
program in which it resides. |
| 144 |
|
| 145 |
<P>To solve the problem, FunnelWeb includes a command line |
| 146 |
option (<SAMP>D</SAMP> for |
| 147 |
Delete), |
| 148 |
which when turned on (using "<TT>+D</TT>") causes FunnelWeb |
| 149 |
to suppress product and |
| 150 |
documentation files that are identical to the previously |
| 151 |
existing versions of the same files. For example, if, during |
| 152 |
a FunnelWeb run, a macro was connected to a product file |
| 153 |
called <SAMP>x.dat</SAMP>, and the macro expanded to |
| 154 |
<I>exactly</I> the same text as is contained in |
| 155 |
<SAMP>x.dat</SAMP> then FunnelWeb would simply <I>never |
| 156 |
write the product file</I> , the file <SAMP>x.dat</SAMP> would be |
| 157 |
untouched and, as a result, no further <SAMP>Make</SAMP> |
| 158 |
propagations would take place. |
| 159 |
|
| 160 |
<P>FunnelWeb implements this feature by writing each |
| 161 |
product file to a temporary file with a temporary file name. |
| 162 |
It then compares the temporary file with the target file. If |
| 163 |
the two are identical, it deletes the temporary file. If the |
| 164 |
two are different it deletes the target file and renames the |
| 165 |
temporary file to the target file. |
| 166 |
|
| 167 |
<P>Use of the <SAMP>D</SAMP> facility means that the |
| 168 |
programmer need not be punished (by extra <SAMP>Make</SAMP> |
| 169 |
propagations) for describing more than one product file in |
| 170 |
the same FunnelWeb file. |
| 171 |
|
| 172 |
|
| 173 |
<P> |
| 174 |
<TABLE WIDTH="100%"> |
| 175 |
<TR> |
| 176 |
<TD ALIGN="left" VALIGN="bottom"><A HREF="hints_default.html"><IMG SRC="binary/fw_left.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Prev"></A></TD> |
| 177 |
<TD ALIGN="center" VALIGN="bottom"><A HREF="hints.html"><IMG SRC="binary/fw_up.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Up"></A></TD> |
| 178 |
<TD ALIGN="right" VALIGN="bottom"><A HREF="hints_dangers.html"><IMG SRC="binary/fw_right.gif" HEIGHT="32" WIDTH="32" BORDER="0" ALT="Next"></A></TD> |
| 179 |
</TR> |
| 180 |
</TABLE> |
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
<HR> |
| 185 |
<FONT SIZE="2"> |
| 186 |
<A HREF="mailto:[email protected]">Webmaster</A> |
| 187 |
<A HREF="copyright.html">Copyright © Ross N. Williams 1992,1999. All rights reserved.</A><BR> |
| 188 |
</FONT> |
| 189 |
|
| 190 |
</FONT> |
| 191 |
</TD> |
| 192 |
</TR> |
| 193 |
</TABLE> |
| 194 |
|
| 195 |
|
| 196 |
</BODY> |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
</HTML> |