##  $Revision: 1.3 $
SHELL	= /bin/sh
MAKE	= make

##  Configuration dependencies -- edit as appropriate
DEFS	=
CFLAGS	= $(DEFS) -Oeilsr -5r -zc -Wc,-fi=unix.h
LDFLAGS	= -Bstatic
LINTFLAGS=-b -h -u $(DEFS)
RANLIB	=

##  Manual pages -- install as appropriate for your system
DOC	= inn.conf.5

##  Configuration files -- install in /usr/lib/news
CONF	= inn.conf

##  Program sources
SOURCES = clientlib.c getconfig.c getfqdn.c remopen.c
OBJECTS = clientlib.o getconfig.o getfqdn.o remopen.o
HEADERS	= clibrary.h configdata.h libinn.h macros.h nntp.h paths.h

##  First target, just compile everything.
all:			libinn3r.lib $(DOC) $(CONF)
	date >$@

install:		libinn3r.lib
	-date >$@

clobber clean:
	rm -f foo core tags lint a.out *.o
	rm -f libinn3r.lib
	rm -f all install

libinn3r.lib:		$(OBJECTS)
	wlib $@ $(OBJECTS)
	$(RANLIB) $@

lint:			$(OBJECTS)
	-lint -u $(LINTFLAGS) $(SOURCES) >lint

subst:		subst.c subst.sh
	make c || make sh || { rm -f subst ; echo Failed 1>&2 ; }

config:		subst config.data $(DOC) $(HEADERS) Makefile
	./subst -f config.data $(DOC) $(HEADERS) Makefile
	date >config

c:
	@rm -f subst
	$(CC) -o subst subst.c
sh:
	@rm -f subst
	cp subst.sh subst
	chmod +x subst

##  Dependencies.  Default list, below, is probably good enough.
depend:		Makefile $(SOURCES)
	makedepend $(DEFS) $(SOURCES)

# DO NOT DELETE THIS LINE -- make depend depends on it.
$(OBJECTS):	$(HEADERS)
