--- Makefile.in.orig	2021-05-06 08:04:55 UTC
+++ Makefile.in
@@ -31,14 +31,14 @@
 # @(#)$Id: Makefile.in,v 1.23 2006-10-31 12:31:27 f Exp $
 
 # targets recognised by this makefile:
-#   all, everything	- compiles ircii, ircio, ircflush and wserv
+#   all, everything	- compiles ircii, ircio, ircflush and wservz
 #   ircio		- compiles ircio
 #   ircflush		- compiles ircflush
-#   wserv		- compiles wserv
-#   install		- installs ircii, ircio, ircflush and wserv
+#   wservz		- compiles wservz
+#   install		- installs ircii, ircio, ircflush and wservz
 #   installirc		- installs ircii
 #   installio		- installs ircio
-#   installwserv	- installs wserv
+#   installwservz	- installs wservz
 #   installflush	- installs ircflush
 #   installscript 	- installs the scripts
 #   installhelp		- installs the help files
@@ -50,9 +50,9 @@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 bindir = @bindir@
-sharedir = @prefix@/share
+sharedir = @datadir@
 datarootdir = @datarootdir@
-mandir = @mandir@
+mandir = @mandir@/man1
 
 DESTDIR =
 
@@ -106,7 +106,7 @@ INSTALL_IRCFLUSH = $(bindir)/ircflush
 
 # This program allows you to use screen/xterm's to put new irc windows
 # on new screen/xterm windows.
-INSTALL_WSERV = $(bindir)/wserv
+INSTALL_WSERVZ = $(bindir)/wservz
 
 # This command will be used to install the irc help files.  If you don't
 # want to install them, replace with the following:
@@ -127,14 +127,13 @@ INSTALL_DATA = ./bsdinstall -c -m 644
 VERSION = @VERSION@
 
 SHELL = /bin/sh
-MAKE = make $(MFLAGS)
 MFLAGS ='CC=$(CC)'					\
 	'CFLAGS=$(CFLAGS)'				\
 	'DEFS=$(DEFS)'					\
 	'HELP_DIR=$(HELP_DIR)'				\
 	'INSTALL_IRC=$(INSTALL_IRC)'			\
 	'INSTALL_IRCIO=$(INSTALL_IRCIO)'		\
-	'INSTALL_WSERV=$(INSTALL_WSERV)'		\
+	'INSTALL_WSERVZ=$(INSTALL_WSERVZ)'		\
 	'IRCSHARE=$(IRCSHARE)'				\
 	'IRCPATH=$(IRC_PATH)'				\
 	'LDFLAGS=$(LDFLAGS)'				\
@@ -144,32 +143,23 @@ MFLAGS ='CC=$(CC)'					\
 	'LN=$(LN)'					\
 	'RM=$(RM)'
 
-all: scrollz scrollz.1
+all: scrollz scrollz.1 wservz
 
-install: all installbin installdirs installman installhelp
+install: all installbin installwservz installdirs installman installhelp
 
-scrollz: source/Makefile Makefile
-	@cd source; $(MAKE) all
+scrollz ircio ircflush wservz: source/Makefile Makefile
+	$(MAKE) -C source $(MFLAGS) $@
 
 scrollz.1: scrollz.1.in
 	sed -e "s,SHAREDIR,$(IRCSHARE)," < scrollz.1.in > scrollz.1
 
 installeverything:  install installman installflush installio \
-		    installwserv installhelp
+		    installwservz installhelp
 
-everything: all ircflush ircio wserv
+everything: all ircflush ircio wservz
 
 ircserv: ircio
 
-ircio: source/Makefile
-	@cd source; $(MAKE) ircio
-
-ircflush: source/ircflush.c source/Makefile
-	@cd source; $(MAKE) ircflush
-
-wserv: source/wserv.c source/term.c source/Makefile
-	@cd source; $(MAKE) wserv
-
 installbin: installirc
 
 installirc: scrollz installdirs
@@ -190,8 +180,8 @@ installio: ircio installdirs
 installflush: ircflush installdirs
 	$(INSTALL) source/ircflush $(DESTDIR)/$(INSTALL_IRCFLUSH)
 
-installwserv: wserv installdirs
-	$(INSTALL) source/wserv $(DESTDIR)/$(INSTALL_WSERV)
+installwservz: wservz installdirs
+	$(INSTALL) source/wservz $(DESTDIR)/$(INSTALL_WSERVZ)
 
 installdirs:
 	umask 022; ./mkinstalldirs $(DESTDIR)/$(IRCSHARE) $(DESTDIR)/$(bindir) \
