# $Id: Makefile,v 1.1 94/07/11 18:34:40 listserv Exp Locker: listserv $
#-------------------------------------------------------------------------
#  TULP - Unix Mailing List manager (sub-set of FRECP's
#         Bitnet Listserv tool).
#
#  Copyright (C) 1991-1994  Kimmo Suominen, Christophe Wolfhugel
#
#  Please read the files COPYRIGHT and AUTHORS for the extended
#  copyrights refering to this file.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 1, or (at your option)
#  any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#----------------------------------------------------------------------
#
# Generic flags
CC	=       cc
#CC	=	gcc #-Wall  # I do not have gcc so attend lots of warnings
CFLAGS	=       -g
LDFLAGS	=	-g
# If your linker needs some...
#LIBS	=       
#
# AIX does not require any special LIB. Use the standard cc also.
#
# Apple A/UX 3 (junk Unix) needs Posix options and you'll have to replace
# a u_int by unsigned int in popen.c, I forgot that on the patch. Another
# good solution would be to get a real Unix system.
#CFLAGS =	-ZP
#
# On HP-UX
#CFLAGS	=	-Aa -D_HPUX_SOURCE -O
#
# SVR4 requires following libraries
#LIBS	=	-lsocket -lnsl

# Directory where the binaries and other stuff will reside
INSTDIR	=	/usr/local/etc/tulp
MAN5	=	/usr/share/man/man5
MAN8	=	/usr/share/man/man8

# User and group to whome INSTDIR should belong, USER must be the
# user under which TULP will be running.
USER	=	listserv
GROUP	=	listserv

# Path to your system's Berkeley install program 
INSTALL	=	/usr/ucb/install	# AIX3, ...
#INSTALL =	installbsd		# DEC OSF/1

#---- Stop you should not need to modify anything below ---

EXE	=	listserv queue
UTILS	=	Makefile
#
SRC	=	l.c lc.c lp.c str.c ad.c vers.c fakesyslog.c popen.c queue.c
OBJ1	=	l.o lc.o lp.o str.o ad.o vers.o fakesyslog.o popen.o
OBJ2	=	queue.o fakesyslog.o
INC	=	conf.h ext.h ad.h fakesyslog.h l.h lc.h lp.h popen.h str.h

# Standard targets

all: listserv queue

listserv: $(OBJ1)
	$(CC) $(LDFLAGS) -o listserv $(OBJ1) $(LIBS)

queue: $(OBJ2)
	$(CC) $(LDFLAGS) -o queue $(OBJ2) $(LIBS)
lint:
	lint $(SRC)

install: listserv queue deliver rc.tulp tulp.5 tulp.8
	-mkdir $(INSTDIR); chmod 755 $(INSTDIR)
	chown $(USER) $(INSTDIR); chgrp $(GROUP) $(INSTDIR)
	$(INSTALL) -g $(GROUP) -o $(USER) -m 711 listserv $(INSTDIR)
	$(INSTALL) -g $(GROUP) -o $(USER) -m 4711 queue $(INSTDIR)
	$(INSTALL) -g $(GROUP) -o $(USER) -m 755 deliver $(INSTDIR)
	$(INSTALL) -g $(GROUP) -o $(USER) -m 755 rc.tulp $(INSTDIR)
	$(INSTALL) -g bin -o bin -m 444 tulp.5 $(MAN5)
	$(INSTALL) -g bin -o bin -m 444 tulp.8 $(MAN8)

clean:
	rm -f $(EXE) $(OBJ1) $(OBJ2)

# Dependencies

ad.o: conf.h ext.h internal.h
fakesyslog.o: conf.h fakesyslog.h internal.h
queue.o: conf.h internal.h fakesyslog.h
l.o: conf.h ext.h lp.h str.h popen.h ad.h lc.h fakesyslog.h internal.h
lc.o: conf.h ext.h l.h lp.h messages.h str.h popen.h fakesyslog.h internal.h
lp.o: conf.h ext.h str.h fakesyslog.h internal.h
popen.o: conf.h fakesyslog.h internal.h
str.o: conf.h internal.h
vers.o: conf.h internal.h
