Simplest usage

Here we avoid use of any autotools.

First, this is the source file:

File: hello.c
#include <stdio.h>

int main(void)
        printf("Hello, world\n");
        return 0;

Here is corresponding Makefile:

File: Makefile
# This is target list - it's name describes target type
# and how it is installed, it's value target files to be built.
# bin - the targets will be installed under $(bindir)
# PROGRAMS - the target is executable built from many sources
bin_PROGRAMS = hello

# The target 'hello'-s source file list.
hello_SOURCES = hello.c

# Run Antimake

Also install Antimake and we are ready to build:

$ cp ../../ .
$ ls
Makefile  hello.c

Build the project

$ make
     CC       hello.c
     CCLD     hello
$ ls
Makefile  hello  hello.c
$ ./hello
Hello, world

We can even install it already:

$ make install prefix=/opt DESTDIR=./inst
     INSTALL  hello ./inst/opt/bin
$ ls ./inst/opt/bin

For creating source package, we need to provide additional info:

File: Makefile
# Package name and version for tarball filename
PACKAGE_NAME = myhello

# Non-source files to put into tarball
EXTRA_DIST = Makefile

bin_PROGRAMS = hello
hello_SOURCES = hello.c

Now we can create package that can be given to others.

$ make dist
     CHECK    dist-gzip
     MKDIR    myhello-1.0
     COPY     myhello-1.0
     PACK     myhello-1.0.tar.gz
$ ls
Makefile  hello  hello.c  inst  myhello-1.0.tar.gz
$ tar tzf myhello-1.0.tar.gz | sort

Clean the tree

$ make clean
     CLEAN    hello
$ ls
Makefile  hello.c  inst  myhello-1.0.tar.gz