# Make file for bind/named directory
#
# Things you might want to change.  Pass them in on the command line:
# ROOT - should point to the root where the commands will be installed
#        (e.g. /deliver/INETSVCS/indnetwk)

ROOT=

PRODUCTS=/usr/sbin/named\
	/usr/sbin/named-xfer

NAMEDSRC        = 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 db_glue.c \
                  strcasecmp.c sigvec.o ns_cdns.c
NAMED           = 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 db_glue.o \
                  strcasecmp.o sigvec.o ns_cdns.o
XFERSRC         = named-xfer.c db_glue.c strcasecmp.c sigvec.o
XFER            = named-xfer.o db_glue.o strcasecmp.o sigvec.o
HDRS            = db.h ns.h

INCLUDES=-I. -I../../include -I/usr/include

# Defaults file containing the shell, compiler options, etc
BUILDRULES=/source/INETSVCS/$(LOGNAME)/config/defaults

include ${BUILDRULES}

CCFLAGS=$(INCLUDES) -O -DDEBUG -DSTATS -DSYSV -DCDNS $(CFLAGS)

#Install database name
INSTALLDB=/source/INETSVCS/$(LOGNAME)/config/installdb

#Script called to parse the install deliverable
INSTALLSCPT=/source/INETSVCS/$(LOGNAME)/config/install_script

#Commands used by this Makefile
AR=/usr/ccs/bin/ar

default: all

all: clean build install

clean:
	$(RM) -f *.o
	$(RM) -f *.b
	$(RM) -f core
	$(RM) -f named named-xfer

.c.o:
	$(CC) $(CCFLAGS) -c $*.c

build:  named named-xfer

named:  $(NAMED)
	$(ECHO) "Building named..."
	$(SHELL) newvers.sh
	$(CC) -o $@ $(LDFLAGS) $(NAMED) version.c

named-xfer: $(XFER)
	$(ECHO) "Building named-xfer..."
	$(CC) -o $@ $(LDFLAGS) $(XFER) version.c

sigvec.o:
	$(AR) xv /usr/lib/libBSD.a sigvec.o

install:
	for file in $(PRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done
