#
# Makefile for V debugger
#

SOURCES = debug.c commands.c breakpoint.c memoryaccess.c stack.c typeout.c ioutilities.c symbols.c disasm.c
OBJECTS = debug.b commands.b breakpoint.b memoryaccess.b stack.b typeout.b ioutilities.b symbols.b disasm.b
HEADERS = Vdb.h

#ifdef X
C68FLAGS = -O -V -vx
#else X
C68FLAGS = -O -V
#endif X
LIBS = -lVexcept


.SUFFIXES: .b .ls .a68 .c

# how to compile a 68000 file
.c.b:
	cc68 $(C68FLAGS) -c $*.c 

# how to make an assembly file (Not deleting it or assembling it)
.c.s:
	cc68 $(C68FLAGS) -S $*.c

# how to make an assembly listing
.c.ls:
	cc68 $(C68FLAGS) -c -L $*.c


all: debug 

debug: $(OBJECTS) $(HEADERS)
	cc68 $(C68FLAGS) -r -o debug $(OBJECTS) $(LIBS)


install: debug 
#ifdef X
	netinstall -x -p debug /usr/sun/xVboot
#else X
	netinstall -p "debug" /usr/sun/Vboot
#endif X

clean: 
	rm -f *BAK *CKP .emacs* sym.out *.b debug

cleanbak:
	rm -f *BAK *CKP .emacs* sym.out

backup:
	cd ..; cpdir debug ../../Vbackup/cmds/debug

build:
	buildmake

xbuild:
	buildmake -DX=1

tags:
	ctags $(SOURCES)
