# This is a makefile for the emulation tools and utilities by
# Marat Fayzullin.
# Following #defines can be customized:
#
# UNIX      - Should always be present in the Unix version.
# MSDOS     - Should always be present in the MSDOS version.
# LSB_FIRST - Use this if your CPU has least-significant-byte-first
#             architecture (Intel 80x86, Alpha, etc.).
# LINUX     - Define this if you compile sound support on a Linux
#             machine.
# SUN_AUDIO - Define this if you are compiling sound support via
#             SunOS-compatible /dev/audio.
# ZLIB      - Use this when compiling emulator with ZLib, a library
#             for transparent access to GZIPped files. When compiled
#             with ZLib, emulator will be able to load ROM images
#             compressed with GZIP or PKZIP.
CC      = gcc
DEFINES = -DUNIX -DLSB_FIRST
CFLAGS	= ${DEFINES}

all:	psgplay snd2mid dasmz80 dasm6502 gbdasm gblist neslist bdiff

clean:
	rm -f *.o *~

# DASM6502 is a little 6502 disassembler
dasm6502: dasm6502.c
	${CC} ${CFLAGS} -o $@ $>
# DASMZ80 is a little Z80 disassembler
dasmz80: dasmz80.c
	${CC} ${CFLAGS} -o $@ $>
# GBDASM is a little GameBoy disassembler
gbdasm: gbdasm.c GBCarts.c
	${CC} ${CFLAGS} -o $@ $>
# PSGPLAY is a player for .SND and .PSG files
psgplay: psgplay.c DSP.c
	${CC} ${CFLAGS} -o $@ $>
# SND2MID is an .SND->.MID file converter
snd2mid: snd2mid.c MIDI.c
	${CC} ${CFLAGS} -o $@ $>
# GBLIST is a utility to list/check/fix GameBoy ROM images
gblist: gblist.c GBCarts.c
	${CC} ${CFLAGS} -o $@ $>
# NESLIST is a utility to list/check/fix NES ROM images
neslist: neslist.c
	${CC} ${CFLAGS} -o $@ $> -DZLIB -lz
# BDIFF is a binary comparison utility
bdiff: bdiff.c
	${CC} ${CFLAGS} -o $@ $>
