MAKEINSTALL for Matlab®

the easy way of distributing matlab toolboxes

Makeinstall needs Matlab 5.3.


Description

You have a created a toolbox with a lot of Matlab files and now you need a simple way to distribute this toolbox? With Makeinstall you will be able to automatically create a single install.m file, which includes a simple installation routine and all the Matlab programmes needed for the toolbox. The install script modifies the system in order to use the toolbox instantly. If the Contents.m file is missing, it will be automatically created. Furthermore the command tbclean will be added to the toolbox folder, which enables to remove the toolbox folder and the entries in startup.m.

This tool uses consequently the Matlab potential, e.g. the Matlab standard variables or commands for modifying the Matlab system (cf. Whitepaper for further details).

Makeinstall is free software; you can redistribute it and/or modify it under the terms of the BSD License.

This programme is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the BSD License for more details.


Usage

Call makeinstall in the toolbox folder or specify this folder with makeinstall tb-folder, for example

    makeinstall CRPtool

In order to initialize some needed variables, call this programme the first time and then modify the entries in the automatically created resource file makeinstall.rc. After modifying the resource file, recall makeinstall or makeinstall tb-folder, respectively.

Please note, that further files will be automatically generated in the toolbox folder if they do not exist yet: Contents.m, info.xml and tbclean.m.

The contents of Contents.m will be generated from the help lines in the M-files. If there are no help lines or if this help text is not correctly placed, a warning message will occur. Please ensure that the help text corresponds with the predefined structure of M-files:

    function p = angle(h)
    % ANGLE Polar angle.
    %   ANGLE(H) returns the phase angles, in radians, of 
    %   a matrix with complex elements. Use ABS for the 
    %   magnitudes.
    p = atan2(imag(h),real(h));
where there is a first help line (H1) below the function line and a following help text. The H1 line is used also by other functions like lookfor. If you like to generate Contents.m automatically with makeinstall although Contents.m already exists, you have to remove the old Contents.m file. Thus, manual modifications will be kept.

The contents of info.xml can be modified with some variables in the resource file makeinstall.rc. However, you have to remove the old info.xml file, if you like to modify it the next time with makeinstall. Thus, manual modifications will be preserved.

The generated file install.m will be stored in the folder, from which makeinstall was called. It contains the installation script and the Matlab programmes from the toolbox. This single file can be sent by email or distributed otherwise. Calling install from the Matlab shell extracts the Matlab programmes into the standard toolbox folder (e.g. ~/matlab/CRPtool or C:\Program Files\Matlab\toolbox\crptool) or a predefined folder (specified during running the Makeinstall script or by calling the install file with a specific folder, e.g. install /my/folder) and, optionally, adds the needed toolbox entry permanently in the Matlab startup.m file (at top or end of the startup.m, default is end). The M-files will be automatically precompiled with pcode. If the toolbox is already installed, the user will be asked whether the old toolbox should be removed and finally replaced.

For each toolbox folder a separate resource file makeinstall.rc can be created. The resource files stores the source and destination directories, the toolbox names and the name of the install file.

To view the text of the BSD License, type makeinstall bsd.


License

This software is licensed under the BSD License.

BSD License

Warning

I give no warranty for the tool. Users should make backup files before playing with it.


Screenshot

The screenshot shows the result of calling install.

screenshot

Example

An illustration of the install script can be examined under the Cross Recurrence Plot Toolbox web site.


Pre-compiling and Compiling of MEX-Files

The install script precompiles the M-files. In principle, it would be also possible to compile potential C or Fortran MEX-files in the same way. However, I have not yet implemented this feature, because I support cross-platform development, and the compiling of MEX-files requires C or Fortran, which is not available on all computers (of course, they could be installed on every platform, but not everyone would like to do this). Moreover, with a consequent vectorized Matlab development the MEX-file progamming is not really necessary.


How to get/ Installation

Put the file makeinstall.m into a folder, which can be found by Matlab (e.g. the matlabroot folder).


Version History

  • Current Version: 3.19 - Last Revision: 2009/06/12 07:50:23
  • 3.18 updated contact data and copyright address
  • 3.17 fixed checksum error on 64bit machines
  • 3.16 several bug fixes and upwards compatibility
  • 3.15 subdirectories support included
  • 3.14 checksum error bug in Matlab 2006a solved
  • 3.13 code optimised and flattened
  • 3.12 pcode bug resolved (R14 incompatibility)
  • 3.11 fixed downwards compatibility of mfilename command
  • 3.10 bug in relative-to-absolute-path conversion fixed
    confusing of DOS and Unix fileseparators resolved
    bug due to DOS line end (CR instead of LF) resolved
    bug due to Makeinstall self packaging resolved (Makeinstall.m now excluded)
  • 3.9 comment combination (for container) changed, small bug fixes
  • 3.8 windoof bug fixed (ocurred during removing of old toolbox)
  • 3.7 change addpath -end to addpath -begin
  • 3.6 CVS compatibility included
  • 3.4 Root folder of the toolbox can be modified; startup.m-entry is now optional
  • 3.3 Writing and reading the installation container is speeded up
  • 3.2 A checksum based test of the archive is included
  • 3.1 Supports sub-directories
  • 3.0 Supports binary data, creates a missing Contents.m file
  • 2.3 Adding clean file for removing toolbox
  • 2.2 Change to more general applicability, usage of resource files
  • 2.1 Minor changes and corrections on the way to a more general applicability
  • 2.0 The install.m file also contains the archive; makeinstall consists only of one file
  • 1.x Undocumented changes and developing stages
  • 1.0 First version, uses two makeinstall files and creates the install.m and an archive file

To Do

  • compression (fast compression)

White Paper

A description about the technology behind the Makeinstall script can be found in a whitepaper.


Bugs/ Problems

Please send me bug reports or if any problem occured. Don't forget to send me the makeinstall.rc and the install.m file (if it was created):

    Norbert2s378.Marwan@gmx.net
    (remove the red part to obtain a valid email address.)


Thanks

I'm grateful for every suggestion and hint which improves this programme. Thanks to Gaetan Koers of Vrije Universiteit Brussel for hints about Windows compatibility and improvement the help-text parser. Thanks also to Volkmar Glauche of University of Hamburg (Universitätsklinikum) and Eduard vander Zwan (Wageningen Universiteit) for usefule hints and comments about the root-folder of the toolbox and the startup.m entries.


Contact

Norbert Marwan, Potsdam, Germany

last changes: Fri, 12 Jun 2009 09:58:06 CEST  
@MEMBER OF PROJECT HONEY POT
Spam Harvester Protection Network
provided by Unspam