home *** CD-ROM | disk | FTP | other *** search
- Makatic tools release 1.00 19 Jan 1996
- ••••••••••••••••••••••••••••••••••••••
-
-
-
- Contents
- ————————
-
- Introduction
- Makatic.Maktic2
- Makatic scripts
- Example projects
- Projects with sub-makefiles
- Files in the Makatic directory
- Motivation for Makatic
- Other things
-
-
-
- Introduction
- ————————————
-
- Makatic is a set of command-line tools which can automate much
- of the management of C, C++ and Assembler projects.
-
- The Makatic tools automatically generate and run makefiles, by
- looking for source files in the project directory, and adding
- equivalent .o filenames to a user-supplied template makefile.
-
- This means that adding or removing a source-file to a project
- doesn't mean one has to edit a makefile, or inform a desktop
- front-end such as '!Make' about the change.
-
- This is particularly helpful with large projects, particularly
- if they involve building different versions of a project from
- the same source code.
-
- Makatic needs a tool to run the makefiles. It has only been
- tested with Acorn's AMU program, but should work with other
- similar programs.
-
-
- Tool names
- ¨¨¨¨¨¨¨¨¨¨
-
- To avoid clashes with other tool names, all Makatic
- tools are within the 'Makatic' directory and you should
- move the whole directory into your Run$Path (instead of
- moving the individual Makatic tools into your
- Run$Path).
-
- This means that Makatic tools should be called with
- (for example) 'Makatic.Makatic2 <parameters>'.
-
-
-
- Makatic.Makatic2
- ————————————————
-
- This is the core tool. It takes a fair number of flags and
- parameters (which are described if you run
- 'Makatic.Makatic2 -help'), so there are some simple Obey
- scripts in the 'Makatic' directory which implement the
- functionality required for some standard project-types.
-
- 'Makatic.Makatic2' will preserve dynamic dependancies in an
- existing makefile, and an existing makefile is only replaced if
- the new version is different.
-
- The generated makefile can be automatically run after it is
- created - this facility is used by the Obey scripts.
-
-
-
- Makatic scripts
- ———————————————
-
- Makatic.Small
- ¨¨¨¨¨¨¨¨¨¨¨¨¨
- Builds small projects with a single output file.
-
- Makatic.Medium
- ¨¨¨¨¨¨¨¨¨¨¨¨¨¨
- This handles more complicated projects which can be
- built in different ways, by sending different flags to
- cc and link. Each different build is put in its own
- subdirectory within the project directory.
-
- Makatic.Large
- ¨¨¨¨¨¨¨¨¨¨¨¨¨
- This is similar to 'Makatic.Medium' except that it
- automatically deals with source files nested to any
- depth within the project directory.
-
-
-
- Notes on using <Obey$Dir>
- ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
-
- All three scripts require the project directory to
- passed as the first parameter. This causes a small
- problem if you pass <Obey$Dir> as this parameter,
- because the scripts are Obey file themselves. This
- means that by the time the script starts, <Obey$Dir>
- will be set to the Makatic tools directory.
-
- The example projects avoid this problem by setting a
- temporary CSD with Acorn's Prefix command, and passing
- '@' to the makatic script.
-
- An alternative would be to force the <Obey$Dir> to be
- expanded before the Makatic script is called. One way
- of doing this is as follows:
-
- 1. Put the following in your !Boot file:
- Set Alias$Do Set Alias$Do2 %%*0 |m Do2 |mUnset Alias$Do2
-
- 2. Call Makatic scripts from an Obey file within
- the project directory with:
- Do Makatic.Small <Obey$Dir>
-
-
-
- Example projects
- ————————————————
-
- In 'Makatic.Examples.' are three example project-types, which
- use the three Obey scripts 'Makatic.Small', 'Makatic.Medium'
- and 'Makatic.Large'. These have all been written for use with
- Acorn's compiler, linker and AMU tool.
-
- The scripts instruct Makatic2 to look for c., c++. and s.
- source code, but only .c code is present in these examples.
-
- Apart from the directory structure and source code, each
- project contains one or more very simple TaskObey files which
- build the project by calling one of the Makatic tools. All
- other files and directories required are automatically created
- by Makatic.
-
-
- Examples.Small
- ¨¨¨¨¨¨¨¨¨¨¨¨¨¨
- This is a simple 'Hello World' C project.
-
- Double-clicking 'MakeIt' builds the !RunImage in a
- taskwindow.
-
-
- Examples.Medium
- ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
- This is similar, except that different versions of the
- program can be built from the same source-code.
- '!Debug.!Run' and '!Normal.!Run' build the two
- versions.
-
- The .o and !RunImage files are built within
- '!Normal' and '!Debug'.
-
-
- Examples.Large
- ¨¨¨¨¨¨¨¨¨¨¨¨¨¨
- This has an additional feature - source code can be
- anywhere within the 'Sources.' directory, in
- arbitrarily-deep subdirectories. This allows one to
- (for example) group related source files together in
- a directory, and also to get around RISC OS's 77 file
- directory limit.
-
- As with 'Examples.Medium', '!Debug.!Run' and
- '!Normal.!Run' build the two versions of the project.
-
-
-
-
- Projects with sub-makefiles
- ———————————————————————————
-
- The script file 'Makatic.MultiBuild' handles large projects
- such as DeskLib which consist of sub-projects containing their
- own makefile.
-
- Unlike the other script files, there isn't an example of such a
- project in the Makatic distribution. Here is a brief
- description of the required directory structure:
-
- Project.
- Libraries.
- <sublib name>.
- c.
- c++.
- s.
-
- Automatically added by
- 'Makatic.MultiBuild <build type>':
- <build type>.
- o.
- Makefile
-
- <build type>.
- TemplateMF Template makefile for
- sublibraries.
-
- TempalteAl Template makefile for whole
- library.
-
- All Made by 'Makatic.MultiBuild
- <build type>'.
-
-
- If you are interested in using 'Makatic.MultiBuild', you will
- need to write two template makefiles for each build-type.
- TemplateMF is similar to the template used in Examples.Medium
- except that it doesn't have to link the .o files together,
- while 'TemplateAl' should use LibFile to join all the .o files
- together.
-
- I will be shortly releasing a preliminary version of my School
- RISC OS class-library which will show how to use
- 'Makatic.MultiBuild'.
-
-
-
-
-
- Files in the Makatic directory
- ——————————————————————————————
-
-
- Makatic.
-
- Tools
- ¨¨¨¨¨
-
- Makatic2 General tool for constructing makefiles from
- template files and running the resulting
- makefile.
-
-
- Scripts
- ¨¨¨¨¨¨¨
-
- Small Obey-file frontend for Makatic for use with
- very simple projects.
-
- Medium Obey-file frontend for Makatic for use with
- projects which can be built in different ways.
-
- Large Obey-file frontend for Makatic for use with
- large projects whose source code is arranged
- in a tree of directories.
-
-
- MultiBuild Completely (re)builds a multi-sublibrary
- project.
-
- MultiLink Used by MultiBuild to create the final library
- from all the .o files. Quicker than MultiBuild
- if no re-compilation is needed.
-
- _EnsureDir Used internally by MultiBuild and MultiLink.
-
-
-
- Documentation and examples
- ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
- Docs.
-
-
-
- !Help This file.
-
- History History of Makatic.
-
-
-
- Examples. Example projects using the Makatic
- system.
-
-
- Small. 'Hello World' C program.
-
- MakeIt TaskObey file which
- builds the program.
-
-
- Medium. 'Hello World' with different
- versions built from the same
- source code using different
- pre-processor #defines.
-
- !Debug.
- !Run Builds debug-version
-
- !Normal
- !Run Builds normal version.
-
-
- Large. 'Hello World' with different
- builds, and demonstrating the
- use of different subdirectories
- for source code.
-
- Sources. All source code, in
- arbitrary
- sub-directories.
-
- !Normal Builds normal version.
- !Debug Builds debug version.
-
- Sources. Automatically-
- created
- duplicate of
- 'Large.Sources.'
- tree, for
- compiled .o
- files.
-
-
-
-
-
- Motivation for Makatic
- ——————————————————————
-
- After finding that Acorn's !Make program didn't support
- building different versions of a project from the same source
- code, and was generally a pain to use, I used hand-written
- makefiles for all my projects.
-
- When I became the moderator of DeskLib, the need for a way of
- automating the generation of makefiles became apparent, so
- the first version of Makatic was written. This was included in
- DeskLib 2.30 .
-
- The much improved 'Makatic.Makatic2' was written so that many
- different types of projects could be supported. In particular,
- 'Makatic.Large' is a great help for everyday project
- management.
-
-
-
-
-
- Other things
- ————————————
-
- The contents of the Makatic directory are Freeware and
- Copyright Julian Smith 1996. They may not be used in connection
- with any profit-making activity without my prior permission.
-
- I hope you find Makatic a useful set of tools.
-
- If you have any comments or suggestions about Makatic, I'd be
- very pleased to hear about them. I can be contacted at the address
- below
-
-
-
- - Julian Smith
-
-
- ---------------------------------------------------------------------------
- Julian Smith Dept of Experimental Psychology
- julian.smith@psy.ox.ac.uk South Parks Road, Oxford, OX1 3UD
- http://cogsci1.psych.ox.ac.uk/~julians/ UK
- ---------------------------------------------------------------------------
-