SHELL = /bin/sh
.SUFFIXES:
.SUFFIXES: .c .o

GCC_FLAGS =  -Wpointer-arith -Wcast-align -Wcast-qual -Wtraditional -Wshadow\
  -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes
# -Wconversion


#XXGDB=1	# uncomment this to get it ready for use by xxgdb or gdb

ifdef XXGDB
DEBUG_OPTS=-g
LDFLAGS=-g
else
LDFLAGS=-s
endif

CC=gcc
LINK = $(CC)
LIBS = -lm
OPTS = -O2 -Wall $(GCC_FLAGS) $(DEBUG_OPTS) $(NNRP_OPT)
INSTALLDIR = /home/boby/doNews
INSTALL = install
VERSION=2.4.1

TARGETS = suck rpost testhost

all: $(TARGETS)
	@echo make done.

suck: suck.o both.o killfile.o timer.o
	$(LINK) suck.o both.o killfile.o timer.o $(LIBS) $(LDFLAGS) -o $@

lpost: lpost.o
	$(LINK) lpost.o $(LIBS) $(LDFLAGS) -o $@

rpost: rpost.o both.o
	$(LINK) rpost.o both.o $(LIBS) $(LDFLAGS) -o $@

testhost: testhost.o both.o
	$(LINK) testhost.o both.o $(LIBS) $(LDFLAGS) -o $@

install: $(TARGETS)
	$(INSTALL) -m 755 $(TARGETS) $(INSTALLDIR)

clean:
	rm -f *.o *[~%] core

cleanall: clean
	rm -f suck rpost lpost testhost suck.newrc suck.index suck.sorted suck.restart debug.*
	rm -rf Msgs

maketar: all clean
	tar -czv -f ../suck-${VERSION}.tar.gz -C .. suck-${VERSION}
		
# One of these days I have to get this to work without any error msgs
#depend:		
#	makedepend $(SRC)

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