# x128 V0.5 Makefile

# Remove the # below for Linux extra bits, like Adlib and PC Speaker sound
# ONLY USE THIS IF YOU ARE USING A PC BASED UNIX!!!!!!!!!!!
#LINUX = -DLINUX 

# Remove the # below if you are using a Low Endian processor (ie Intel).
#LSB_FIRST = -DLSB_FIRST

# Remove the # below if you want a double sized window.
#SCALE2 = -DSCALE2

# Set this to a number between 0 and 3, 3 is the greatest optimization.
OPTIM_LEVEL = -O3 -fomit-frame-pointer -funroll-loops
#OPTIM_LEVEL= -O0

# Insert a # below for faster ram writing, but poorer overscan timing.
# Note that Konami Ping Pong works better with this option off, but
# Hostages 128K requires it.
RAM_TIMING= -DRAM_TIMING

DEFINES = $(OPTIM_LEVEL) $(LINUX) $(LSB_FIRST) $(SCALE2) $(RAM_TIMING)

# Choose compiler, gcc is more likely to work, but some machines don't have it.
CC	= gcc

CFLAGS  = -I/usr/X11R6/include $(DEFINES)

OBJECTS = ay8910.o x128_t.o x128_ed.o x128_cb.o x128_z80.o

all:	x128 slt2dat dat2slt

x128:	${OBJECTS}
	${CC} -o x128 -L/usr/X11R6/lib/ ${OBJECTS} -lX11 -lXext

slt2dat:slt2dat.o
	${CC} -o slt2dat slt2dat.o

dat2slt:dat2slt.o
	${CC} -o dat2slt dat2slt.o

ay8910.o:  ay8910.c ay8910.h x128_end.c
x128_t.o:  x128_t.c x128_var.c x128_def.c x128_fsl.c x128_tap.c x128_voc.c \
           x128_ed.h x128_cb.h x128_z80.h x128_end.c unix.c common.h
x128_ed.o: x128_ed.c x128_ed.h x128_def.c x128_end.c
x128_cb.o: x128_cb.c x128_cb.h x128_def.c x128_end.c
x128_z80.o: x128_z80.c x128_z80.h x128_def.c x128_end.c
slt2dat.o: slt2dat.c
dat2slt.o: dat2slt.c

