SRC= debugger.c dcommand.c shownode.c list.c break.c hash.c local.c \
     print.c usage.c include.c set.c dutil.c view.c file.c code.c \
     breakname.c alias.c
OBJ= debugger.o dcommand.o shownode.o list.o break.o hash.o local.o \
     print.o usage.o include.o set.o dutil.o view.o file.o code.o \
     breakname.o alias.o

INCLUDES= Debug.h alias.h
OTHER=Makefile debugger.1

FILES=  $(OTHER) $(SRC) $(INCLUDES)

FLAGS= -D$(MACHINE) -D$(OS) -DPACKAGES -I../INCLUDES
CFLAGS= $(OPTFLAGS) $(FLAGS)
LIBNAME=tbug
OPTFLAGS=-O
#------------------------------------------------------------
# Make the loader library
lib$(LIBNAME).a: $(OBJ)
	/bin/rm -f lib$(LIBNAME).a
	ar r lib$(LIBNAME).a $(OBJ)
	-ranlib lib$(LIBNAME).a

# Make the lintlibrary
llib-l$(LIBNAME).ln: $(SRC)
	lint -C$(LIBNAME) $(FLAGS) $(SRC)

# ------------------------------------------------------------
lint:
	lint $(SRC) $(FLAGS) | egrep -v "but not defined" > lint.out

clean:
	-@ls $(FILES) > KeepList
	-@/bin/rm `ls | fgrep -v -x -f KeepList`

install: lib$(LIBNAME).a
	-@if ( test "$(REL)" != "" ) then \
	cp libtbug.a $(REL)/lib; \
	if ( test -x /usr/bin/ranlib ) then ranlib $(REL)/lib/libtbug.a; fi; \
	cp debugger.1 $(REL)/man; \
	chmod 777 $(REL)/lib/libtbug.a; \
	else echo No release directory; fi
#
