The Allegro Wiki is migrating to github at https://github.com/liballeg/allegro_wiki/wiki

Test jam file

From Allegro Wiki
Jump to: navigation, search
Documentation.png
This code snippet requires documentation. If you understand how this code is intended to be used, please help Allegro by documenting it. Once the snippet is fully documented, you may remove this tag.


# Utilize the GNU C Compiler
CC      = gcc ;

# Set compiler flags:
# -W:              TODO : Figure out what this does...
# -Wall:           Enable most warnings
# -Wno-unused:     Do not warn about unused functions, variables, etc.
# -DALLEGRO_USE_C: Tell the preprocessor to automatically #define ALLEGRO_USE_C
CCFLAGS = -W -Wall -Wno-unused -DALLEGRO_USE_C ;

# Disable optimizations to increase build time and for debugging purposes
OPTIM   = -O0 ;

# Search the specified paths for header files
HDRS    = . include include/allegro ;

# Use GCC instead of the directly calling the assembler
# -c:                    Create an object file but do not link
# -x assembler-with-cpp: Explain that the programming language is assembler with the C preprocessor
AS   = gcc -c -x assembler-with-cpp ;

# Use the compiler flags as the assembler flags
ASFLAGS = $(CCFLAGS) ;

# Libraries to link with when using X11
X11LIBS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lXcursor -lXpm ;

# External libraries
EXTRALIBS = -lm -lpthread -ldl $(X11LIBS) ;

#----------------------------------------------------------------------

# Listing of source files for Allegro
ALLEGRO_SRC_FILES = 
   src/allegro.c 
   src/blit.c 
   src/bmp.c 
   src/clip3d.c 
   src/clip3df.c 
   src/colblend.c 
   src/color.c 
   src/config.c 
   src/datafile.c 
   src/dataregi.c 
   src/digmid.c 
   src/dither.c 
   src/dispsw.c 
   src/display.c 
   src/dtor.c 
   src/drvlist.c 
   src/events.c 
   src/evtsrc.c 
   src/file.c 
   src/fli.c 
   src/flood.c 
   src/font.c 
   src/fontbios.c 
   src/fontbmp.c 
   src/fontdat.c 
   src/fontgrx.c 
   src/fonttxt.c 
   src/fsel.c 
   src/gfx.c 
   src/glyph.c 
   src/graphics.c 
   src/gsprite.c 
   src/gui.c 
   src/guiproc.c 
   src/inline.c 
   src/joynu.c 
   src/keybdnu.c 
   src/lbm.c 
   src/libc.c 
   src/lzss.c 
   src/math.c 
   src/math3d.c 
   src/midi.c 
   src/mixer.c 
   src/modesel.c 
   src/mouse.c 
   src/pcx.c 
   src/poly3d.c 
   src/polygon.c 
   src/quantize.c 
   src/quat.c 
   src/readbmp.c 
   src/readfont.c 
   src/readsmp.c 
   src/rle.c 
   src/rotate.c 
   src/scene3d.c 
   src/sound.c 
   src/spline.c 
   src/stream.c 
   src/text.c 
   src/tga.c 
   src/unicode.c 
   src/vtable.c 
   src/vtable15.c 
   src/vtable16.c 
   src/vtable24.c 
   src/vtable32.c 
   src/vtable8.c 
   src/compat/coblit.c 
   src/compat/cogfx.c 
   src/compat/cojoy.c 
   src/compat/cokeybd.c 
   src/compat/cotimer.c 
   src/misc/vector.c
   ;

# More Allegro source files
ALLEGRO_SRC_C_FILES = 
   src/c/cblit16.c 
   src/c/cblit24.c 
   src/c/cblit32.c 
   src/c/cblit8.c 
   src/c/ccpu.c 
   src/c/ccsprite.c 
   src/c/cgfx15.c 
   src/c/cgfx16.c 
   src/c/cgfx24.c 
   src/c/cgfx32.c 
   src/c/cgfx8.c 
   src/c/cmisc.c 
   src/c/cscan15.c 
   src/c/cscan16.c 
   src/c/cscan24.c 
   src/c/cscan32.c 
   src/c/cscan8.c 
   src/c/cspr15.c 
   src/c/cspr16.c 
   src/c/cspr24.c 
   src/c/cspr32.c 
   src/c/cspr8.c 
   src/c/cstretch.c 
   src/c/czscan15.c 
   src/c/czscan16.c 
   src/c/czscan24.c 
   src/c/czscan32.c 
   src/c/czscan8.c 
   src/misc/ccolconv.c
   ;

# Allegro source files specific to GNU/Linux
ALLEGRO_SRC_LINUX_FILES = 
   src/linux/fbcon.c 
   src/linux/lconsole.c 
   src/linux/lgfxdrv.c 
   src/linux/ljoynu.c 
   src/linux/lkeybdnu.c 
   src/linux/lmemory.c 
   src/linux/lmouse.c 
   src/linux/lmsedrv.c 
   src/linux/lmsegpmd.c 
   src/linux/lmsems.c 
   src/linux/lmseps2.c 
   src/linux/lmseev.c 
   src/linux/lstddrv.c 
   src/linux/lsystem.c 
   src/linux/lvga.c 
   src/linux/lvgahelp.c 
   src/linux/svgalib.c
   src/linux/svgalibs.s
   src/linux/vtswitch.c 
   src/misc/vbeaf.c
   src/misc/vbeafs.s
   src/misc/vgaregs.c 
   src/misc/vga.c 
   src/misc/modex.c
   src/misc/modexgfx.s
   ;

# Allegro source files specific to UN*X
ALLEGRO_SRC_UNIX_FILES = 
   src/unix/alsa5.c 
   src/unix/alsa9.c 
   src/unix/alsamidi.c 
   src/unix/arts.c 
   src/unix/sgial.c 
   src/unix/jack.c 
   src/unix/udjgpp.c 
   src/unix/udrvlist.c 
   src/unix/udummy.c 
   src/unix/uesd.c 
   src/unix/ufdwatch.c 
   src/unix/ufile.c 
   src/unix/ugfxdrv.c 
   src/unix/ujoydrv.c 
   src/unix/ukeybd.c 
   src/unix/umain.c 
   src/unix/umodules.c 
   src/unix/umouse.c 
   src/unix/uoss.c 
   src/unix/uossmidi.c 
   src/unix/usnddrv.c 
   src/unix/usystem.c 
   src/unix/uthreads.c 
   src/unix/utime.c 
   src/unix/utimernu.c 
   src/unix/uxthread.c 
   src/misc/modexsms.c
   ;

# Allegro source files specific to X11
ALLEGRO_SRC_X_FILES = 
   src/x/xgfxdrv.c 
   src/x/xkeyboard.c 
   src/x/xmouse.c 
   src/x/xsystem.c 
   src/x/xvtable.c 
   src/x/xwin.c 
   src/x/xdga2.c 
   src/x/xdga2s.s
   src/misc/colconv.c
   ;

# Build the Allegro library from all of the above sources
Library liballeg.a :
   $(ALLEGRO_SRC_FILES)
   $(ALLEGRO_SRC_C_FILES)
   $(ALLEGRO_SRC_LINUX_FILES)
   $(ALLEGRO_SRC_UNIX_FILES)
   $(ALLEGRO_SRC_X_FILES)
   ;

# TODO : document this asmdef stuff
GenFile obj/unix/asmdef.inc : asmdef ;
Main asmdef : src/i386/asmdef.c ;

#----------------------------------------------------------------------

# List of Allegro examples
EXAMPLES =
   examples/ex3buf
   examples/ex3d
   examples/ex12bit
   examples/exaccel
   examples/exalpha
   examples/exbitmap
   examples/exblend
   examples/excamera
   examples/excolmap
   examples/exconfig
   examples/excustom
   examples/exdata
   examples/exdbuf
   examples/exexedat
   examples/exfixed
   examples/exflame
   examples/exflip
   examples/exfont
   examples/exgui
   examples/exhello
   examples/exjoy
   examples/exkeys
   examples/exlights
   examples/exmem
   examples/exmidi
   examples/exmouse
   examples/expackf
   examples/expal
   examples/expat
   examples/exquat
   examples/exrgbhsv
   examples/exsample
   examples/exscale
   examples/exscn3d
   examples/exscroll
   examples/exshade
   examples/exspline
   examples/exsprite
   examples/exstars
   examples/exstream
   examples/exswitch
   examples/exsyscur
   examples/extimer
   examples/extrans
   examples/extruec
   examples/exunicod
   examples/exupdate
   examples/exxfade
   examples/exzbuf
   ;

# Build exhello and exgui
Main examples/exhello : examples/exhello.c ;
Main examples/exgui : examples/exgui.c ;

# Add liballeg and its requirements as linker dependencies to all of the examples
LinkLibraries $(EXAMPLES) : liballeg ;
LINKLIBS on $(EXAMPLES) = $(EXTRALIBS) ;

#----------------------------------------------------------------------

# Sources for ALDAT
LIBALDAT_OBJECTS =
   tools/datedit.c
   tools/plugins/datalpha.c
   tools/plugins/datfli.c
   tools/plugins/datfname.c
   tools/plugins/datfont.c
   tools/plugins/datgrab.c
   tools/plugins/datgrid.c
   tools/plugins/datimage.c
   tools/plugins/datitype.c
   tools/plugins/datmidi.c
   tools/plugins/datpal.c
   tools/plugins/datsamp.c
   tools/plugins/datworms.c
   ;

# Allegro Data File Tools
ALLEGRO_DATAFILE_EXES =
   tools/dat
   tools/dat2s
   tools/grabber
   tools/pat2dat
   ;

# Build grabber
Main tools/grabber : tools/grabber.c ;

# Link in liballeg and deps
LinkLibraries $(ALLEGRO_DATAFILE_EXES) : libaldat liballeg ;
LINKLIBS on $(ALLEGRO_DATAFILE_EXES) = $(EXTRALIBS) ;

# Build the ALDAT library
Library libaldat : $(LIBALDAT_OBJECTS) ;

# TODO : document dat*.inc stuff
GenFile obj/unix/plugins.h :
   concat 
   tools/plugins/datalpha.inc
   tools/plugins/datfli.inc
   tools/plugins/datfname.inc
   tools/plugins/datfont.inc 
   tools/plugins/datgrab.inc
   tools/plugins/datgrid.inc
   tools/plugins/datimage.inc
   tools/plugins/datitype.inc 
   tools/plugins/datmidi.inc
   tools/plugins/datpal.inc
   tools/plugins/datsamp.inc
   tools/plugins/datworms.inc
   ;

#----------------------------------------------------------------------

# Install the Allegro library
InstallLib $(LIBDIR) : liballeg$(SUFLIB) ;

# Install Allegro Data File Grabber tool
InstallBin $(BINDIR) : tools/grabber ;