The first version of G-Cows was written in 2002, mainly for creating small web sites. Later, people started using it for larger sites (thousand of pages), and performances started becoming as issue.
A new way to handle dependencies has been added in version 1.7; to enable it use the --fast switch:
cows-mkgen --fast
or put the following line in Makefile.cm:
fast:
Warning: Fast mode is about ten times faster than standard one; to achieve these performances some restrictions have been introduced. SIMPLY USING THE 'fast mode' FLAG ON PREEXISTING PROJECTS CAN LEAD TO WRONG MAKEFILES.
The rest of this section will explain these restrictions.
In fast mode Cows-mkgen parses every file separately. Consider the following situation:
File about.cws:
<cows> include ("common.cws"); include ("header_cws"); </cows>
File common.cws:
include ("definitions.cws"); dir.root = linkadjust ();
File header_cws:
include ("foo.cws") type: <html> <head> ... endtype;
This is OK in standard mode: Cows-mkgen parses about.cws and the included files recursively (common.cws, definitions.cws, header_cws and foo.cws).
In fast mode Cows-mkgen doesn't parse included files: it simply keep track of the dependency. In this example Cows-mkgen will parse about.cws and record the dependency from common.cws and header_cws.
Problem arises when Cows-mkgen finds common.cws: this file misses <cows>...</cows> tags so Cows-mkgen won't see the script and will miss the depency from definitions.cws.
Then, Cows-mkgen finds header_cws but won't recognize it as a source file since it has no '.cws' extension.
Note: both common.cws and header_cws are valid files when included by a script; this is enough for Cows and Cows-mkgen in standard mode but Cows-mkgen in fast mode parses every file separately.
For the same reason, you can't place cows sources in a directory with a nomkegn file (Section 6.7.2): these files woulndn't be parsed and their dependecies would be missed. Use nooutput (Section 6.7.1) instead.
To use fast mode with the example above, use '.cws' extension for every file, and <cows>...</cows> tags around scripts:
File about.cws:
<cows> include ("common.cws"); include ("header.cws"); </cows>
File common.cws:
<cows> include ("definitions.cws"); dir.root = linkadjust (); </cows>
File header_cws:
<cows> include ("foo.cws") type: <html> <head> ... endtype; </cows>
This manual can be downloaded from http://www.g-cows.org/.