SpeedyMake: Automation Tool for Easily Building Software
Create a makefile without any knowledge, just two rules and two commands to remind. The XML makefile holds names of sources file and names of programs used to
process them, with choosen options.
It is usually a short XML document. Tag names are not significant.
Some attributes are recognized by the interpreter and sufficient to build
a list of commands from a list of source files.
Dependencies are automatically recognized by Speedy Make.
You can build a
whole project with just the name of the main source file.
Example of a makefile:
<?xml version="1.0" ?> <makefile name="My Program"> <binary> myprog.exe </binary> <sources> mysource.c </sources> <compile action="run"> cl $sources </compile> <top> compile </top> </makefile>
Basically, only 2 internal commands are required to help the interpreter, but it may be extended without limit.
The <top> tag is parsed first, and the tag it includes are then parsed
and executed if they have the "run" action.
File format
- Speedy Make uses XML.
- Make uses its own format, where tabs are significant.
Dependency graph
- Speedy Make knows dependencies by parsing sources file and extracting
include statements.
Sometime, only the main source file of a whole project is required in the makefile. - Make requires explicit definition of dependencies: for each file to
build, the list of required files must be given in the form:
objectfile: source1 source2 source3 etc...
cc $@ $<
This is followed by the list of commands to perform. Each command stays on a line that starts with a tab code.
Dependency tracking
- Both make and Speedy Make use the date of last modification of the files to know whichever must be compiled. And the included headers also.
Variables
- Speedy Make uses variable prefixed by $ for a global replacement and * for an iterative replacement. It allows also to add a replacing extension in square brackets.
- Make uses variable defined in the makefile or the automatic variables $@ and $<.
- Both make and Speedy Make allow to override variables at command line.
Multiple tasks
- Speedy Make has options recognized by the interpreter for main tasks. It is also possible to select an action at command line.
- Make requires multiple definitions of processing in the makefile for various tasks. They may be choosen at command line.
Compiling and linking
- Both make and Speedy Make call external programs, with options given in the makefile.
Configure
- This is planned in Speedy Make.
- Make must be called after another program named "configure", that uses its own definition file (very hard to write).
Speedy Make is mainly intended to build software, but is not limited to this use. The engine that parses the XML document used for makefile is able to performs various tasks.
A backup program
The purpose of a backup program is to copy a defined list of files into a
defined location. Only newer versions of the files have to be copied.
The list of files to copy is stored into a tag:
<files> ...some filenames with paths... </file>
The destination is another tag:
<target> ... a directory ... </target>
The copy command is stored into another tag, and the top action also:
<copy action="run"> cp *files $target </copy> <main> copy </main>
Under Windows the standard command is:
copy /B /Y *files $target
but the copy command may be replaced by a more powerful freeware tool. See Unix Tools for example.
Speedy Make makefile for the C++ version of the ANTLR grammar parser
Compiled
with Visual Studio 2008 or Visual C++ Express 2008, build 15.
The makefile is configured to produce a STATIC library, but you can change
the options to produce a DLL as well.
Rule for compiling the sources:
cl.exe /nologo /wd4101 /wd4291 /D"_CRT_SECURE_NO_WARNING" /I"." /I"lib/cpp/" /c /MT /W3 /Zc:forScope /FD /EHsc $sources
The /I option define the path of files to includes.
/c means for compile only, do not link.
See Visual C++ options for the meaning of other options or type cl /?
Rule to create a static library:
lib.exe /NOLOGO $sources[.obj] /out:$binary
The same list of source files is used again, but the .cpp extensions are replaced by .obj, this is the purpose of this variable:
$sources[.obj]
Get the makefile...
- Download antlr-2.7.7.sm.
You can rename the file to makefile.sm to avoir to type the name at command line. This makefile should work with other versions of ANTLR provided that the list of source files is updated.
More examples
SM may be used with any tool that requires a list of files in input:
- Comparing a list of files.
fc c:\dirx\*files c:\diry\*.*
- Changing the extension of a list of files.
- Etc...
Since the makefile is an XML document, makefiles may be generated by other tools that allow to select a list of files, put the list into a tag, and apply predefined rules on the list. The smake parser is then called with the document as parameter.
- Download the last version
This version requires PHP 5. - Download Speedy Make 1.3
This older version includes a binary executable for Windows. May be compiled on other systems.
- Manual
Describes the algorithm and the commands.
- Options of C++ compilers.
SpeedyMake is distributed under the GNU
GPL 2.0 licence.
You can use and share freely the program provided the copyright notice is
included and the headers unchanged.
You can extend the program and distribute the extended version provided the
name of the original author is kept, and its copyright notice unchanged. According
to the licence, the modified source code must be provided also.
The source is the Scriptol source, not the C++ backend that is an intermediate
code.
Including the executable
You have special authorization to include the binary executable along with your program without the need to include the source providing it is unchanged. If the original source here provided is changed, you must provide it either along with the executable or separatly.
SpeedyMake's makefiles
The format of the makefile is under the Creative Common licence. You can provide files in this format without restriction for use with Speedy Make. If you use the format with another tool, rather than with Speedy Make, you have to specify the name of the original author in the documentation about the format.
By Kim Haskell