                     **********************************
                     *          Autobuild v1.2        *
                     * © 1994-1995 Jan Hendrik Schulz *
                     **********************************

                               Indroduction
                               ~~~~~~~~~~~~
   What is autobuild? Autobuild is an automatic build tool for AmigE. It
can do the same think like the build tool that came with AmigaE v3 if it is
used to build programms which are splitted over several modules, but it
does it automaticly. That meens, you need no .build-file to define the
dependencies etc.

                                 History
                                 ~~~~~~~
v1.0   - First public release

v1.1   - Sources without PROC and EXPORT causing no error anymore.
       - v1.0 doesn't noticed a failing EC or Mac2E sometimes and doesn't
         stop. I hope, this bug is fixed now.
      (- No important changes in this doc-file. You don't need to read
         this docs, if you allready had read the v1.0 docs.)

v1.2   - All Mac2E features are removed, because the new AmigeE v3.1 makes
         Mac2E obsolet.


                    Why using autobuild and not build?
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   If you are writing a big program and splitt the source into several
modules, you have to change the .build-file everytime when you introduce
a new module, or if a source after some changes needs other modules.
   With autobuild, if you have changed the MODULE information in the source,
autobuild sees automaticly the new dependence and acts accordingly.
   And last but not least, unlike build, autobuild sees circular dependen-
cies between the files. And if you call it with FORCE, every file is still
builded only once! (Maybe the new E v3.1 build does this too?!)


                              Requirements
                              ~~~~~~~~~~~~
   To use autobuild you need at least Kickstart 2.04 and AmigaE v3.1
If you still use AmigaE v2.1 then use autobuild v1.1 with Mac2E.


                          How to use autobuild?
                          ~~~~~~~~~~~~~~~~~~~~~
   Autobuild must be called from the shell and it has the following syntax:

     TARGET,FORCE=F/S,PRIVATONLY=PO/S,QUIET=Q/S,ECOPTS=EO/K,ECPATH=EP/K

TARGET      is the name of the file that should be build. (Without the .m
            if it is a module!)

FORCE       tells autobuild to build all files, even if they are allready
            uptodate. (Even with FORCE, every file is build only once!)

PRIVATONLY  Normaly autobuild compares the filedate of EVERY used module
            with the filedate of the target to find out, if the target is
            up to date (newer). If you use PRIVATONLY, only the private
            modules (those which names begin with a *) are testet and
            not those in EMODULES:

QUIET       Only error-messages (and the output of EC) are printed.

ECOPTS      here you can give additional arguments for the EC-call. You
            should write doublequotes around them! Autobuild calls EC like
            this: EC <file> <ecopts>
            Example: autobuild target ECOPTS "QUIET"

ECPATH      You can tell autobuild where to find EC and than autobuild
            copies EC to RAM:EC (if needed) and uses RAM:EC instead of EC.
            Example: autobuild target ECPATH "Work:AmigaE/Bin/EC"


                          The .autobuild file
                          ~~~~~~~~~~~~~~~~~~~
   To make the autobuild call easier, autobuild looks for a file called
".autobuild" in the currend directory and if it exists, the first line of
this file is passed through ReadArgs() with the template above. So normaly
you can execute autobuild without any arguments. If you use arguments and
additionaly there is an .autobuild-file, both are mixed like this:

TARGET, ECOPTS and ECPATH:
   If you give them with the commandline, the corresponding .autobuild
   setting is ignored.
   
FORCE, PRIVATEONLY and QUIET:
   The commandline and the .autobuild-settings are Eor()ed.


                        How does autobuild work?
                        ~~~~~~~~~~~~~~~~~~~~~~~~
   To see, how autobuild works, I think it's the best way to show you how
the most important PROC of autobuild - build() - works. If you call
autobuild e.g. with 'autobuild abc' then main() calls, after some initial
work, build() with 'abc' as target. And build() works like this:

                        *-----------------------*
                        |   PROC build(target)  |
                        *-----------+-----------*
                                    |
                     +--------------+--------------+
                     | Look into 'target.e' to see |
                     | which emodules are used by  |
                     | this source.                |
                     +--------------+--------------+
                                    |
                     +--------------+--------------+
                     | Call build() for every used |
                     | privat emodule to make them |
                     | up to date if necessary     |
                     +--------------+--------------+
                                    |
                     ?--------------+--------------?
                     |      Exists 'target'        |
             +---NO--+     (or 'target.m') ?       |
             |       ?--------------+--------------?
             |                      | YES
             |       ?--------------+--------------?
             |       |  Is 'target.e' newer than   |
             +--YES--+ 'target' (or 'target.m') ?  |
             |       ?--------------+--------------?
             |                      | NO
             |       ?--------------+--------------?
             |       | Is at least one of the used |
             +--YES--+ emodules newer than 'target'|
              \      |      (or 'target.m') ?      |
               \     ?--------------+--------------?
                \                   | NO
   +-------------+-------------+    |
   | Call EC to build an up to |    |
   | date 'target'-file        |    |
   | (or 'target.m'-file )     |    |
   +-------------+-------------+    |
                 |                  |
                 +----------------+ |
                                   \|
                                *---+---*
                                |  END  |
                                *-------*

   The above shoud only give an idea what the PROC build() does. The real
PROC build() works a little bit different! It has some lists in memory to
build every file only once, and to look for the filedate of a file only
once for example, but the result is the same.


                          Some important infos!
                          ~~~~~~~~~~~~~~~~~~~~~
-  Autobuild reads the source only until it finds the first PROC or EXPORT
keyword to make things faster. Is there no PROC or EXPORT, the whole file
is read.

-  To make autobuild not to complicate, the keywords MODULE, PROC and
EXPORT must be on the beginning of the line! (No leading spaces or tabs.)
If they are not at the beginning of the line, autobuild doesn't see them!
On the other hand, if you use the keyword in other situations (e.g.
MODULE after an OPT), make shure that it is NOT at the beginning of the
line to make it invisible for autobuild!


                          Copyright and Author
                          ~~~~~~~~~~~~~~~~~~~~
         Autobuild is (c) copyright 1994-1995 Jan Hendrik Schulz

   Redistributing autobuild is allowed, as long as all files are included
and unchanged, and as long as no profit (direct or indirect) is made by
distributing autobuild!

   Autobuild is giftware, if you use it, send me something usefull (money,
an Amiga 4000 or at least a postcard or an e-mail).
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           My address:   Jan Hendrik Schulz
                         Reinhard-Raffalt-Str. 41
                         94036 Passau
                         Germany

             Internet:   schulzj@fmi.uni-passau.de


                             Disclaimer
                             ~~~~~~~~~~
    THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
 HOLDER AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
 COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY REDISTRIBUTE THE
 PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
 OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
 THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.

