5.5 ALLPROSE Files

The ALLPROSE source files consist mainly of the Makefiles and scripts in any directory together with the documentation file allprose.tex.nw which you are currently reading.

There are also some Aldor files provided by ALLPROSE that can serve as templates for new projects. They reside under the subdirectory myalps of the directories src and test. The general include files are in directory include. Tools that support the building process can be found in directory tools.

This section is intended to describe all files that belong to the ALLPROSE framework. These files are used for building the library together with its documentation.

Files that are not mentioned in this section and not tagged via the LATEX command sourcefile will not appear in the documentation. The library files are described in myalps.tex.nw. For each file a short summary should be given

allprose.tex.nw:
This is the file you are currently reading. It describes ALLPROSE in more general terms without going into implementation details.
allprose.sty.nw:
That is a LATEX package. It serves as the only style file for the ALLPROSE and the documentation of the library project MyAlps. It automatically loads several other LATEX packages. In particular it loads myalps.sty.nw where one could customize or add some styles.
aldordoc.sty.nw:
This is a LATEX package specifically devoted to provide styles for Aldor +++ descriptions.
tools/aldordoc2tex.pl.nw:
At the moment aldordoc.sty.nw does not fully implement its proposed interface in TEX. This file is an auxiliary script that translates aldordoc.sty.nw commands appearing in the documentation into aldordoc.sty.nw commands that are actually implemented in TEX. This script should eventually disappear if aldordoc.sty.nw fully implements its interface in TEX.
allprose.4ht.nw:
ALLPROSE produces HTML output of the documentation by means of TEX4ht. A few LATEX commands have to be modified so that TEX4ht works properly and produces output similar to the .dvi output. This file is loaded by TEX4ht as an additional LATEX package at the time the \begin{document} is reached.
Makefile.nw:
This is the top-level Makefile. If mainly deals with setting global variables, generating the code and LATEX files from the Noweb sources, compiling the documentation, installing and uninstalling the compiled libraries, cleaning the directory structure, and upgrading ALLPROSE.

It loads Makefile.def.nw and Makefile.inc.nw.

Makefile.def.allprose.nw:
The original file for Makefile.def.nw if the latter does not exist. The file Makefile.def.nw is considered to be the main interface to ALLPROSE. Makefile.def.nw is included into each Makefile in a (sub)directory.
Makefile.inc.nw:
This file is included in each Makefile in a (sub)directory. It contains common MAKE rules that are generally used.
tools/nwescape.pl.nw:
This Perl script fixes a bug in Noweb 2.10c. It escapes all unpaired and unescaped << and >> by prefixing them with an @ sign. The bug is fixed in Noweb 2.11 only partially.
tools/Makefile.nw:
This file lists the files in the tools directory. The main work is delegated to the included files Makefile.def.nw and Makefile.inc.nw.
include/Makefile.nw:
This file lists the files in the include directory. The main work is delegated to the included files Makefile.def.nw and Makefile.inc.nw.
src/Makefile.nw:
This file list the files in the include directory and includes Makefile.def.nw and Makefile.inc.nw. Furthermore it contains MAKE rules for the compilation of the library.
tools/addaldortypedef.pl.nw:
This Perl script takes an ALLPROSE Noweb form of an Aldor source as standard input and embellishes the documentation part with some information from the code part. Additionally, for types it adds a %def at the end of the code chunk and a showexports command at the beginning of the following line.
tools/aldordoc2codechunk.pl.nw:
This Perl script takes an ALLPROSE Noweb form of an Aldor source as standard input and transforms +++ environments from the .as.nw to +++ descriptions.
tools/showexports2aldordoc.pl.nw:
This Perl script is used in connection with the showexports MAKE target. Instead of writing an exports list by hand, we generated for each type a file TYPENAME.exports.tex by a series of scripts.

This script extracts the addescription environment from the +++ description if the corresponding Aldor code chunk contains a function or constant declaration. It writes out the (embellished) function declaration together with an adshortdescription environment.

tools/asfiles.pl.nw:
The only place where Aldor source files should be made known to ALLPROSE is myalps.tex.nw (projectname.tex). The corresponding .as filenames should be listed in the a separate section and each file must have been tagged by the sourcefile in the Noweb source. This Perl script extracts the names of .as files matching a certain pattern. It is used to generate the files src/Makefile.asfiles and test/Makefiles.asfiles.
tools/dependencies.pl.nw:
This Perl script is intended to generate the files src/Makefile.dep and test/Makefile.dep. This is done by parsing the Aldor source files for constructors that are defined in them and then determining the interdependencies of the files from the constructors that are defined in them.
tools/undocumented.pl.nw:
This Perl script figures out which files of the project do not appear in a short description similar to the list you are currently reading.
tools/api.pl.nw:
This Perl script comments out non-documentation lines. (It is not (yet) in use.)
test/Makefile.nw:
This file is similar to src/Makefile.nw. It includes Makefile.def.nw and Makefile.inc.nw and is used for the generation of the testcases library src/libtestcases.al.
tools/generateTestCases.pl.nw:
This Perl script generates the include file include/testcases.as.
tools/generateTestSuite.pl.nw:
This Perl script generates the executable source file test/TestSuite.as.

During the compilation of the documentation starting with myalps.tex, a file myalps.lsf will be generated in which every call to sourcefile in the whole documentation is listed. We want the files described in the whole documentation (actually only myalps.tex.nw and allprose.tex.nw should count) to match the files listed in the Makefiles.

For the generation of the whole documentation we use allprose.sty.nw and myalps.sty.nw, together with several other packages as defined in allprose.sty.nw.

Among those packages is aldordoc.sty.nw. It contains a number of LATEX commands for the structured documentation of Aldor +++ descriptions. Since not all commands described in the interface of aldordoc.sty.nw come with an actual LATEX implementation in aldordoc.sty.nw, there is a script tools/aldordoc2tex.pl.nw that translates the aldordoc interface to an actual aldordoc implementation. Currently, aldordoc (i. e., aldordoc.sty.nw and tools/aldordoc2tex.pl.nw) is part of ALLPROSE, but in the future it might be distributed separately.

A number of LATEX commands from allprose.sty.nw generate and include the files mentioned in this file (allprose.tex.nw). Local customization is possible through the file local.sty.

In order to produce an .html form of the documentation, we employ TEX4ht. There is some adjustment necessary which we have put into the allprose.4ht.nw. That file is only necessary for TEX4ht.

The top-level Makefile.nw contains all necessary targets to build the complete project.

Convention 2 At the moment one must call MAKE from the PROJECTROOT, because otherwise Makefile variables are not forwarded properly.

Via the file Makefile.def.nw the name of the project and its version should be set. The file Makefile.def.allprose.nw only serves as a template for Makefile.def.nw and is not used if Makefile.def.nw is present. In fact Makefile.def.nw is the only file of ALLPROSE that should and must be changed by a library writer. It is not distributed with ALLPROSE, but will be generated (as a copy of Makefile.def.allprose.nw) the first time that make is called.

The top-level Makefile.nw includes the files Makefile.def.nw and Makefile.inc.nw for targets that are common for the subdirectories.

In fact, Makefile.def.nw and Makefile.inc.nw are included into every Makefile in any subdirectory of the project.

Due to a bug in Noweb we need the script tools/nwescape.pl.nw in order to escape unpaired << and >> occurrences.

It is important that the scripts in the directory tools are available. That is why first the contents of this directory is built via tools/Makefile.nw.

ALLPROSE builds two sets of libraries, one for the project and the other one that collects the testcases of the project. In fact, ALLPROSE builds src/libmyalps.al and test/libtestcases.al and all their variants (see Section 15.2).

The directory include is used for the Aldor source files that are included into other Aldor source files. Basically, the file include/Makefile.nw simply builds the files include/myalps.as.nw and include/testcases.as. The latter is generated by the script tools/generateTestCases.pl.nw mainly in order to get the line

#include "projectname"

correct, where projectname is replaced by the true name of the project (here myalps).

The file include/myalps.as.nw is the main include file that should be included in each .as file that uses the MyAlps library. We also build the library incrementally so that even the MyAlps library source files can include include/myalps.as.nw. It is possible not to load the MyAlps library although include/myalps.as.nw is included.

Similarly, include/testcases.as is included into each testcase file. It is possible not to load the testcases library.

The Aldor source files reside under the directory src. The file src/Makefile.nw includes Makefile.inc.nw, Makefile.def.nw and src/Makefile.dep.

We support the NOWEAVE process by adding definitions of category, domain, and package constructors automatically at the end of a code chunk. This is done by filtering each .as.nw file through the script tools/addaldortypedef.pl.nw.

Furthermore, the target showexports in Makefile.nw produces via the Perl script tools/showexports2aldordoc.pl.nw exports of categories and domains in a LATEX format which will be automatically included into the documentation.

In order to determine the .as files that are about to be compiled, we parse the file myalps.tex.nw for the Perl regular expression

\\sourcefile{[^}]+\.as}

and generate the files src/Makefile.asfiles and test/Makefile.asfiles from the output of the script tools/asfiles.pl.nw.

In fact, ALLPROSE generates two versions of .as files from the corresponding .as.nw files.

  1. The first version is for the compilation of the libraries. This version will contain the +++ environments from the .as.nw file as +++ descriptions. The Perl script tools/aldordoc2codechunk.pl.nw does the necessary transformations on the fly.
  2. The other version just appears with another indentation of the code. It eases the calculation of dependencies of the source files by the Perl script tools/dependencies.pl.nw.

The script tools/dependencies.pl.nw generates the files src/Makefile.dep and test/Makefile.dep.

The file src/Makefile.nw lists targets to generate the Aldor libraries from the sources. It includes the generated file src/Makefile.dep.

Since ALLPROSE is just a framework for building Aldor libraries, it does not require any specific library like, for example, the standard libraries Algebra and Aldor provided by www.aldor.org. However, for building and running the testsuite, ALLPROSE builds on Christian Aistleitner’s AldorUnit and ExtIO libraries which in turn require at least the standard library Aldor. One can specify the libraries to use via the file include/myalps.as.nw and Makefile.def.nw.

The testsuite is built by using test/Makefile.nw. The testfiles will be parsed by the script tools/generateTestSuite.pl.nw in order to generate a file test/TestSuite.as.