# -*- makefile -*- # $Orig-Id: Makefile,v 1.16 1997/07/20 00:28:31 agulbra Exp $ # # Version of leafnode+. VERSION = 2.15 # # You can specify programs that this makefile uses here. # Programs for compilation. #CC = gcc #CC = cc #AR = ar #RANLIB = ranlib # Programs for distribution. #CP = cp #CHMOD = chmod #CHOWN = chown #GZIP = gzip -f9 #MKDIR = mkdir -p #RM = rm -f #SED = sed #TAR = tar # # You can specify the place programs are installed. #PREFIX = /usr/local #BINDIR = $(PREFIX)/sbin #MANDIR = $(PREFIX)/man # # If you want to build with debugging, use below. #CFLAGS += -g -Wall -Wformat -Wstrict-prototypes -Wmissing-prototypes # # If you want to use lockf rather than flock, use below. #CFLAGS += -DUSE_LOCKF # # If you want to stop a process when it fails to get a lock, use below. #CFLAGS += -DNOWAIT_LOCK # # If you want to use Socks, use below. #CFLAGS += -DSOCKS #LIBS += -lsocks5 # # If your system doesn't have fnmatch(), use below. #CFLAGS += -DNOFNMATCH # # If your system has POSIX's regcomp(), use below. CFLAGS += -DHAVE_POSIX_REGCOMP # # If your system has SYSV's regcmp(), use below. #CFLAGS += -DHAVE_REGCMP # # If your system has V8 regcomp(), use below. #CFLAGS += -DHAVE_V8_REGCOMP # # If your system doesn't have any regular expression functions, use below. #CFLAGS += -DNO_RE # # If you want to add no message-id, use below. #CFLAGS += -DNOMSGID # # If you want to make .newsgroup file in interesting.groups directory, # use below. #CFLAGS += -DDOTNGFILE # # If you don't want to prohibit wrong date format, use below. #CFLAGS += -DDONTSTRICTDATEFORMAT # # If you want to use IPv6, use below. It may work. CFLAGS += -DINET6 #LIBS += -L/usr/local/v6/lib -linet6 # # This is the directory where the news is stored. SPOOLDIR = /var/spool/leafnode # # This is the directory where the configuration and group information is # kept. It should preferably not be on the same partition as spooldir LIBDIR = /usr/local/lib/leafnode # # These are about local library. LIBUTIL = libutil.a LIBUTILFILES = activutil.o artutil.o config.o nntputil.o xnntputil.o xoverutil.o util.o all: leafnode fetchnews texpire checkgroups leaftool libutil.a: $(LIBUTILFILES) $(AR) cr $@ $(LIBUTILFILES) $(RANLIB) $@ leafnode: nntpd.o $(LIBUTIL) $(CC) $(CFLAGS) -o $@ nntpd.o -L. -lutil $(LIBS) fetchnews: fetch.o $(LIBUTIL) $(CC) $(CFLAGS) -o $@ fetch.o -L. -lutil $(LIBS) texpire: texpire.o $(LIBUTIL) $(CC) $(CFLAGS) -o $@ texpire.o -L. -lutil $(LIBS) checkgroups: checkgroups.o $(LIBUTIL) $(CC) $(CFLAGS) -o $@ checkgroups.o -L. -lutil $(LIBS) leaftool: leaftool.o $(LIBUTIL) $(CC) $(CFLAGS) -o $@ leaftool.o -L. -lutil $(LIBS) clean: $(RM) *.o $(LIBUTIL) core leafnode fetchnews texpire $(RM) checkgroups leaftool nntpd fetch newsfetch depend: makedepend *.c 2> /dev/null config.o: config.c Makefile $(CC) -c -DSPOOLDIR=\"$(SPOOLDIR)\" \ -DLIBDIR=\"$(LIBDIR)\" \ -DVERSION=\"$(VERSION)\" $< install: leafnode fetchnews texpire checkgroups leaftool $(CP) leafnode $(BINDIR)/leafnode $(CP) fetchnews $(BINDIR)/fetchnews $(CP) texpire $(BINDIR)/texpire $(CP) checkgroups $(BINDIR)/checkgroups $(CP) leaftool $(BINDIR)/leaftool $(CHMOD) 750 $(BINDIR)/leafnode $(CHMOD) 750 $(BINDIR)/fetchnews $(CHMOD) 750 $(BINDIR)/texpire $(CHMOD) 750 $(BINDIR)/checkgroups $(CHMOD) 750 $(BINDIR)/leaftool $(CHOWN) news.news $(BINDIR)/leafnode $(CHOWN) news.news $(BINDIR)/fetchnews $(CHOWN) news.news $(BINDIR)/texpire $(CHOWN) news.news $(BINDIR)/checkgroups $(CHOWN) news.news $(BINDIR)/leaftool $(CP) *.8 $(MANDIR)/man8 @if [ ! -d $(SPOOLDIR)/message.id ]; then echo don"'"t forget to do '"'make installall'"' to create $(SPOOLDIR)/message.id; fi @if [ -f $(BINDIR)/fetch ]; then echo don"'"t forget to change the name of a command in scripts and crontab from fetch into fetchnews.; fi @if [ -f $(BINDIR)/newsfetch ]; then echo don"'"t forget to change the name of a command in scripts and crontab from newsfetch into fetchnews.; fi installall: install -$(MKDIR) $(SPOOLDIR) $(LIBDIR) -$(MKDIR) $(SPOOLDIR)/message.id -$(MKDIR) $(SPOOLDIR)/interesting.groups -$(MKDIR) $(SPOOLDIR)/out.going cd $(SPOOLDIR)/message.id ; for a in 0 1 2 3 4 5 6 7 8 9 ; do \ for b in 0 1 2 3 4 5 6 7 8 9 ; do \ $(MKDIR) $${a}$${b}0 $${a}$${b}1 $${a}$${b}2 \ $${a}$${b}3 $${a}$${b}4 $${a}$${b}5 \ $${a}$${b}6 $${a}$${b}7 $${a}$${b}8 \ $${a}$${b}9 ; \ done ; done $(CP) config.example $(LIBDIR) $(CHOWN) -R news.news $(LIBDIR)/. $(SPOOLDIR)/. $(CHMOD) 2750 $(SPOOLDIR) @echo edit /etc/inetd.conf to start $(BINDIR)/leafnode dist: $(MKDIR) leafnode+-$(VERSION) $(SED) -e '/^;/d' README > leafnode+-$(VERSION)/README $(SED) -e '/^;/d' INSTALL > leafnode+-$(VERSION)/INSTALL $(SED) -e '/^;/d' FAQ > leafnode+-$(VERSION)/FAQ $(SED) 's/^VERSION *= .*/VERSION = '$(VERSION)'/' \ < Makefile > leafnode+-$(VERSION)/Makefile $(CP) *[a-z].8 COPYING Changes \ config.example leafnode.h \ nntpd.c texpire.c fetch.c checkgroups.c leaftool.c \ activutil.c artutil.c config.c nntputil.c xnntputil.c \ xoverutil.c util.c \ archivefaq.pl newsq leafnode+-$(VERSION) $(CHMOD) 644 leafnode+-$(VERSION)/* $(TAR) cf leafnode+-$(VERSION).tar leafnode+-$(VERSION) $(GZIP) leafnode+-$(VERSION).tar $(RM) -r leafnode+-$(VERSION)