#
# Copyright (c) 1987 Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the University of California, 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'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
#	@(#)Makefile	4.15 (Berkeley) 7/9/88
#
RES=
DEFINES= -DDEBUG  -DSTATS -Dsignal=_sigset -Dlongjmp=siglongjmp
### -DALLOW_T_UNSPEC -Dmalloc=rt_malloc -Dfree=rt_free
### ALLOC=storage.o
CFLAGS=	-O -I.  ${DEFINES}
LDFLAGS= ${RES} -ldbm -lbsd
LIBC=	/usr/lib/libc.a
SRCS=	db_dump.c db_load.c db_lookup.c db_reload.c db_save.c db_update.c \
	ns_forw.c ns_init.c ns_main.c ns_maint.c ns_req.c ns_resp.c \
	ns_sort.c ns_stats.c 
HDRS=	db.h ns.h res.h
OBJS=	db_dump.o db_load.o db_lookup.o db_reload.o db_save.o db_update.o \
	ns_forw.o ns_init.o ns_main.o ns_maint.o ns_req.o ns_resp.o \
	ns_sort.o ns_stats.o  $(ALLOC)
SUBDIR=	tools

all: named

named:	${OBJS} ${LIBC}
	sh newvers.sh
	${CC} -o $@ version.c ${OBJS} ${LDFLAGS}

clean: FRC
	rm -f ${OBJS} core named version.o version.c
#	for i in ${SUBDIR}; do \
#		(cd $$i; make ${MFLAGS} clean); \
#	done

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

install: FRC
	install -s -u bin -g bin -m 755 named ${DESTDIR}/etc/named
	install -s -u root -g sys -m 644 opus.boot ${DESTDIR}/etc/opus.boot
	install -s -u bin -g bin -m 644 opus.hosts ${DESTDIR}/etc/opus.hosts
	install -s -u bin -g bin -m 644 opus.rev ${DESTDIR}/etc/opus.rev

lint: FRC
	lint -Dlint ${CFLAGS} ${SRCS}

tags: FRC
	ctags -t ${SRCS} ${HDRS}

FRC:
