#
# @(#) Makefile - makefile for Z80/Z280 disassembler package
#

# Change this if you want prototype support

PROTO=
#PROTO=-DPROTO

# Change this if you want a Z280 version. You then need ANSI string
# concatenation or you must edit dis.c (see the README)

FLAVOR=-DZ80
#FLAVOR=-DZ280

# Change this if your compiler doesn't have void

VOID=
#VOID=-Dvoid=int

# You might change this if you have gcc

CC=/usr/bin/gcc
#CC=gcc

LINT=lint

# The -I. is there in case your compiler doesn't have <stdlib.h>

CFLAGS=$(PROTO) $(FLAVOR) -I.

LINTFLAGS=$(FLAVOR) -I.

# Rules

all: disas disas2 disas3 optab oplist

disas: disas.o outhex.o dis.o
	$(CC) $(CFLAGS) disas.o outhex.o dis.o -o disas

disas2: disas2.o outhex.o dis.o
	$(CC) $(CFLAGS) disas2.o outhex.o dis.o -o disas2

disas3: disas3.o outhex.o dis.o
	$(CC) $(CFLAGS) disas3.o outhex.o dis.o -o disas3

optab: optab.o outsym.o outdebug.o dis.o
	$(CC) $(CFLAGS) optab.o outsym.o outdebug.o dis.o -o optab

oplist: oplist.o outsym.o outdebug.o dis.o
	$(CC) $(CFLAGS) oplist.o outsym.o outdebug.o dis.o -o oplist

disas.o optab.o oplist.o dis.o outsym.o outdebug.o outhex.o: dis.h Makefile

clean:
	rm -f disas optab oplist *.o core

lint:
	$(LINT) $(LINTFLAGS) disas.c outhex.c dis.c
	$(LINT) $(LINTFLAGS) optab.c outsym.c outdebug.c dis.c
	$(LINT) $(LINTFLAGS) oplist.c outsym.c outdebug.c dis.c

