TEST	= unpackmail
CONF	= UUCP-SRC:include
CFLAGS	= -I$(CONF) -DAMIGA -s0o0a0f0m0n0p0r0s
LFLAGS	= +Q -g
LIBS	= $(CONF)/uucp.lib -lc16
SRCS	= news.c showart.c reply.c mscan.c unpackmail.c manx.c

all:	run

x:	remake
	date >UUCP:Spool/error.log
	sdb -sN:!$(CONF) rnews testfiles/bigtest
	cat UUCP:Spool/error.log

xx:	remake
	sdb -sN:!$(CONF) postnews comp.sys.amiga.tech

sdb:	remake
	sdb -sN:!$(CONF) rnews <testfiles/test1 UseNet

jgn:	remake
	date >UUCP:Spool/error.log
	rnews <testfiles/test1
	rnews <testfiles/test1 UseNet
	rnews testfiles/test1
	rnews testfiles/test2
	rnews testfiles/test3
	rnews testfiles/test4
	rnews testfiles/test5
	rnews testfiles/test6
	cat UUCP:Spool/error.log

remake:
	@Greg:Aztec/Bin/make all

try:	T:$(TEST).test
	delete UUNEWS:mail.test/(?|??|???|.last|.read) quiet
	copy TMP:greg.incoming TMP:test.incoming
	sdb -sN:!II:lib T:$(TEST).test

T:$(TEST).test: $(TEST).c
	cc -DTEST $(CFLAGS) -o T:$(TEST).obj $(TEST).c
	ln $(LFLAGS) -o T:$(TEST).test T:$(TEST).obj $(LIBS)

asm:	T:$(TEST).asm
T:$(TEST).asm: $(TEST).c
	cc -DTEST $(CFLAGS) -at -o T:$(TEST).asm $(TEST).c

renews:
	@Greg:Aztec/Bin/make news

run:	tags renews
	news

nsdb:	tags renews
	sdb -sN:!II:lib news

tags:	$(SRCS)
	ctags >nil: $(SRCS)
	grep >News.todo FIXME $(SRCS)

install:
	@Greg:Aztec/Bin/make clean
	@Greg:Aztec/Bin/make install
	@Greg:Aztec/Bin/make clobber
	@delete (tags|News.todo) quiet
