#
# Copyright (c) 1988 Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of California at Berkeley. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
#	from @(#)Makefile	5.16 (Berkeley) 3/14/88
#
####
#### Updated 3/27/89 for 'dig' version 1.0 at University of Southern
#### California Information Sciences Institute (USC-ISI).
####
#### Modified & distributed with 'dig' version 2.0 from USC-ISI (9/1/90).
####
####

CC =	gcc
DEFS=	-DDEBUG
CFLAGS=	-g -O ${DEFS} -fpcc-struct-return -funsigned-char
#LRESOLV=/usr/local/lib
LRESOLV=.

LIBSRC=	herror.c res_comp.c res_debug.c res_init.c res_mkquery.c res_query.c \
	res_send.c strcasecmp.c gethostnamadr.c sethostent.c qtime.c
LIBOBJ=	herror.o res_comp.o res_debug.o res_init.o res_mkquery.o res_query.o \
	res_send.o strcasecmp.o gethostnamadr.o sethostent.o qtime.o

all:	libresolv.a dig

#dig: libresolv.a dig.c list.o Makefile options.c

dig: Makefile dig.o list.o ${LRESOLV}/libresolv.a
	${CC} ${CFLAGS} -o $@ \
	dig.o list.o qtime.o \
	-L$(LRESOLV) -lresolv

dig.g: libresolv.a dig.c list.o Makefile options.c
	${CC} -g ${DEFS} dig.c -L`pwd` -lresolv list.o -o dig.g

libresolv.a: ${LIBOBJ}
	ar cru libresolv.a ${LIBOBJ}
	ranlib libresolv.a

.c.o:
	${CC} ${CFLAGS} -c $*.c
	-ld -x -r $*.o
	mv a.out $*.o

dig.local: dig.c list.o options.c
	${CC} ${CFLAGS} -DRESLOCAL dig.c -lresolv list.o -o dig.local

dig.dbx: libresolv.a dig.c list.o Makefile
	${CC} -g ${DEFS} dig.c -L`pwd` -lresolv list.o -o dig

clean: FRC
	rm -f *.o errs a.out core tags

depend: FRC
	mkdep -f Makefile.resolv ${CFLAGS} ${SRCS}

FRC:

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
dig.o : dig.c hfiles.h resolv.h subr.c netdb.h nameser.h res.h pflag.h \
	options.c  qtime.h
gethostnamadr.o : gethostnamadr.c hfiles.h netdb.h nameser.h resolv.h
herror.o : herror.c
list.o : list.c hfiles.h netdb.h nameser.h resolv.h res.h
options.o : options.c
qtime.o : qtime.c qtime.h
res_comp.o : res_comp.c hfiles.h nameser.h
res_debug.o : res_debug.c hfiles.h nameser.h resolv.h pflag.h netdb.h
res_init.o : res_init.c hfiles.h nameser.h resolv.h
res_mkquery.o : res_mkquery.c hfiles.h nameser.h resolv.h
res_query.o : res_query.c hfiles.h netdb.h nameser.h resolv.h
res_send.o : res_send.c hfiles.h nameser.h resolv.h qtime.h pflag.h
sethostent.o : sethostent.c hfiles.h nameser.h resolv.h
strcasecmp.o : strcasecmp.c
subr.o : subr.c hfiles.h netdb.h nameser.h res.h


# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
