Atelier B projects are stored in ${HOME}/AB by default. These notes assume this default, so please adapt to your customization (if any). Basic Setup -------------------------------------------------------------------------------- 1. Create a new directory for the local workspace, for instance : mkdir ${HOME}/ABWS 2. Launch Atelier B with the command startAB, and acknowledge the BBatch error message (which is due to the default workspace /opt/.../AB/press/bdb being read-only. Then, create a new workspace via Atelier B / New / Workspace... and set it as follows: Name: Pick a name (e.g., `Home') Database directory: browse to the directory created previously Connect automatically: ticked 3. In Atelier B / Preferences / Projects, set the default project type to Software development. 4. Remove the default workspace name `local'. 5. Quit Atelier B with Ctrl-Q. Add the Library -------------------------------------------------------------------------------- 1. Download and extract the Atelier B archive containing the library: cd /tmp wget http://www.tools.clearsy.com/images/4/48/TarLIBRARY-comenc.arc.zip unzip TarLIBRARY-comenc.arc.zip 2. Launch Atelier B. 3. Select Workspace / Restore Project, and fill the blank fields as follows: Archive path: /tmp/tarLIBRARY-comenc.arc new project name: LIBRARY The destination directory is set automatically. Leave the restoration parameter to `Whole project', and click Next. 4. Quit Atelier B with Ctrl-Q. 5. Delete the temporary files created in step 1: rm /tmp/TarLIBRARY-comenc.arc.zip /tmp/tarLIBRARY-comenc.arc To use LIBRARY components in a project Foo, the project LIBRARY must be added to Foo's libraries in Project / Properties. Building -------------------------------------------------------------------------------- Proceed as follows to build an executable for project Foo. 1. Generate the code of (the desired subset of) components in project Foo. 2. Create a directory to store build files: mkdir ${HOME}/AB/Foo/build 3. Put the makefile provided with these notes in the directory created in the previous step. 4. Create, in the same directory, a C source file with a main() function. The main() function should simply call the operation providing the entry point. For instance, if the entry point is the operation `display' of the component `Hello', the C source file could be: #include "Hello.h" int main() { Hello__display(); } 5. In the makefile, set the variable main to the name of this C source file, but without the .c suffix. 6. Run `make' in the build directory. Uninstallation -------------------------------------------------------------------------------- Atelier B stores the user's configuration in ${HOME}/.config/ClearSy/. Remove this directory if you need to start from scratch.