W1086 Merlin Build System

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Cranes in the Port of Bremerhaven

Prerequisites[edit]

Background[edit]

A Brief History of the Make Utility

Make originated with a visit from Steve Johnson (author of yacc, etc.), storming into my office, cursing the Fates that had caused him to waste a morning debugging a correct program (bug had been fixed, file hadn't been compiled, cc *.o was therefore unaffected). As I had spent a part of the previous evening coping with the same disaster on a project I was working on, the idea of a tool to solve it came up. It began with an elaborate idea of a dependency analyzer, boiled down to something much simpler, and turned into Make that weekend. Use of tools that were still wet was part of the culture. Makefiles were text files, not magically encoded binaries, because that was the Unix ethos: printable, debuggable, understandable stuff. - Stuart Feldman, The Art of Unix Programming, Eric S. Raymond 2003

Introduction[edit]

As we begin our journey through Computer Science and, in particular, programming, we'll need to learn how to build our projects. In some cases building a project (in any language) is a trivial process, in other cases it can be quite complex. The Merlin Build System abstracts away these potential complexities through a series of simple commands.

Build[edit]

In order to build any Merlin project, ensure that your current directory is either in the project root or some child directory of that root. Then execute the build command:

john-williams@codermerlin:~/Merlin/M1272-10 Comparisons/C101 Is It Greater [Swift]$  build

Run[edit]

In order to run any Merlin project, ensure that your current directory is either in the project root or some child directory of that root. Then execute the run command:

john-williams@codermerlin:~/Merlin/M1272-10 Comparisons/C101 Is It Greater [Swift]$  run

Dynamic Libraries[edit]

In some cases you'll need to use dynamic libraries. The Merlin Build System will manage the configuration settings to make this happen, but you'll need to edit a simple text file first. The file needs to be located in the same directory as make.sh and must be called dylib.manifest.

File Format of dylib.manifest[edit]

There are two line formats. The first is for system-versioned libraries:

project version

For example:

Scenes 0.9.1

The second format facilitates simple development of libraries by easily allowing a local directory as a source.

project LOCAL path

For example:

Igis    LOCAL /home/john-williams/projects/Igis

An additional available option is to suffix the modifier 'MODULE' after either line format. This has the result of suppressing the suffix of ".build/$configuration" to the libraryPath. This is appropriate for Modules which don't have a build process, such as CNCURSES.

For example:

CNCURSES   1.0.0 MODULE

Thus, a complete example would be:

Igis    LOCAL /home/john-williams/projects/Igis
Scenes  0.9.1
Curses  1.0.0
CNCURSES 1.0.0 MODULE

Listing Dynamic Libraries[edit]

In order to list the dynamic libraries used in any Merlin project, ensure that your current directory is either in the project root or some child directory of that root. Then execute the dylib command:

john-williams@codermerlin:~/Experiences/ScenesShell$  dylib

Note that nothing will be displayed if no error occurs and no dynamic libraries have been used.

Emacs Integration[edit]

If you are using dynamic libraries you may need to generate a configuration file for emacs. In most cases, this won't be necessary, because the Shell repository will include the required configuration files for you. However, if you're building a project on your own or your want to use your own libraries, you'll need to create the configuration file yourself. Be sure that you're in the root of your project, the same location as the make.sh and dylib.manifest files. Then, execute the dylibEmacs command:

john-williams@codermerlin:~/Experiences/ScenesShell$  dylibEmacs

Key Concepts[edit]

References[edit]