There are, in fact, several libraries that should be build. First of all Aldor distinguishes between platform-independent (extension .al) and platform-dependent (extension .a) libraries. ALLPROSE will build both libraries by default whose name is given through the variable LIBRARYNAME.
Additionally, ALLPROSE builds platform-independent and platform-dependent testcases libraries, named through the variable TCLIBRARYNAME. They are used when building and running a testsuite, see test/TestSuite.as and check.
The variables and targets below describe how to build the .al and .a form of a library. The actual name of the library is given through the variable SUBLIBRARYNAME which is either equal to LIBRARYNAME as in Section 33.1 or TCLIBRARYNAME as in Section 41.1.
A typical call to build all the variants (Section 15.2) of the libraries would be the following.
$(MAKE) SUBLIBRARYNAME=$(LIBRARYNAME) SUBLIBPREFIX=$(LIBPREFIX) libraryvariants
|
It will build all the variants as specified through the variable VARIANTSTOBUILD.
Such a call appears in src/Makefile.nw for the generation of the project libraries and in test/Makefile.nw for the generation of the testcases libraries.
The flags that go to the command line of the ALDOR compiler calls are separated into four classes.
The target libraryvariants is used to build a .al and .a library of every variant given through the variable VARIANTSTOBUILD.
From now on we assume that the variable VARIANT is set and build the platform-independent .al and the platform-dependent .a libraries.
The target libraryvariant% is very similar to executablevariant%.
The variable VARIANTADDITIONALFLAGSxxx can be used to give additional flags. It is used in ALLPROSE to add more libraries for the compilation of the testsuite.
The name of the library must be given through the variable SUBLIBRARYNAME. Filenames are prepended by some prefix which must be given through the variable SUBLIBPREFIX.
Furthermore the variable SRCS should list the names of the Aldor source files (without prefix) that lie in the current directory. These files are taken to update the library.
All of these variables should be set in src/Makefile.nw and test/Makefile.nw.
The dependencies in src/Makefile.dep and test/Makefile.dep are intended to be used for the platform-independent .al and the platform-dependent .a library. Therefore FILEEXTENSION is set to either ao or o and LIBPOSTFIX reflects the value of the postfix to SUBLIBRARYNAME together with the extension .al or .a.
The variable FLAGS collects all the commandline parameters for the call of the ALDOR compiler.
An object library as specified by LIB is built if all its members have been updated.
The actual compilation of the .al library looks now relatively easy. Call the ALDOR compiler, move the compiled file to the library replacing an already existing one, and cleaning up.
A member depends on the corresponding .as file and the explicitly listed dependencies in the generated file src/Makefile.dep or test/Makefile.dep. In case of the testcases library with name TCLIBRARYNAME there is another dependency on the generated .signatures.as files as specified in test/Makefile.nw, see Section 41.4.3.
Note that the % below includes the SUBLIBPREFIX.
A member depends on the corresponding .ao file in the .al library and the explicitly listed dependencies in the generated file src/Makefile.dep or test/Makefile.dep.
Note that the % below includes the SUBLIBPREFIX.