How to create an Allegro make file

System: BeOS, Haiku, Zeta

Allegro is a portable library for development of game and multimedia applications. Allegro is originally written by Shawn Hargreaves for the DJGPP Compiler as a mix of C and Assembler.

Allegro Website

The use of the Allegro library is not suitable for programming beginners of the language C. If you have the needed experience and you want to start programming a game Allegro will be a big help to do that.

Here an example for a Makefile:

NAME=example
OBJECTS=example.cpp
COMPILER=gcc
LINKER=gcc
OPTIONS=-Wall -g
CFLAGS = $(shell allegro-config --cflags)
LIBS = -lalleg-4.0.3 $(shell allegro-config --libs)

all: $(OBJECTS)
   $(LINKER) -o $(NAME) $(OBJECTS) $(LIBS)
.c.o :
   $(COMPILER) $(CFLAGS) $(OPTIONS) -c -o $*.o $*.c
clean :
   rm *.o

  • At "example" enter the name of the application.
  • At "OBJEKTS" enter all needed files for the application. These are all files with the suffix .c or .cpp. If you have more then one file, enter the files with free space between the words.


  • Translation by Christian Albrecht (Lelldorin) March 2009
    Tutorial by Christian Albrecht (Lelldorin) and Lorenz Glaser (lorglas) 2003
    Made available by BeSly, the BeOS, Haiku and Zeta knowledge base.