CC=	gcc

# Remove -DNIS from DEFS if your system doesn't support NIS (aka YP).
DEFS=	-DNIS -DDEBUG -O

# If any of the routines in the following modules do not exist on your
# system (you get "undefined symbol" errors when linking), include the
# appropriate modules in EXTRASRCS and EXTRAOBJS.
#
#EXTRASRCS=mktemp.c strcasecmp.c strpbrk.c strerror.c
#EXTRAOBJS=mktemp.o strcasecmp.o strpbrk.o strerror.o

CFLAGS=	$(DEFS) -Iinclude

SRCS=	herror.c res_comp.c res_debug.c res_init.c res_mkquery.c res_query.c \
	res_send.c gethostnamadr.c sethostent.c $(EXTRASRCS)
OBJS=	herror.o res_comp.o res_debug.o res_init.o res_mkquery.o res_query.o \
	res_send.o gethostnamadr.o sethostent.o $(EXTRAOBJS)

libresolv.a: $(OBJS)
	ar cru libresolv.a $(OBJS)
	ranlib libresolv.a

shared:
	cd shlib; make DEFS="$(DEFS) -DSHLIB" all

libc.so:
	cd shlib; make DEFS="$(DEFS)" libc.so

libc.sa:
	cd shlib; make DEFS="$(DEFS)" libc.sa

install: libresolv.a
	install -o bin -g bin -m 644 libresolv.a $(DESTDIR)/usr/lib
	ranlib $(DESTDIR)/usr/lib/libresolv.a

.c.o:
	$(CC) $(CFLAGS) -c $*.c
	-ld -x -r $*.o
	mv a.out $*.o

clean:
	rm -f *.o errs a.out core libresolv.a tags
	cd shlib; make clean

depend: FRC
	mkdep ${CFLAGS} ${SRCS}

FRC:

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
