# A simple makefile that assumes the source directory contains all
# the source files and that the makefile is being run from
# within that directory.
# Also, Allegro and DJGPP should be installed in the out-of-the-box way.
# Also, LibPNG (http://www.libpng.org/pub/png/libpng.html)
# and ZLib (http://www.info-zip.org/pub/infozip/zlib/)
# are installed directly below the HLA source directory, or
# adjust LIBDIRS and INCLUDEDIRS.
#
# The USEEXEDAT option is for appending the "allegro data" file to the executable.
# If you remove it, also remove the line that reads
#	$(TOOLS)exedat.exe hla.exe $(DATAFILE)


OPTIONS = -O2  -Wall -DHAS_PNG -DUSEEXEDAT -DORB
LIBDIRS = -Llpng106 -Lzlib -Lgdsource
INCLUDEDIRS=-Ilpng106 -Izlib -Igdsource

OBJS= orb.o bmp.o cplx.o crater.o dirfun.o erode.o fftn.o flat.o gread.o gwrite.o hcomp.o\
        hf_io.o hfhelp.o hla.o hladial.o hstack.o interp.o macro.o mf.o ops.o\
        ops2.o png_io.o pot_io.o rand.o raw_io.o s_grid.o tga_io.o\
	viewdia.o

TOOLS = c:/djgpp/allegro/tools/
DATAFILE = hla.dat


hla.exe : $(OBJS) hla.dat
	gcc -s -ohla.exe $(OBJS) $(LIBDIRS) -lpng -lz -lgd -lalleg -lm
	$(TOOLS)exedat.exe hla.exe $(DATAFILE)

orb.o: orb.c hl.h
bmp.o: bmp.c hl.h c:/djgpp/include/allegro.h
cplx.o: cplx.c hl.h
crater.o: crater.c gforge.h hl.h
dirfun.o: dirfun.c hl.h
erode.o: erode.c hl.h hf_io.h
fftn.o: fftn.c fftn.h fftn.c
flat.o: flat.c hl.h
gread.o: gread.c hl.h
gwrite.o: gwrite.c hl.h c:/djgpp/include/allegro.h
hcomp.o: hcomp.c hl.h c:/djgpp/include/allegro.h
hf_io.o: hf_io.c hl.h hf_io.h
hfhelp.o: hfhelp.c hl.h c:/djgpp/include/allegro.h
hla.o: hla.c hl.h hf_io.h c:/djgpp/include/allegro.h
hladial.o: hladial.c hl.h hladat.h c:/djgpp/include/allegro.h  maindial.h
mf.o: mf.c hl.h
hstack.o: hstack.c hl.h
interp.o: interp.c hl.h hf_io.h
macro.o: macro.c hl.h c:/djgpp/include/allegro.h
ops.o: ops.c hl.h fftn.h
ops2.o: ops2.c hl.h
png_io.o: png_io.c hl.h
pot_io.o: pot_io.c hl.h
rand.o: rand.c gforge.h
raw_io.o: raw_io.c hl.h
s_grid.o: s_grid.c hl.h hf_io.h c:/djgpp/include/allegro.h
tga_io.o: tga_io.c hl.h
viewdia.o: viewdia.c hl.h c:/djgpp/include/allegro.h maindial.h


%o : %c
	gcc -c $(INCLUDEDIRS) $(OPTIONS) $<

