dykstrom / fasm-ant

Custom ant task for building flat assembler files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status GitHub all releases GitHub

fasm-ant

Project fasm-ant is a custom Ant task for building flat assembler assembly files. It is designed to work like the built-in javac task, but with parameters tailored for the flat assembler. With fasm-ant you can build a tree of source files, leaving alone those that have not changed since the last build. Being an Ant project, fasm-ant is of course built with Ant Maven itself.

System requirements

Minimum: Java 8 and Ant 1.7.1.
Recommended: Java 11 and Ant 1.10.9.

Tested on Windows 10 and Ubuntu Linux.

Installation

Download the latest zip file from the GitHub releases page, unzip it, and copy the jar file to your Ant lib directory. That's it!

Configuration

To use the fasm-ant task in your build file, you first need to define it with taskdef. Put something like this in your build file:

<taskdef name="fasm" classname="se.dykstrom.ant.fasm.Fasm"/>

Now you can use fasm-ant as any other Ant task:

<fasm srcdir="${src.dir}" destdir="${bin.dir}" includes="**/*.asm"/>

Parameters

As said above, fasm-ant is designed to work like the built-in javac task. This means that many of the parameters that can be used with javac can also be used with fasm-ant. The table below lists all available fasm-ant parameters.

Attribute Description Required
compiler the compiler command used to run the flat assembler (default is "fasm") No
destdir the destination directory (default is same as source directory) No
errorproperty the property to set (to the value "true") if compilation fails No
excludes comma- or space-separated list of files (may be specified using wildcard patterns) that must be excluded; no files (except default excludes) are excluded when omitted No
failonerror indicates whether compilation errors will fail the build (default is true) No
includes comma- or space-separated list of files (may be specified using wildcard patterns) that must be included; all .asm files are included when omitted No
memory the limit in kilobytes for the memory available to the assembler No
passes the maximum allowed number of passes No
srcdir the source directory Yes
updatedproperty the property to set (to the value "true") if compilation has taken place and has been successful No

Parameters specified as nested elements

This task forms an implicit FileSet and supports most attributes of <fileset> (dir becomes srcdir) as well as the nested <include>, <exclude> and <patternset> elements.

compilerarg

You can specify additional command line arguments for the compiler with nested <compilerarg> elements. The <compilerarg> element has exactly one attribute.

Attribute Description Required
value a single command-line argument; can contain space characters Yes

Example

The following is an example of a very simple build file that uses fasm-ant.

<?xml version="1.0" encoding="ISO-8859-1"?>

<project name="example" default="build" basedir=".">

    <!-- Properties -->
    <property name="src.dir" value="src"/>
    <property name="bin.dir" value="bin"/>

    <!-- Targets -->
    <target name="declare">
        <taskdef name="fasm" classname="se.dykstrom.ant.fasm.Fasm"/>
    </target>

    <target name="build" depends="declare">
        <fasm srcdir="${src.dir}" destdir="${bin.dir}" includes="**/*.asm">
            <compilerarg value="-d name=value"/>
        </fasm>
    </target>
</project>

Note that this document only describes how to use fasm-ant. For information on how to use the flat assembler itself, please visit flatassembler.net.

About

Custom ant task for building flat assembler files

License:Apache License 2.0


Languages

Language:Java 94.1%Language:HTML 3.1%Language:Assembly 2.9%