# WARNING: DO NOT EDIT.
# THIS FILE WAS AUTOMATICALLY GENERATED USING THE
# BUILDMAKE PROGRAM.

# V UNIX Server buildfile

# Used by the hosttab.csh program to produce the Vhosttab used
# by simple lookup.
SERVERHOSTS = diablo navajo whitney shasta helens glacier carmel 

HOME = /ng/ng/V/servers/unix
MAINTAINER = /ng/nagler/V/servers/unix/
INSTALL = /etc/Vserver

VINCLUDE = -I../../libc/include

UTILITIES = sessdebug hosttab.csh
USOURCES = sessdebug.c hosttab.csh
SSOURCES = ihandlers.c ioqueue.c process.c time.c server.c instance.c \
	   file.c session.c lookup.c naming.c directory.c debug.c unix.c
KSOURCES = ether3meg.c kernel.c bufmgr.c swab.c
KOBJS = ether3meg.o bufmgr.o kernel.o swab.o 
SOBJS = ihandlers.o ioqueue.o process.o instance.o server.o file.o \
	session.o time.o lookup.o naming.o directory.o debug.o unix.o
KHEADERS = kernel.h net.h
SHEADERS = server.h naming.h debug.h
INCLUDE = -I. $(VINCLUDE) -I/usr/include/ -I/usr/include/sys
LIBRARIES = -ljobs -lnet -lhdb -lbbn -lstr

# Most of these manifests are implementation dependent, that is why
# they are in the makefile.

#NOTE that the PUBLIC_DIR must end in a '/'
CCFLAGS = -O -DENET3MEG -DPUPLOOKUP -D'SERVER_BANNER="V server"' \
	-D'SESSION_BANNER="V %s"' -D'PUBLIC_DIR="/usr/sun/Vboot/"' \
	-DPACKET_RECEIVED=30 -DFAST_ALARM_RATE=2 -DDEFAULT_CREAT_MODE=0644 \
	-D'DEBUG_FILE_NAME="/tmp/Vserver%d"' -DSLOW_ALARM_RATE=10	\
	-D'HOST_TABLE_FILE="/usr/sun/Vboot/Vhosttab"' -DSIMPLELOOKUP

.c.o :
	cc -c $(INCLUDE) $(CCFLAGS) $*.c
.c.s :
	cc -S $(INCLUDE) $(CCFLAGS) $*.c

Vserver : $(KOBJS) $(SOBJS)
	-mv Vserver Old.Vserver
	cc $(INCLUDE) $(CCFLAGS) -o Vserver $(SOBJS) $(KOBJS) $(LIBRARIES)

$(SOBJS) : $(SHEADERS) 
$(KOBJS) : $(KHEADERS) debug.h


# Utility compilation
sessdebug: sessdebug.c debug.h
	cc68 -r -V -vx $(INCLUDE) -o sessdebug sessdebug.c

Vhosttab: hosttab.csh
	hosttab.csh $(SERVERHOSTS) > Vhosttab

# administration
tags:  $(KSOURCES) $(SSOURCES) $(KHEADERS) $(SHEADERS)
	ctags $(KHEADERS) $(SHEADERS) $(KSOURCES) $(SSOURCES)

clean:
	-rm -f $(KOBJS) $(SOBJS) Vserver *.BAK *.CKP .emacs* $(UTILITIES)

lint:
	lint -I$(INCLUDE) $(KSOURCES) $(SSOURCES) $(LIBRARIES)

install: Vserver Vhosttab
	netinstall -r Vserver .
	netinstall -p Vhosttab /usr/sun/Vboot
	@echo "Send mail to the super-users to start the new server."


# link the maintenance and the archive directories of sources
# first must remove anything left in maintenance directory
maintain:
	-echo cleaning sources from $(MAINTAINER)
	-cd $(MAINTAINER); make clean
	-cd $(MAINTAINER); rm -f $(KSOURCES) $(KHEADERS) $(SSOURCES) \
			   $(USOURCES) $(SHEADERS)
	cd $(HOME); ln $(KSOURCES) $(KHEADERS) $(SSOURCES) $(SHEADERS) \
	$(KOBJS) $(SOBJS) $(USOURCES) $(MAINTAINER) 

backup:
	cd ..; cpdir unix ../../Vbackup/servers/unix

build: buildfile
	buildmake.sh

xbuild: buildfile
	buildmake.sh -DX=1

buildfile:	;co buildfile
bufmgr.c:	;co bufmgr.c
debug.c:	;co debug.c
debug.h: 	;co debug.h
directory.c: 	;co directory.c
ether3meg.c:	;co ether3meg.c
file.c:		;co file.c
ihandlers.c:	;co ihandlers.c
instance.c:	;co instance.c
ioqueue.c:	;co ioqueue.c
kernel.c:	;co kernel.c
kernel.h:	;co kernel.h
lookup.c:	;co lookup.c
malloc.c:	;co malloc.c
naming.c:	;co naming.c
naming.h:	;co naming.h
net.h:		;co net.h
process.c:	;co process.c
server.c:	;co server.c
server.h:	;co server.h
sessdebug.c:	;co sessdebug.c
session.c:	;co session.c
swab.c:		;co swab.c
time.c:		;co time.c
unix.c:		;co unix.c
hosttab.csh:	;co hosttab.csh

rcs:
	ci $(SSOURCES) $(SHEADERS) $(KSOURCES) $(KHEADERS) $(USOURCES) buildfile

sources: $(SSOURCES) $(SHEADERS) $(KSOURCES) $(KHEADERS) $(USOURCES) buildfile

