# Make file for xntp/ntpq 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/ntpq

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

include ${BUILDRULES}

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

NTPQOPT=-DREFCLOCK -DNO_SIGNED_CHAR_DECL -DDEBUG -DHPUXDEBUG \
	-DHPUX=9 -DNOKMEM -DCONFIG_FILE="/usr/local/etc/xntp.conf" \
	-DHAVE_UNISTD_H

CCFLAGS=$(INCLUDES) $(NTPQOPT) $(CFLAGS)

NTPQOBJS=ntpq.o ntpq_ops.o ver.o

LDLIBRARIES=    ../lib/libntp.a -lBSD

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

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

default: all

all: clean build install

clean:
	$(RM) -f $(NTPQOBJS)
	$(RM) -f ntpq
	
install:
	for file in $(PRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done

build: ntpq

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

ver.o:
	$(SHELL) newvers.sh
	$(CC) $(CCFLAGS) -c ver.c

ntpq: $(NTPQOBJS)
	$(CC) -o $@ $(NTPQOBJS) $(LDLIBRARIES) $(LDFLAGS)

