# CFLAGS:
#	set -DJOBCONTROL if you have job control (BSD).
#	set -DSYSV -Dindex=strchr -Drindex=strrchr on Sytem V systems
#	set -Dregfree=free if you DON'T include reg.s (SYSV + some BSD)
#
# JOBCONTROL could be done as #ifndef SYSV, I suppose, but this clearly
# marks that particular difference.
#
# LIBS:
# should point to any extra libraries needed, such as termcap.  You
# may want to change this to use the curses termcap cover.  If you need
# to pull in another library to get regex / regcmp or strtok on non-SYSV
# systems, you may want to put that here
#
# EXTRAOBJS:
# may be used to include tmpnam.s, strtok.s, reg.s in the list.
#
# These objects implement SYSV utilities for BSD machines.
#
# strtok.s implements strtok() / strpbrk().  reg.s implements regex()/regcmp()
# on top of the BSD regular expression library (regex() allows multiple
# regular expressions).  tmpnam.s implements tmpnam() of course.
#
# If you have them, use your own regex/regcmp, because:
#
#	i) They should be faster than the reg.c code, which
#	recompiles the "current" ucb string every time you
#	switch regular expressions.
#
#	ii) I briefly checked out reg.c once, and it seemed to
#	work.  Our system has the "real" calls available, so I
#	run with those.  reg.c hasn't been used much by me, although
#	I've had nobody tell me it doesn't work.
#
# if you DON'T include reg.s, be sure you set -Dregfree=free in CFLAGS.
#
# As with regex, if you have a system strtok(), it is likely more efficient -
# string routines will often be done in assembler on a given machine.
#
# Even if you have it, you can use tmpnam.s anyhow.  This version will tailor
# the temp file name to vnXXXXXX, instead of a generic tmpXXXXXX.
#

# AMIGA
CC = dcc
CFLAGS = -c -DSYSV -Damiga -Dindex=strchr -Drindex=strrchr -DDIRSEP='/'   \
	 -Odh0:source/vn/
LFLAGS = 
LIBS=
SERVEROBJS = std.o
EXTRAOBJS = termcap.o regexp.o reg.o regcompat.o amiga.o stat2.o getenv.o \
	    rand.o mktemp.o
now: vn
# the vn define is necessary for the moment as I mean to make the amiga.c
# routine general enougth for other projects and I put some code in amiga.c
# to map the cursor keys to the UP,DOWN,FORWARD,BACK (j/k/BSP/RETURN)
# in vn.
amiga.o: amiga.c
	$(CC) $(CFLAGS) -Dvn $*.c
	
# MSDOS
#CC = cl
#CFLAGS = -Oint -Gs -DSYSV -Dindex=strchr -Drindex=strrchr -AL -DDIRSEP='\\' \
#	-Dchdir=doschdir
#LFLAGS = -link /NOI /ST:0x5000 /CP:0xffff
#LIBS=
#SERVEROBJS = std.obj
#EXTRAOBJS = termcap.obj regexp.obj reg.obj regcompat.obj msdos.obj

# "vanilla" BSD:
#LIBS = -ltermcap
#EXTRAOBJS = tmpnam.s strtok.s reg.s
#CFLAGS = -O -DJOBCONTROL
#
# "vanilla" SYSV:
#LIBS = -ltermcap
#EXTRAOBJS = tmpnam.s
#
# BSD with strtok() / regex(), such as ULTRIX.  These are the rules
# used for our installation (rtech is a microvax running ULTRIX):
#LIBS = -ltermcap
#EXTRAOBJS = tmpnam.s
#CFLAGS = -O -DJOBCONTROL -Dregfree=free

#
# Minix!!!
#	Regular expressions: Use reg.c to turn regcmp into re_comp
#	and regex into re_exec. Use regcompat.c to turn re_comp into
#	regcomp and re_exec into regexec. Wow! What a load of old
#	cobblers.
#LIBS =
#EXTRAOBJS = tmpnam.s strtok.s reg.s
#EXTRAOBJS = tmpnam.s reg.s regcompat.s
#CFLAGS = -F -O -DMINIX -DSYSV

# SERVEROBJS defines the object(s) for the vns_xxxx "server" interface.
#
#	std.s is the version for "standard" news, making use of the
#	users .newsrc file, and  resident articles / active file.
#
#SERVEROBJS = std.obj
#EXTRAOBJS = termcap.obj regexp.obj reg.obj regcompat.obj

# normal vn objects
#
VNOBJS=	hash.o envir_set.o pagefile.o reader.o storage.o sig_set.o \
term_set.o tty_set.o userlist.o vn.o vnglob.o digest.o strings.o \
session.o printex.o getch.o help.o newdisp.o stat.o svart.o

# This is to force you to read the makefile.  Once you have, comment this rule,
# and uncomment the "real" rule.  At the minimum, you will also have to
# uncomment one of the three sets of LIBS / EXTRAOBJS & CFLAGS definitions
# above.
#
#vn:
#	@echo "PLEASE READ THE MAKEFILE"
vn:	$(VNOBJS) $(EXTRAOBJS) $(SERVEROBJS)
#	cl -Fevn $(VNOBJS) $(EXTRAOBJS) $(SERVEROBJS) $(LIBS)
#	cc -o vn *.o $(LFLAGS)
	dlink @dfiles -o vn

digest.o:	digest.c config.h head.h node.h page.h tune.h
envir_set.o:	envir_set.c config.h tune.h vn.h
getch.o:	getch.c config.h vn.h
hash.o:		hash.c config.h node.h tune.h
help.o:		help.c config.h node.h page.h reader.h tty.h tune.h vn.h
newdisp.o:	newdisp.c config.h node.h tty.h
pagefile.o:	pagefile.c node.h page.h tune.h
printex.o:	printex.c config.h tty.h
reader.o:	reader.c config.h brk.h head.h node.h page.h reader.h  \
		tty.h tune.h vn.h
regcompat.o:	regcompat.c
session.o:	session.c config.h brk.h head.h node.h page.h tty.h tune.h \
		vn.h
sig_set.o:	sig_set.c config.h node.h page.h tty.h tune.h
stat.o:		stat.c config.h node.h
std.o:		std.c config_std.h brk.h head.h server.h std.h
storage.o:	storage.c node.h page.h tune.h
strings.o:	strings.c node.h page.h tune.h
svart.o:	svart.c config.h node.h page.h tty.h tune.h
term_set.o:	term_set.c config.h node.h page.h tty.h tune.h
tty_set.o:	tty_set.c tty.h
tmpnam.o:	tmpnam.c config.h
userlist.o:	userlist.c node.h page.h tune.h vn.h
vn.o:		vn.c node.h tty.h
vnglob.o:	vnglob.c config.h brk.h head.h node.h page.h tune.h
