all: map2gif

map2iff: map2iff.o map.o decompress.o options.o copy.o
	cc -o map2iff map2iff.o map.o decompress.o options.o copy.o

map2gif: map2gif.o map.o decompress.o options.o copygif.o gifwrite.o
	cc -o map2gif map2gif.o map.o decompress.o options.o copygif.o gifwrite.o

# Compiling rule.  Change $(ALIGN) to whatever forces your compiler to do
# 1- or 2-byte alignment for everything as opposed to e.g. 4-byte alignment
# for pointers.  If there's no way to convince your compiler to do this,
# have $(ALIGN) define MAP_ALIGN4 (and see the caveat in map.h).  $(ENDIAN)
# should define LITTLE_ENDIAN on a little-endian machine, else it should be
# empty.
ALIGN = -DMAP_ALIGN4
ENDIAN = -DLITTLE_ENDIAN
.c.o:
	cc -c -O2 -DMAP_NODISPLAY $(ALIGN) $(ENDIAN) -o $@ $<

map2iff.o: map2iff.c map.h options.h
map.o: map.c map.h dos.h exec.h
decompress.o: decompress.c
options.o: options.c options.h
copy.o: copy.c
map2gif.o: map2gif.c map.h tile.h options.h
copygif.o: copygif.c
gifwrite.o: gifwrite.c tile.h
