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
include antimake.mk

Also install Antimake and we are ready to build:

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

Build the project

$ make
     CC       hello.c
     CCLD     hello
$ ls
Makefile  antimake.mk  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
hello

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

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

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

bin_PROGRAMS = hello
hello_SOURCES = hello.c
include antimake.mk

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  antimake.mk  hello  hello.c  inst  myhello-1.0.tar.gz
$ tar tzf myhello-1.0.tar.gz | sort
myhello-1.0/
myhello-1.0/Makefile
myhello-1.0/antimake.mk
myhello-1.0/hello.c

Clean the tree

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

Done!